Information Disclosure in datamodel-code-generator (CVE-2026-55403)
Summary
Vulnerability in datamodel-code-generator (CVE-2026-55403). Risk of unauthorized operations or information disclosure. Exploitable via Authorization. Mitigation: upgrade to 0.63.0 or later.
Original description
The description as published by the source.
Summary
When datamodel-code-generator fetches a remote schema and follows an HTTP redirect, it re-sends the original request headers, including any Authorization header, to the redirect target even when the redirect changes origin (host/port/scheme). Credentials that an operator scoped to a trusted schema host are therefore forwarded to an attacker-controlled or otherwise different host, leaking them.
Details
In src/datamodel_code_generator/http.py, get_body() follows redirects manually and re-issues each hop with the same headers argument, with no check that the origin is unchanged:
for redirect_count in range(MAX_HTTP_REDIRECTS + 1):
_validate_url_for_fetch(current_url, allow_private_network=allow_private_network)
response = httpx.get(current_url, headers=headers, follow_redirects=False, ...) # same headers every hop
if (redirect_url := _get_redirect_url(httpx, current_url, response)) is None:
break
current_url = redirect_url
Browsers and HTTP clients such as requests/httpx strip Authorization when a redirect crosses origin; here it is preserved unconditionally. Headers are operator-supplied via --http-headers (and credentials can also arrive through --url userinfo), so a redirect from the trusted host to any other host discloses them.
PoC
Self-contained reproducer: https://gist.github.com/thegr1ffyn/ade3035d7f2be95e16f11698259cdbc2
Host A (the trusted schema host) 302-redirects to host B (a dif…
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Auto-generated summary
Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.
A vulnerability tracked as CVE-2026-55403 has been found in datamodel-code-generator.
Attackers can target a specific entry point like Authorization over the network to misuse the product.
Risk of unauthorized operations or information disclosure. CVSS score: 3.7/10.
What to do: upgrade datamodel-code-generator to 0.63.0 or later.
If unsure, ask your IT team or search "datamodel-code-generator CVE-2026-55403" on the vendor's site.
CVE-2026-55403 (datamodel-code-generator) — CWE-200 / CVSS v3 3.7
Attack vector: remote (network-reachable) / unauthenticated / no user interaction
Attack surface: Authorization / headers / requests / httpx
Patched: 0.63.0 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.
Information disclosure (CWE-200) exists in datamodel-code-generator. Attackers reach the vulnerable code path via Authorization without authentication.
Check the vendor advisory for the affected versions of datamodel-code-generator. Attack surface: Authorization / headers / requests / httpx.
Severity: Low (CVSS 3.7/10). Risk of unauthorized operations or information disclosure.
Update to 0.63.0.
Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.
Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'datamodel-code-generator' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.
Response actions
Concrete steps and command examples for SOC/SRE teams to execute in order
-
1Identify exposure identify
grep -r 'datamodel-code-generator' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
datamodel-code-generatorを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply patch patch
Upgrade datamodel-code-generator to 0.63.0ステージング環境で 0.63.0 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
3Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Affected packages
References
- advisory github.com
- advisory nvd.nist.gov
- package github.com
- package pypi.org
- web github.com
- web github.com
- web github.com