Skip to content

Potential Vulnerability in Cloned Code#77

Open
tabudz wants to merge 1 commit intobbuhrow:masterfrom
tabudz:CVE-2016-9841
Open

Potential Vulnerability in Cloned Code#77
tabudz wants to merge 1 commit intobbuhrow:masterfrom
tabudz:CVE-2016-9841

Conversation

@tabudz
Copy link

@tabudz tabudz commented Mar 4, 2026

Summary

Our tool detected a potential vulnerability in zlib/inffast.c which was cloned from madler/zlib but did not receive the security patch applied. The original issue was reported and fixed under https://nvd.nist.gov/vuln/detail/cve-2016-9841.

Proposed Fix

Apply the same patch as the one in madler/zlib to eliminate the vulnerability.

Reference

https://nvd.nist.gov/vuln/detail/cve-2016-9841
madler/zlib@9aaec95

An old inffast.c optimization turns out to not be optimal anymore with modern compilers, and furthermore was not compliant with the C standard, for which decrementing a pointer before its allocated memory is undefined. Per the recommendation of a security audit of the zlib code by Trail of Bits and TrustInSoft, in support of the Mozilla Foundation, this "optimization" was removed, in order to avoid the possibility of undefined behavior.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants