MEDIUM 6.5

CVE-2026-50630: Apache CXF OAuth2 CRLF Injection Vulnerability

A flaw in Apache CXF's OAuth2 authentication mechanism allows attackers to inject line breaks into HTTP response headers. By crafting a malicious realm parameter, an attacker can trick the server into sending arbitrary headers or fragmenting the response entirely, potentially leading to session hijacking, cache poisoning, or other header-based attacks. The vulnerability affects versions before 4.2.2 and 4.1.7.

Source data · NVD / CISA · public domain

CVSS
3.1 · 6.5 MEDIUM · CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
Weaknesses (CWE)
CWE-113
Affected products
1 configuration(s)
Published / Modified
2026-06-12 / 2026-06-17

NVD description (verbatim)

A CRLF injection vulnerability exists in the OAuth2 AuthorizationUtils class. When constructing the WWW-Authenticate response header, the 'realm' parameter is concatenated without sanitizing Carriage Return (CR) and Line Feed (LF) characters. If an attacker can control the realm value, they can inject arbitrary HTTP headers or split the HTTP response entirely. Users are recommended to upgrade to versions 4.2.2 or 4.1.7, which fixes this issue.

2 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-50630 is a CRLF (Carriage Return/Line Feed) injection vulnerability in the OAuth2 AuthorizationUtils class of Apache CXF. The vulnerability stems from unsafe concatenation of the 'realm' parameter into the WWW-Authenticate response header without sanitization of CR (\r, 0x0D) and LF (\n, 0x0A) characters. An attacker controlling the realm value can inject newline sequences to introduce additional HTTP headers, terminate headers prematurely, or split the HTTP response, violating RFC 7230 compliance. The CVSS 3.1 score of 6.5 (Medium) reflects network accessibility, low attack complexity, no privilege requirement, and combined low confidentiality and integrity impact.

Business impact

Successful exploitation can enable cache poisoning attacks where injected headers cause downstream proxies or CDNs to cache poisoned responses. Attackers may inject Set-Cookie headers to establish unauthorized sessions, inject X-Frame-Options bypass headers, or use response splitting to conduct phishing attacks. In federated OAuth2 environments, this could compromise trust relationships between identity providers and service providers, affecting user authentication flows at scale.

Affected systems

Apache CXF versions prior to 4.2.2 (current branch) and 4.1.7 (legacy branch) are vulnerable. Organizations using CXF for OAuth2 authentication, particularly in microservices architectures or API gateway deployments, should prioritize assessment. The vulnerability applies regardless of deployment model (on-premises, cloud) or whether CXF is directly embedded or used as a library.

Exploitability

Exploitation requires the attacker to control or influence the realm parameter passed to the OAuth2 authentication mechanism. In typical deployments, this occurs when realm values are derived from user-supplied input, request headers, or insufficiently validated configuration. Network access is required but no authentication or user interaction is necessary. The attack surface depends on whether realm is externally controllable in your deployment; many standard configurations may have limited exposure, but custom implementations with dynamic realm assignment are at higher risk.

Remediation

Upgrade Apache CXF to version 4.2.2 or 4.1.7 (or later) immediately. These releases include sanitization of CRLF characters in the realm parameter. For environments unable to upgrade immediately, implement input validation and canonicalization of realm values at the application layer, rejecting any realm containing CR or LF bytes. Additionally, deploy HTTP response header validation at reverse proxies or WAF layers to block or sanitize injected headers.

Patch guidance

Apply the following patches: Apache CXF 4.2.2 (for the main branch) or 4.1.7 (for the legacy branch). Verify patch installation by reviewing the vulnerability fix in the AuthorizationUtils class to confirm CRLF character filtering. Test OAuth2 authentication flows post-patching to ensure no functional regression. If you maintain a custom fork or heavily modified CXF deployment, engage your security team to backport the sanitization logic.

Detection guidance

Monitor HTTP response headers for anomalous embedded newlines or unexpected headers appearing after WWW-Authenticate. Implement logging of realm parameter values in OAuth2 authentication requests and alert on realm values containing %0D, %0A, \r, or \n sequences. Review proxy and cache logs for response splitting indicators (e.g., duplicate headers, fragmented responses from the same backend server). Conduct traffic analysis between OAuth2 clients and your CXF endpoints to identify malformed realm injection attempts.

Why prioritize this

Although CVSS 6.5 rates this as Medium severity, context elevates urgency: OAuth2 is often the critical path for authentication and authorization in modern architectures. Successful exploitation can compromise multiple dependent systems through cache poisoning or session hijacking. The attack surface (realm parameter control) should be evaluated in your specific deployment, but the widespread use of OAuth2 and the cascading trust implications in federated environments warrant prioritization above the base CVSS suggests.

Risk score, explained

CVSS 3.1 score 6.5 reflects: Network-accessible vulnerability (AV:N), low attack complexity (AC:L), no privilege required (PR:N), no user interaction (UI:N), confidentiality impact (C:L) from reading injected content or poisoned responses, and integrity impact (I:L) from injecting false headers, with no availability impact (A:N). The score does not account for ecosystem-wide risk in OAuth2 ecosystems or cascading impacts; your organization's criticality and trust dependencies should influence remediation speed beyond the base score.

Frequently asked questions

Can this vulnerability be exploited without network access?

No. The CVSS vector indicates AV:N (network-accessible), meaning an attacker must reach the affected CXF instance over the network. However, in typical deployments, OAuth2 endpoints are intentionally internet-facing, so network access is not a practical barrier.

Does upgrading CXF automatically fix all realm injection issues, or do we need to change configuration?

The patched versions (4.2.2 and 4.1.7) sanitize CRLF characters at the framework level, so the fix is automatic upon upgrade. No configuration change is required, though you should verify your realm assignment logic does not itself introduce other injection vectors.

If our application does not use OAuth2 authentication, are we affected?

No. This vulnerability is specific to the OAuth2 AuthorizationUtils class. Applications using CXF for other purposes (SOAP, REST without OAuth2) are not affected by this particular flaw.

What is the practical impact of response splitting on our users?

Response splitting can poison caches, causing users to receive injected content (e.g., phishing pages or malware). Attackers can also inject Set-Cookie headers to hijack user sessions or inject X-Frame-Options headers to enable clickjacking. The severity depends on your cache architecture and user exposure to poisoned responses.

This analysis is provided for informational purposes. The vulnerability details, affected versions, and patch guidance reflect publicly available information and vendor advisories current as of the publication date. Organizations should verify compatibility and perform testing before deploying patches in production. SEC.co makes no warranty regarding the completeness, accuracy, or applicability of this analysis to your specific environment. Consult Apache CXF security advisories and your vendor support for definitive remediation guidance. Source: NVD (public-domain), retrieved 2026-07-20. Analysis generated by SEC.co (claude-haiku-4-5).