Summary
SmythOS sre up to version 0.0.15 contains an authentication weakness where specially crafted HTTP headers (X-DEBUG-RUN / X-DEBUG-INJ) can influence the AgentRuntime authentication flow.
Under certain conditions, a remote attacker can manipulate these headers to bypass or weaken authentication checks, potentially gaining access to functionality that should require stronger verification.
Affected context
The vulnerability resides in the AgentRuntime function within packages/core/src/subsystems/AgentManager/AgentRuntime.class.ts, specifically in the HTTP Header Handler logic that processes debug-related headers (X-DEBUG-RUN and X-DEBUG-INJ).
It affects deployments where:
- The SmythOS sre service is reachable over the network.
- Incoming HTTP requests are allowed to carry these debug or control headers.
- The runtime uses header values as part of authentication, authorization, or mode selection decisions without strong verification that the caller is trusted.
Exploit preconditions
- Attack surface: Public or internal HTTP endpoints exposed by the SmythOS sre service.
- Required access: Ability to send crafted HTTP requests to the service (no prior authentication necessarily required).
- Trigger point: Processing of
X-DEBUG-RUNand/orX-DEBUG-INJheaders by theAgentRuntimeHTTP Header Handler. - Why exploitation is possible: The implementation treats specific header values as a signal to enable or alter runtime behavior, including authentication-related logic, without robust validation that the request originates from a trusted entity or environment. As a result, an attacker can influence authentication outcome by directly setting these headers.
Why this happens
The core issue is an improper authentication design where trust decisions depend on easily spoofed HTTP headers. Instead of deriving identity and permissions from strong credentials or secure tokens, the AgentRuntime logic appears to use debug headers (X-DEBUG-RUN / X-DEBUG-INJ) to modify behavior in ways that impact access control.
This maps to CWE-287: Improper Authentication, because:
- The system relies on attributes under attacker control (HTTP headers) as an authentication or access-enabling mechanism.
- Debug or internal control paths are reachable in production-like contexts without adequate isolation or secondary checks.
- There is no robust assurance that the entity setting these headers is authorized to activate those modes.
Potential impact
- Unauthorized invocation of
AgentRuntimefunctionality that should be restricted. - Bypass of normal authentication flows under specific header configurations.
- Execution of actions in a "debug" or elevated mode that exposes sensitive data or internal behavior.
- Facilitation of further attacks, such as information disclosure or privilege escalation within the application environment.
- Increased risk of lateral movement if the compromised component orchestrates or accesses other internal services.
General mitigation guidance
Mitigation should focus on removing trust in unvalidated control headers and hardening authentication boundaries:
- Avoid using HTTP headers like
X-DEBUG-RUNorX-DEBUG-INJas authenticators or switches for privileged behavior; ensure all privileged operations are gated by strong, user- or service-bound authentication and authorization. - Isolate debug, test, or developer-only modes so that they:
- Are disabled by default in production.
- Cannot be enabled purely via client-controlled headers.
- Require separate, strongly authenticated administrative channels if they must exist.
- Apply strict access control on any endpoints or code paths triggered by special headers, enforcing role and permission checks independent of header values.
- Normalize and sanitize request metadata before it reaches business logic, treating all client-supplied headers as untrusted.
- Implement least-privilege design for runtime components so that even if a header influences behavior, the resulting code executes with minimal necessary permissions and limited data exposure.
How teams detect issues like this
Detection can leverage a combination of code-level review and runtime monitoring:
- Static analysis / code review:
- Search for code paths where authentication or authorization decisions depend on request headers like
X-DEBUG-*,X-INTERNAL-*, or similar patterns. - Flag logic that toggles authentication bypasses, debug modes, or privileged actions solely based on header presence or value.
- Review
AgentRuntimeand related classes for conditional branches that circumvent normal credential checks. - Policy and configuration checks:
- Enforce internal coding guidelines that prohibit header-based debug toggles in production paths.
- Use automated linters or custom rules to detect the use of debug headers wired into authentication logic.
- Runtime monitoring:
- Log all requests that include
X-DEBUG-RUN,X-DEBUG-INJ, and related headers, and alert on unusual patterns or sources. - Correlate suspicious headers with unexpected authentication successes or access to sensitive functionality.

