cloudflare
Audited by Socket on Nov 3, 2026
2 alerts found:
SecurityAnomalyThis fragment includes multiple request middleware patterns, most of which are conventional (security headers, geo redirect, A/B testing, bot blocking). However, the /api/ 'X-Internal-Auth' injection uses a hardcoded token and deletes the caller’s Authorization header before forwarding—an alarming authentication-manipulation behavior that could indicate sabotage/backdoor-style access control. Additionally, the maintenance bypass uses a hardcoded 'admin' token and CORS is permissive with wildcard origin and Authorization-related allowances. These elements warrant strong scrutiny before use.
The provided code fragment is consistent with a telemetry forwarding tail handler and does not show overt malware or obfuscation. However, it unconditionally sends trace-derived request metadata—specifically `event.event?.request?.url`—to an external network endpoint via HTTP POST. If platform redaction is incomplete or `LOG_ENDPOINT` is not strictly trusted/controlled, this can constitute a meaningful sensitive-data exfiltration risk. Recommended mitigations: enforce destination allowlisting for `LOG_ENDPOINT`, omit or strongly sanitize/normalize the URL (e.g., drop query/identifiers), and rely on/redact-verify only the minimum fields required.