Jun 18, 2026·6 min read·27 visits
Unauthenticated remote attackers can bypass JWT/OIDC validation in @acastellon/auth < 2.3.0 by spoofing the 'auth-user' and 'Host' headers.
An unauthenticated authentication bypass vulnerability exists in @acastellon/auth, an authorization middleware package for Express-based microservices. The vulnerability allows a remote, unauthenticated attacker to completely bypass token validation checks in the validateToken() middleware via spoofed HTTP headers.
The @acastellon/auth NPM package is an Express-based middleware library designed to handle unified authentication across microservice architectures. It integrates support for diverse protocols, including JWT, NTLM, and OpenID Connect (OIDC). By registering the validateToken(app) middleware, developers protect downstream API endpoints by requiring incoming requests to possess valid, cryptographically verified tokens.
In versions of the library prior to 2.3.0, a structural flaw exists in how the middleware handles service-to-service communication. To allow legitimate internal systems to interact without token validation, a dedicated trusted peer exception was implemented. However, this exception relies entirely on client-controlled values, establishing an authentication bypass vulnerability classified as CWE-290 (Authentication Bypass by Spoofing).
Because the middleware does not perform cryptographic validation of the client's identity when triggering this exception, any network adversary can exploit this pathway. An unauthenticated remote attacker can easily assume the identity of a trusted internal component, bypassing all authentication mechanisms. This access compromises the confidentiality and integrity of any API route secured by the module.
The root cause of the vulnerability lies within the validateToken function inside the auth.js module of @acastellon/auth version 2.2.0. The middleware attempts to authorize requests from a trusted internal service identity designated as service-brother using non-cryptographic attributes retrieved directly from the HTTP request context.
Specifically, the application parses the auth-user custom header and compares it against the hardcoded literal 'service-brother'. Simultaneously, the code retrieves the request's Host header via req.get('host') and asserts that it matches the configured server hostname or CNAME value returned by getHostName(). If both conditions are evaluated as true, the execution flow is immediately redirected to the Express next() function.
This logic represents a critical security failure because both the auth-user and Host headers are fully controlled by the client. The middleware trusts these attributes implicitly without validating the client's actual network boundary or cryptographic signature. Consequently, an attacker can supply these values arbitrarily, satisfying the conditional logic and preventing the subsequent token verification block from executing.
To understand the precise differences in execution flow, we compare the vulnerable implementation in version 2.2.0 with the corrected logic introduced in version 2.3.0. The patch replaces the insecure header evaluation with cryptographic Mutual TLS (mTLS) certificate verification and introduces mandatory sanitization for incoming request headers.
The vulnerable code path completely trusts incoming headers and passes them down the middleware chain. This allows an attacker to not only bypass token validation but also inject arbitrary user parameters or roles such as is-admin: true directly into the request headers. These headers are subsequently trusted by downstream route handlers.
The patched implementation in version 2.3.0 introduces the sanitizeIncomingAuthHeaders function, which runs first in the middleware lifecycle. This function explicitly deletes the client-supplied auth-user header and any headers starting with the is- prefix. Following sanitization, the middleware utilizes checkMtlsServiceAuth to perform secure authentication. This function retrieves the peer certificate from the TLS socket and validates the Common Name (CN) against an authorized list, injecting the authenticated context only after verifying the transport-layer identity.
Exploitation of GHSA-GFJ5-979R-92PW does not require specialized tooling, active session tokens, or pre-existing credentials. The attack surface is exposed to any network entity capable of issuing HTTP requests to the target microservice endpoint.
An attacker begins by identifying an API route protected by the vulnerable version of the library. They then construct an HTTP request that mimics the trusted peer service. By manually crafting the headers, the attacker supplies 'service-brother' in the auth-user header and specifies the target's public-facing CNAME or hostname in the standard Host header.
GET /api/v1/protected-resource HTTP/1.1
Host: target-api.example.com
auth-user: service-brother
is-admin: true
Connection: closeUpon receipt, the @acastellon/auth middleware matches the header values against the hardcoded conditions. Because the condition is met, the code immediately invokes next(). The unsanitized is-admin: true header is preserved, allowing the attacker to interact with the target microservice with administrative privileges.
The impact of this vulnerability is classified as Critical, as reflected by its CVSS v4.0 score of 9.3. The flaw permits complete authorization bypass, rendering cryptographic tokens, session states, and directory-service mappings (such as NTLM/LDAP) entirely ineffective.
Because downstream microservices in a distributed architecture often trust headers forwarded by gateway middleware, the absence of header sanitization in @acastellon/auth version 2.2.0 exposes internal APIs to privilege escalation. Attackers can control the context variables used by the application to enforce role-based access control (RBAC).
This vulnerability can lead to unauthorized data exfiltration, system state modification, and full takeover of the application interface. If the target endpoint exposes administrative actions, the unauthenticated attacker can execute state-changing operations without leaving standard audit trails.
The primary remediation step is upgrading the @acastellon/auth dependency to version 2.3.0 or higher. This update removes the insecure header-based bypass mechanism, implements header sanitization, and shifts the peer validation architecture to Mutual TLS (mTLS).
To secure internal service-to-service communication, developers must configure the application to utilize client certificates. The updated middleware reads the peer certificate from the incoming socket connection and verifies that the Common Name (CN) matches one of the authorized values listed in the TRUSTED_MTLS_SERVICES configuration array.
const auth = require('@acastellon/auth')({
TRUSTED_MTLS_SERVICES: ['trusted-gateway', 'internal-worker']
});For environments where immediate dependency updates are not feasible, temporary mitigation can be implemented at the API Gateway or reverse proxy layer. Administrators should construct rewrite rules to drop incoming auth-user headers and any headers prefixed with is- at the external perimeter. This prevents external clients from injection attacks against the internal context.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N| Product | Affected Versions | Fixed Version |
|---|---|---|
@acastellon/auth @acastellon | < 2.3.0 | 2.3.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-290 |
| Attack Vector | Network |
| CVSS Score | 9.3 (CVSS v4.0) |
| EPSS Score | N/A |
| Impact | Complete Authentication Bypass |
| Exploit Status | PoC Available |
| KEV Status | Not Listed |
The software trusts a spoofable attribute, such as a source IP address, DNS hostname, or HTTP header, to establish identity, allowing attackers to bypass authentication checks.
CVE-2026-16454 is an object-level authorization bypass vulnerability (CWE-284, CWE-862) in Eclipse hawkBit versions 1.0.3 and prior. The flaw exists within the Direct Device Integration (DDI) REST controller (hawkbit-ddi-resource), where endpoints responsible for enumerating software module metadata and serving firmware binaries fail to verify whether the requested software module is assigned to the authenticated device. Consequently, any device with valid credentials (such as a TargetToken or GatewayToken) can enumerate software module identifiers and download arbitrary firmware artifacts across the entire tenant namespace.
CVE-2026-62284 (GHSA-5w5g-j6hw-6p8f) is a code injection and server-side request forgery vulnerability in the console-proxy component of the OSAC Operator. The RemoteConfigResolver parses Kubernetes Secrets containing kubeconfig files via clientcmd.RESTConfigFromKubeConfig without sanitizing execution-related fields. An attacker with RBAC permissions to create or modify labeled Secrets in monitored namespaces can supply a malicious exec credential plugin, resulting in arbitrary command execution within the console-proxy pod.
CVE-2026-62361 (GHSA-xgjr-7j9q-2h4r) is an authenticated SQL injection and authorization bypass vulnerability in listmonk, an open-source, self-hosted newsletter and mailing list manager written in Go. In versions prior to 6.2.0, the subscriber export endpoint (GET /api/subscribers/export) directly interpolates user-supplied SQL filter expressions into a PostgreSQL query without invoking the table allowlist validation function (validateQueryTables). Consequently, authenticated users possessing the subscribers:sql_query and subscribers:get_all permissions can bypass relational access controls, execute arbitrary subqueries against restricted tables such as users and settings, and modify database state via writable Common Table Expressions (CTEs).
CVE-2026-28385 (GHSA-3gq2-x4qg-p4g6) is a Server-Side Request Forgery (SSRF) vulnerability in Canonical LXD versions 4.12 through 6.9. An authenticated user possessing the can_create_images entitlement can force the LXD daemon to execute arbitrary outbound HTTP and HTTPS requests via the /1.0/images API endpoint. Due to the absence of egress destination validation, an attacker can probe host loopback services, RFC 1918 private network segments, and cloud Instance Metadata Services (IMDS) from the network position of the privileged LXD daemon.
Canonical LXD and LXC Incus contain an arbitrary file write vulnerability (CWE-73 / CWE-59) in the `/1.0/instances/<name>/exec` REST API endpoint. When an instance is unpacked from an image archive, top-level symbolic links are extracted directly onto the host filesystem within the instance storage directory. If a crafted image includes a symbolic link named `exec-output` pointing to an arbitrary host path, invoking the execution endpoint with `record-output: true` causes the privileged host daemon to follow the symlink and write command output files directly to the target host directory. An authenticated attacker with permissions to import images and execute commands can exploit this flaw to write controlled content to sensitive host directories such as `/etc/cron.d`, resulting in arbitrary code execution on the host as `root`.
CVE-2026-48749 (tracked as GHSA-vghh-5rfx-xhq8 for LXD and GHSA-2q3f-q5pq-g8wv for Incus) is a critical container escape vulnerability in the Canonical LXD and Linux Containers Incus system container managers. By importing a specially crafted container image archive containing duplicate tar member headers, an authenticated attacker can replace the instance rootfs directory with a symbolic link pointing to the underlying host root filesystem. When performing file operations on a stopped container, the privileged forkfile helper binary resolves the symbolic link without confinement and chroots directly into the host filesystem, granting arbitrary root-level file read and write access.