Severity:

HIGH RISK

(7.1)

Improper Credential Forwarding (CWE-522) in HTTP::Tiny

CVE-2026-7017

Deferred

Vulnerability type

Category:

Improper Credential Handling

CWE:

CWE-522

Impact:

Credential Disclosure Across Origins

Severity:

HIGH RISK

(7.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

HTTP::Tiny before 0.095 forwards caller-supplied credential headers like Authorization, Cookie, and Proxy-Authorization to cross-origin redirect targets without origin checks.

This behavior can expose secrets to arbitrary hosts, including over downgraded https to http redirects, whenever callers follow redirects with sensitive headers.

Affected context

The issue arises in Perl applications that use HTTP::Tiny versions prior to 0.095 and:

  • Supply their own Authorization, Cookie, or Proxy-Authorization headers
  • Allow HTTP::Tiny to follow redirects automatically via _maybe_redirect
  • Interact with endpoints that may return cross-origin 3xx responses with attacker-controlled or untrusted Location headers

In these conditions, HTTP::Tiny reuses caller headers on the new request without verifying that the redirect target shares the original origin or security properties (scheme, host, or port).

Exploit preconditions

  • Attack surface: Outbound HTTP requests made via HTTP::Tiny in Perl applications.
  • Required access: Ability to influence or control the redirecting server or its Location header (e.g., operating a malicious endpoint, exploiting open redirects, or controlling upstream responses).
  • Trigger point: A 3xx HTTP response that causes _maybe_redirect to issue a follow-up request, during which _prepare_headers_and_cb re-merges the original caller-provided headers.
  • Why exploitation is possible: HTTP::Tiny does not enforce any origin or scheme checks when forwarding caller-supplied credential headers, so secrets are sent to arbitrary redirect targets, including insecure or cross-origin destinations.

Why this happens

The root cause is an insecure credential handling pattern where sensitive headers are treated as generic metadata and blindly reused on redirected requests.

Specifically, HTTP::Tiny's _maybe_redirect logic follows any Location header while _prepare_headers_and_cb re-merges the caller's headers argument into the new request without validating origin consistency or downgrades from https to http.

This maps to CWE-522: Insufficiently Protected Credentials, because credentials are transmitted to untrusted or less secure endpoints, violating basic confidentiality guarantees and assumptions about header scoping across redirects.

Potential impact

  • Disclosure of bearer tokens, API keys, or Basic-auth credentials via the Authorization header to attacker-controlled hosts
  • Leakage of session identifiers and user state via Cookie headers across origins
  • Exposure of proxy authentication secrets (Proxy-Authorization) to arbitrary endpoints
  • Credential interception over downgraded https to http redirects, enabling on-path attackers to capture secrets in plaintext
  • Unauthorized access or account takeover if leaked credentials are reused by attackers against the original service

General mitigation guidance

Mitigations generally focus on constraining where credentials travel and reducing implicit trust in redirect targets:

  • Treat caller-supplied credential headers as origin-bound and avoid reusing them on redirects unless the new destination is explicitly validated as same-origin and equally secure.
  • Separate authentication state from generic request headers, using per-origin credential stores instead of passing raw Authorization or Cookie headers into low-level clients.
  • Enforce redirect policies that disallow cross-origin redirects, scheme downgrades, or excessive redirect chains when credentials are present.
  • Apply least-privilege principles to issued tokens (scoped, short-lived, revocable) so any leaked value has limited utility.
  • Prefer transport security and strict policies (e.g., refusing to follow redirects from https to http) in components that handle authentication material.

How teams detect issues like this

Effective detection typically combines code-level and runtime analysis:

  • Static analysis or grep-based review for code paths that pass explicit Authorization, Cookie, or Proxy-Authorization headers into HTTP::Tiny and also enable redirect following.
  • Code review checklists that flag any HTTP client configuration where redirects are followed automatically while custom credential headers are present.
  • Logging and telemetry to capture redirect chains, including original and target hosts, schemes, and whether credential-bearing requests were redirected across origins.
  • Security testing and fuzzing that injects crafted 3xx responses with cross-origin Location headers to observe whether sensitive headers are forwarded.
  • Use of automated review tools or linters that enforce policies like "no credential headers on cross-origin redirects" for HTTP client usage.

Sources

SourceLink
github.comgithub.com/Perl-Toolchain-Gang/HTTP-Tiny/commit/84984ef3930ddd4afcf5eb83b40d3cee200739c3.patch
github.comgithub.com/Perl-Toolchain-Gang/HTTP-Tiny/commit/8f32ca89e21c3ad0422adc698fa6ad17a193f55f.patch
github.comgithub.com/Perl-Toolchain-Gang/HTTP-Tiny/commit/e7a03aedf2395158f2b0d3bad2df943349227bb3.patch
github.comgithub.com/Perl-Toolchain-Gang/HTTP-Tiny/pull/36
metacpan.orgmetacpan.org/release/HAARG/HTTP-Tiny-0.095-TRIAL/changes
openwall.comopenwall.com/lists/oss-security/2026/07/07/13

Frequently asked

questions

Yes. A remote attacker who can control or influence the redirecting endpoint—or exploit an open redirect—can cause credential-bearing requests to be redirected to a host they control, receiving the forwarded headers.

The attacker does not need code execution in the client; they need the ability to produce or manipulate 3xx responses with chosen Location headers for requests that include caller-supplied credential headers and are sent via HTTP::Tiny with redirects enabled.

The safest pattern is to avoid providing raw credential headers to generic HTTP clients when redirects are enabled, and instead enforce strict redirect policies: only allow redirects to vetted same-origin targets, drop sensitive headers on redirects by default, and reject scheme downgrades when authentication is in use.

Design HTTP client usage so that credentials are bound to specific origins and security contexts, perform explicit validation on redirect targets before reusing authentication data, adopt security-focused coding guidelines for outbound requests, and incorporate automated checks that flag any forwarding of sensitive headers across origin or scheme boundaries.

Find out what's already
exploitable in your codebase.