Description
Improper Encoding or Escaping of Output vulnerability in ninenines cowlib allows Link header directive smuggling via unescaped special characters in cow_link:link/1.

cow_link:do_link/1 in cowlib interpolates the target URI, rel value, and attribute keys directly into the serialized Link: header value without escaping or token-grammar validation. A > byte in target prematurely closes the URI slot, allowing an attacker to append additional link entries with attacker-chosen rel directives. A " or \ in rel escapes the quoted string and opens new parameters. Any byte — including whitespace, =, and " — in an attribute key is emitted verbatim. Because browsers act on Link: directives such as rel="preconnect", rel="preload", and rel="prerender", an attacker who can influence these fields in an application that round-trips parsed Link headers through cow_link:link/1 can force victim browsers to make out-of-band connections to attacker-controlled origins.

This issue affects cowlib: from 2.9.0 onward.
Published: 2026-08-18
Score: 6.3 Medium
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability arises from improper escaping of output in the cowlib function cow_link:link/1, which directly interpolates target URIs, rel values, and attribute keys into a serialized Link header without enforcing HTTP token grammar or escaping. By injecting a ‘>’ byte in the target, a quote or backslash in the rel, or whitespace, equal, or quote characters in an attribute key, an attacker can cause the Link header to contain additional, attacker‑chosen directives such as rel="preconnect", rel="preload", or rel="prerender". These directives cause browsers to make out‑of‑band connections to attacker‑controlled origins, potentially exfiltrating data or leaking credentials. The flaw is a classic example of CWE‑116 (Improper Encoding or Escaping of Output).

Affected Systems

The affected package is cowlib, maintained by ninenines. All releases from version 2.9.0 onward include the vulnerable implementation of cow_link:link/1. Applications that depend on these releases and use cow_link:link/1 to construct Link headers from any source that might be influenced by user input are directly affected.

Risk and Exploitability

The CVSS score is 6.3, indicating a moderate severity. No EPSS score is available and the vulnerability is not listed in CISA’s KEV catalog. Exploitation requires the attacker to influence the target, rel, or attribute key fields supplied to cow_link:link/1; this typically means the attacker must either supply crafted input to the application or compromise it in some way. Once the input reaches cow_link:link/1, the browser will follow the injected Link directives, enabling resource hijacking and potential credential leakage. The risk is still present even though no public exploits have been documented.

Generated by OpenCVE AI on August 18, 2026 at 10:20 UTC.

Remediation

Vendor Workaround

Sanitize values before passing them to cow_link:link/1: reject or strip any target value containing >, any rel value containing " or \, and any attribute key containing characters outside the HTTP token grammar. Alternatively, ensure all Link entry fields are derived exclusively from trusted, application-controlled values rather than untrusted input.


OpenCVE Recommended Actions

  • Sanitize all values before passing them to cow_link:link/1: reject or strip any target value containing ‘>’, any rel value containing ‘"’ or ‘\’, and any attribute key containing characters outside the HTTP token grammar.
  • Ensure that all data used by cow_link:link/1 originates from trusted, application‑controlled sources; avoid incorporating untrusted user input into Link header construction.
  • Upgrade to a cowlib version that contains the fix for this issue; if no patch is yet available, continue to use the above sanitization and trusted‑source checks as a temporary countermeasure.

Generated by OpenCVE AI on August 18, 2026 at 10:20 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 18 Aug 2026 15:45:00 +0000


Tue, 18 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Tue, 18 Aug 2026 09:15:00 +0000

Type Values Removed Values Added
Description Improper Encoding or Escaping of Output vulnerability in ninenines cowlib allows Link header directive smuggling via unescaped special characters in cow_link:link/1. cow_link:do_link/1 in cowlib interpolates the target URI, rel value, and attribute keys directly into the serialized Link: header value without escaping or token-grammar validation. A > byte in target prematurely closes the URI slot, allowing an attacker to append additional link entries with attacker-chosen rel directives. A " or \ in rel escapes the quoted string and opens new parameters. Any byte — including whitespace, =, and " — in an attribute key is emitted verbatim. Because browsers act on Link: directives such as rel="preconnect", rel="preload", and rel="prerender", an attacker who can influence these fields in an application that round-trips parsed Link headers through cow_link:link/1 can force victim browsers to make out-of-band connections to attacker-controlled origins. This issue affects cowlib: from 2.9.0 onward.
Title Link Header Directive Smuggling via Unescaped target/rel/Attribute Keys in cow_link:link/1
First Time appeared Ninenines
Ninenines cowlib
Weaknesses CWE-116
CPEs cpe:2.3:a:ninenines:cowlib:*:*:*:*:*:*:*:*
Vendors & Products Ninenines
Ninenines cowlib
References
Metrics cvssV4_0

{'score': 6.3, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:L/SA:N'}


Subscriptions

Ninenines Cowlib
cve-icon MITRE

Status: PUBLISHED

Assigner: EEF

Published:

Updated: 2026-08-18T15:58:46.271Z

Reserved: 2026-05-04T18:23:25.574Z

Link: CVE-2026-43971

cve-icon Vulnrichment

Updated: 2026-08-18T14:12:27.772Z

cve-icon NVD

Status : Awaiting Analysis

Published: 2026-08-18T09:17:14.340

Modified: 2026-08-20T13:02:12.153

Link: CVE-2026-43971

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-18T10:30:10Z

Weaknesses
  • CWE-116

    Improper Encoding or Escaping of Output