CVE-2026-55403
Python vulnerability analysis and mitigation

Overview

CVE-2026-55403 is a credential leakage vulnerability in datamodel-code-generator, a Python tool that generates data models from schema definitions. The get_body() function in src/datamodel_code_generator/http.py unconditionally forwards Authorization, Cookie, and Proxy-Authorization headers to redirect targets, even when an HTTP redirect crosses to a different origin (host/port/scheme). All versions up to and including 0.62.0 are affected; the issue was disclosed on June 12, 2026, and published to the GitHub Advisory Database on July 28, 2026. It carries a CVSS v3.1 base score of 3.7 (Low) (Github Advisory).

Technical details

The root cause is improper credential scoping during manual HTTP redirect handling (CWE-200, CWE-601). In get_body(), the code iterates through redirect hops and re-issues each request with the original headers argument unchanged, with no check that the redirect target shares the same origin. Standard HTTP clients such as requests and httpx strip Authorization headers on cross-origin redirects, but this implementation bypasses that behavior. Exploitation requires an attacker to control or influence a redirect from the trusted schema host — for example, via DNS hijacking, a compromised intermediate server, or an open-redirect-prone schema host — to an attacker-controlled destination that records the forwarded credentials. A self-contained proof-of-concept reproducer is publicly available (Github Advisory).

Impact

Successful exploitation results in the disclosure of operator-supplied credentials (Bearer tokens, session cookies, proxy credentials) to an attacker-controlled host. The leaked credentials are scoped to the original trusted schema host and can be replayed by the attacker to impersonate the operator against that host. There is no integrity or availability impact; the confidentiality impact is limited to the specific credentials passed via --http-headers or --url userinfo at the time of schema fetching (Github Advisory).

Exploitation steps

  1. Identify a target: Locate an environment where datamodel-code-generator is invoked with authentication credentials (e.g., --http-headers Authorization:Bearer <token> or credentials embedded in --url) to fetch a remote schema from a trusted host.
  2. Position for redirect control: Gain the ability to influence the HTTP redirect response from the trusted schema host — for example, by compromising the schema host, exploiting an open redirect on it, manipulating DNS to redirect the host to an attacker-controlled IP, or injecting a malicious $ref into a schema that triggers a redirect.
  3. Set up a capture server: Stand up an HTTP server at the redirect target (a different origin) that records all incoming request headers.
  4. Trigger schema fetch: Cause the victim to run datamodel-code-generator against the trusted schema URL. The tool's get_body() function follows the redirect and re-sends the original headers — including Authorization, Cookie, and Proxy-Authorization — to the attacker's server.
  5. Harvest and replay credentials: Extract the captured credentials from the attacker-controlled server's logs and replay them against the original trusted schema host to gain unauthorized access (Github Advisory).

Indicators of compromise

  • Network: Outbound HTTP requests from the datamodel-code-generator process to unexpected or unfamiliar hosts following an initial schema fetch request; HTTP requests carrying Authorization or Cookie headers sent to hosts other than the originally configured schema host.
  • Logs: HTTP access logs on attacker-controlled or unexpected servers showing requests with Authorization: Bearer ..., Cookie: ..., or Proxy-Authorization: ... headers originating from the schema-fetching host.
  • Process/CLI: Invocations of datamodel-code-generator with --http-headers containing sensitive credentials or --url with embedded userinfo credentials targeting remote schema URLs that issue redirects.

Mitigation and workarounds

Upgrade datamodel-code-generator to version 0.63.0 or later, which strips Authorization, Cookie, and Proxy-Authorization headers when a redirect crosses origins, preserving them only for same-origin redirects. The fix was merged via commit a585c037 and released on June 12, 2026 (Release 0.63.0). As a defense-in-depth measure, operators should avoid passing long-lived or broadly scoped credentials to the tool, apply network-level controls to block unexpected outbound redirects, and ensure schema hosts are not open-redirect-prone. No configuration-based workaround is available for versions prior to 0.63.0 other than avoiding the use of authentication headers when fetching remote schemas (Github Advisory).

Community reactions

The vulnerability was discovered and reported by security researcher Hamza Haroon (thegr1ffyn), who provided a self-contained PoC and coordinated disclosure with the maintainer. The maintainer confirmed the issue through review and regression testing before releasing the fix in version 0.63.0. No significant broader media coverage or notable community debate has been observed beyond the advisory publication (Github Advisory).

Additional resources


SourceThis report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-55415HIGH7.5
  • Python logoPython
  • datamodel-code-generator
NoYesJul 28, 2026
CVE-2026-55391HIGH7.5
  • Python logoPython
  • datamodel-code-generator
NoYesJul 28, 2026
CVE-2026-55390HIGH7.5
  • Python logoPython
  • datamodel-code-generator
NoYesJul 28, 2026
CVE-2026-55389HIGH7.5
  • Python logoPython
  • datamodel-code-generator
NoYesJul 28, 2026
CVE-2026-55403LOW3.7
  • Python logoPython
  • datamodel-code-generator
NoYesJul 28, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management