Skip to content

Security: ComRobertSoftwareLabsIncon/ChatGPT_Intelligence_Bridge

Security

SECURITY.md

CIB security review — v1.0.1 foundation

Scope

This review covers the HTTP bridge, request validation, authentication, rate limiting, and the cloud fallback adapter on implementation/v1.0.1-foundation.

Controls confirmed in source

  • Bearer-token authentication uses a length check and timingSafeEqual.
  • The request body is capped at 64 KiB while it is streamed.
  • Request fields are allow-listed and individual text/session fields have limits.
  • Provider failures are returned to clients as a generic 502 response.
  • Prompt contents and credentials are not written to application logs.
  • Responses use Cache-Control: no-store and X-Content-Type-Options: nosniff.
  • Cloud fallback requires the explicit NEED_CLOUD marker.
  • The OpenAI adapter uses a 25-second timeout and does not expose provider error bodies.

Changes in this review

  • The server now accepts a RateLimiter dependency whose check method may be asynchronous.
  • Trusted reverse-proxy handling is opt-in through trustedProxies; untrusted forwarded headers cannot override the TCP peer used for rate limiting.
  • Added a provider-neutral shared limiter adapter. It hashes client keys before storage and requires a backend-provided atomic increment with first-write expiry. This permits a host-specific shared/atomic store without making Redis or another vendor a mandatory dependency. The in-memory implementation remains the default for a single process.
  • The JSON media type is checked exactly after removing optional parameters; values such as application/jsonp are rejected.
  • The in-memory limiter now validates finite window sizes and integer key limits.
  • The HTTP server applies 10-second header, 30-second request, and 5-second keep-alive timeouts.
  • A rate-limiter backend failure now returns a generic 503 response instead of leaving the request unresolved.
  • CI now uses the committed lockfile with npm ci and has read-only repository contents permission.
  • Rate-limit tests cover concurrent checks and isolation between client keys.

Deployment requirements and remaining risks

  • The default in-memory limiter is process-local. Multiple server instances must inject the createSharedRateLimiter adapter with an AtomicRateLimitStore implementation that performs increment and first-write expiry atomically across instances. The repository does not bundle or mandate Redis or another storage provider.
  • Rate-limit identity uses the TCP peer address by default; X-Forwarded-For is ignored. The optional trustedProxies allow-list accepts exact IPs/CIDRs. Forwarded chains are considered only when the direct TCP peer is trusted, are traversed right-to-left, and fall back to the TCP peer when malformed or longer than 20 hops. Configure only actual proxy egress addresses and prevent direct access that bypasses the proxy.
  • Terminate HTTPS at a trusted hosting platform or reverse proxy. This Node server does not configure TLS itself.
  • Store BRIDGE_TOKEN and OPENAI_API_KEY in the host's secret manager; rotate them if exposed. Never commit live credentials or place them in Shortcut URLs.
  • Apply platform-level connection limits and an overall concurrency limit before public deployment; application-level HTTP timeouts do not replace edge/proxy connection controls.
  • The health endpoint is intentionally unauthenticated and returns only service status.
  • A successful source review and CI run are not a penetration test or a production security certification.

Model configuration

The code keeps gpt-6-luna as its default. Confirmed against the current OpenAI API model catalog/pricing documentation on 2026-12-04. Deployments may override it with OPENAI_MODEL.

There aren't any published security advisories