CVE-2026-43971: cowlib Package Vulnerability - Link Header Directive Smuggling
Summary
CVE-2026-43971: Link Header Directive Smuggling via Unescaped target/rel/Attribute Keys in cow_link:link/1. Affects cowlib across 2 version ranges.
>= 2.9.0
>= 485d58dfa91b91d98135dc95e5615f421715dae5, < 89da27ee4c241f5d649ba7d9b7f2188918af6cea
No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
cowlib is a library used in Erlang applications for handling HTTP link headers. It provides functionality for creating and parsing Link headers, which are crucial for optimizing web performance through preloading resources. However, versions from 2.9.0 onward are susceptible to a serious vulnerability that allows attackers to manipulate Link headers, potentially leading to unauthorized access or data exfiltration.
Vulnerability Detail
The vulnerability arises from improper encoding or escaping of output in the cow_link:link/1 function. This function directly interpolates user-supplied values into the serialized Link header without adequate validation or escaping. An attacker can exploit this by injecting special characters into the target URI, rel value, or attribute keys, allowing them to craft malicious Link headers. This can lead to browsers making out-of-band connections to attacker-controlled origins, posing significant security risks.
How To Fix
No fixed version is published for this vulnerability.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, sanitize all values before passing them to cow_link:link/1. Specifically, reject or strip any target value containing '>', any rel value containing '"' or '', and any attribute key containing characters outside the HTTP token grammar. Here is a sample code snippet for sanitization:
function sanitize_input(target, rel, attributes) {
if (target.includes('>') || rel.includes('"') || rel.includes('\')) {
throw new Error('Invalid input detected');
}
for (let key of Object.keys(attributes)) {
if (/[^\w-]/.test(key)) {
throw new Error('Invalid attribute key detected');
}
}
return { target, rel, attributes };
}
Conclusion
CVE-2026-43971 represents a significant security risk for applications using the cowlib package. It is crucial to update to the latest version or implement the recommended workarounds to protect against potential exploits. Regular monitoring for vulnerabilities using tools like Vulert can help maintain application security.
See every vulnerability recorded for cowlib →
FAQ
CVE-2026-43971 is a vulnerability in the cowlib package that allows for Link header directive smuggling due to improper encoding of output.
All versions of cowlib from 2.9.0 onward are affected by this vulnerability.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If you cannot update the package, implement the suggested workaround to sanitize inputs before passing them to cow_link:link/1.
The CVSS score of this vulnerability is 6.3, indicating a moderate severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for cowlib.