Summary
An improper authentication weakness in waoowaoo up to version 0.4.1 allows abuse of the x-internal-user-id request header in several API-auth helper functions.
Under certain conditions, a remote attacker can bypass expected user and project authentication checks, potentially gaining unauthorized access to internal task sessions.
Affected context
This vulnerability occurs in waoowaoo's internal task and authentication handling layer, specifically within the src/lib/api-auth.ts library.
It affects deployments that rely on getInternalTaskSession, getAuthSession, requireUserAuth, requireProjectAuth, or requireProjectAuthLight to enforce access control based on the x-internal-user-id request header.
The risk is highest where API clients can control this header directly and where there are no strong cross-checks against a trusted identity source.
Exploit preconditions
- Attack surface: HTTP(S) endpoints that use the Internal Task Header Handler and trust
x-internal-user-idfor authentication or authorization decisions. - Required access: Network-level ability to send crafted requests to affected waoowaoo API endpoints (e.g., over the public internet or within an internal network).
- Trigger point: Invocation of
getInternalTaskSession,getAuthSession,requireUserAuth,requireProjectAuth, orrequireProjectAuthLightwhen the request contains a manipulatedx-internal-user-idheader. - Why exploitation is possible: The authentication logic improperly trusts the header value without sufficiently verifying that it is bound to a legitimate, authenticated principal, leading to CWE-287 (Improper Authentication).
Why this happens
The core issue is that the authentication middleware conflates header presence with proven identity, treating the x-internal-user-id argument as a trusted source of truth.
Instead of deriving the user context from a strongly authenticated mechanism (such as session tokens, signed cookies, or verified JWTs), the implementation allows caller-controlled header data to drive access decisions.
This pattern maps directly to CWE-287: Improper Authentication, where the system performs authentication steps incorrectly or incompletely, enabling adversaries to appear as other users or bypass checks.
Potential impact
- Attackers may gain unauthorized access to internal task sessions and project resources.
- API operations intended for authenticated users could be executed by unauthenticated or incorrectly authenticated clients.
- Sensitive data associated with projects or tasks could be read or modified by arbitrary remote callers.
- Integrity of application workflows and audit trails can be compromised by spoofed identities.
General mitigation guidance
Effective mitigations focus on removing trust in caller-controlled headers for identity and strictly separating transport metadata from authentication state.
Common defensive patterns include:
- Deriving user identity from cryptographically verifiable tokens (e.g., signed JWTs, session cookies) rather than arbitrary headers.
- Ensuring that internal headers, if used, are injected only by a trusted gateway or proxy and are not writable by external clients.
- Centralizing authentication logic so that helper functions such as
requireUserAuthandrequireProjectAuthconsume validated identity objects, not raw request fields. - Applying least-privilege principles to any internal task or project operations, so that even if a user context is misclassified, downstream actions are constrained.
How teams detect issues like this
Detection usually starts with reviewing authentication and authorization code paths to find places where user identity or permissions depend on unverified request headers.
Static analysis rules can flag direct use of headers like x-internal-user-id in auth helpers, especially when used as primary identity keys.
During code review, security teams look for missing bindings between identity, sessions, and cryptographic verification, as well as duplicated or ad hoc auth checks scattered across handlers.
Organizations may also enforce policies requiring all authentication decisions to flow through a dedicated, vetted auth module and use automated tools to ensure that only approved patterns appear in the codebase.

