FlawAtlas
Search the atlas
CVE-2016-8615 High

cookie injection for other servers

If cookie state is written into a cookie jar file that is later read back and used for subsequent requests, a malicious HTTP server can inject new cookies for arbitrary domains into said cookie jar. The issue pertains to the function that loads cookies into memory, which reads the specified file into a fixed-size buffer in a line-by-line manner using the `fgets()` function. If an invocation of `fgets()` cannot read the whole line into the destination buffer due to it being too small, it truncates the output. This way, a long cookie (name + value) sent by a malicious server would be stored in the file and subsequently that cookie could be read partially and crafted correctly, it could be treated as a different cookie for another server.

Exploit probability 4.8%
Published November 2, 2016
Required by Not available
Last source change May 27, 2026

02 / AFFECTED SOFTWARE

Affected packages

Unknown Unknown

139 explicit affected versions

Unknown Unknown

287 explicit affected versions

03 / CONNECTIONS

Connected vulnerabilities

04 / EVIDENCE

Source records

Open Source Vulnerabilities CVE-2016-8615

A flaw was found in curl before version 7.51. If cookie state is written into a cookie jar file that is later read back and used for subsequent requests, a malicious HTTP server can inject new cookies for arbitrary domains into said cookie jar.

View original source
Open Source Vulnerabilities CURL-CVE-2016-8615

If cookie state is written into a cookie jar file that is later read back and used for subsequent requests, a malicious HTTP server can inject new cookies for arbitrary domains into said cookie jar. The issue pertains to the function that loads cookies into memory, which reads the specified file into a fixed-size buffer in a line-by-line manner using the `fgets()` function. If an invocation of `fgets()` cannot read the whole line into the destination buffer due to it being too small, it truncates the output. This way, a long cookie (name + value) sent by a malicious server would be stored in the file and subsequently that cookie could be read partially and crafted correctly, it could be treated as a different cookie for another server.

View original source

05 / REFERENCES

Further evidence