HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
webmproject
libwebp
C2023–2023
webmproject / libwebp

libwebp

Mirror only. Please do not send pull requests. See https://chromium.googlesource.com/webm/libwebp/+/HEAD/CONTRIBUTING.md.

9Distinct people
9Mentions
1Explicit recommenders
2.4KGitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

Mirror only. Please do not send pull requests. See https://chromium.googlesource.com/webm/libwebp/+/HEAD/CONTRIBUTING.md.

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

Millions of people in the world are affected by this library, 10 times over for every devices and apps they use. I'm sorry but I call for libraries used by millions around the…

keyle used a recommendation phrase. One indexed comment matches. This is a phrase match, not a verdict.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

No other repository is repeatedly linked in the same discussions.

This week on Hacker News

Nov 7–Nov 14 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/14/2026, 1:49:46 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by day9 dated mentions

Observed mentions: 2023-09-12 09:47:34 UTC to 2023-09-26 13:32:58 UTC.

0123452023-09-12 00:00:00 UTC to 2023-09-13 00:00:00 UTC (exclusive): 5 mentions; 0 submissions, 5 commentsSep 122023-09-13 00:00:00 UTC to 2023-09-14 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-14 00:00:00 UTC to 2023-09-15 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-15 00:00:00 UTC to 2023-09-16 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-16 00:00:00 UTC to 2023-09-17 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-17 00:00:00 UTC to 2023-09-18 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-18 00:00:00 UTC to 2023-09-19 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-19 00:00:00 UTC to 2023-09-20 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 commentsSep 192023-09-20 00:00:00 UTC to 2023-09-21 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-21 00:00:00 UTC to 2023-09-22 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-22 00:00:00 UTC to 2023-09-23 00:00:00 UTC (exclusive): 3 mentions; 0 submissions, 3 comments2023-09-23 00:00:00 UTC to 2023-09-24 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-24 00:00:00 UTC to 2023-09-25 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-25 00:00:00 UTC to 2023-09-26 00:00:00 UTC (exclusive): 0 mentions; 0 submissions, 0 comments2023-09-26 00:00:00 UTC to 2023-09-27 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 commentsSep 26

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
Sep 122023-09-12 00:00:00 UTC2023-09-13 00:00:00 UTC505
Sep 132023-09-13 00:00:00 UTC2023-09-14 00:00:00 UTC000
Sep 142023-09-14 00:00:00 UTC2023-09-15 00:00:00 UTC000
Sep 152023-09-15 00:00:00 UTC2023-09-16 00:00:00 UTC000
Sep 162023-09-16 00:00:00 UTC2023-09-17 00:00:00 UTC000
Sep 172023-09-17 00:00:00 UTC2023-09-18 00:00:00 UTC000
Sep 182023-09-18 00:00:00 UTC2023-09-19 00:00:00 UTC000
Sep 192023-09-19 00:00:00 UTC2023-09-20 00:00:00 UTC000
Sep 202023-09-20 00:00:00 UTC2023-09-21 00:00:00 UTC000
Sep 212023-09-21 00:00:00 UTC2023-09-22 00:00:00 UTC000
Sep 222023-09-22 00:00:00 UTC2023-09-23 00:00:00 UTC303
Sep 232023-09-23 00:00:00 UTC2023-09-24 00:00:00 UTC000
Sep 242023-09-24 00:00:00 UTC2023-09-25 00:00:00 UTC000
Sep 252023-09-25 00:00:00 UTC2023-09-26 00:00:00 UTC000
Sep 262023-09-26 00:00:00 UTC2023-09-27 00:00:00 UTC101

What Hacker News says

9 sources
The thing that concerns me most is looking at the fix it is very difficult to see why this fix is correct. It also appears as there is lots of code without explicit bounds checks. It makes me worried because while the logic may be safe this makes the logic very complex. I wonder what the cost would be to add an explicit, local bounds check at every array access. This would serve as a backup that is much easier to verify. I suspect the cost would be relatively small. Small enough that I personally would be happy to pay it. https://github.com/webmproject/libwebp/commit/902bc919033134... This is also a great reminder that fuzzing isn't a solution to memory unsafe languages and libraries. If anything the massive amount of bugs found via fuzzing should scare us as it is likely only scratching the surface of the vulnerabilities that still lie i
Read the rest
n the code, a couple too many branches away from being likely to be found by fuzzing.
In Google assigns a CVE for libwebp and gives it a 10.0 score
keyle·Sep 22, 2023Recommendation phrase
Millions of people in the world are affected by this library, 10 times over for every devices and apps they use. I'm sorry but I call for libraries used by millions around the world to NOT use C. And I love C... But this risk ratio is off the charts and they ought to not use C for such critical libraries. Even as a C guru, you are going to make a mistake, at some point. I think this is the fix https://github.com/webmproject/libwebp/commit/dce8397fec159c... "malloc fail"? :facepalm: (oh yes, Slack, Discord, Teams, everything is affected, including all modern OS).
In The WebP 0day
The original commit in question: https://github.com/webmproject/libwebp/commit/f75dfbf23d1df1... The commit that fixes this bug: https://github.com/webmproject/libwebp/commit/902bc919033134... The original commit optimizes a Huffman decoder. The decoder uses a well-known optimization: it reads N bits in advance and determines how many bits have to be actually consumed and which symbol should be decoded, or, if it's an N-bit prefix of multiple symbols, which table should be consulted for remaining bits. The old version did use lookup tables for short symbols, but longer symbols needed a graph traversal. The new version improved this by using an array of lookup tables. Each entry contains (nbits, value) where `nbits` is # bits to be consumed and `value` is normally a symbol, but if `nbits` exceeds N `value` is interpreted as a table index a
Read the rest
nd `nbits` is reinterpreted as the longest code length in that subtree. So each subsequent table should have `2^(nbits - N)` entries (the root table is always fixed to 2^N entries). The new version calculated the maximum number of entries based on the number of symbols (kTableSize). Of course, the Huffman tree comes from an untrusted source and you can easily imagine the case where `nbits` is very big. VP8 Lossless specifically allows up to 15 bits, so the largest possible table has 2^N + 2^15 entries when every single LUT is mapped to its own secondary table, and doing this doesn't need that many symbols (you only need 16-N symbols for each table). Amusingly enough the code itself had a mode where only the table size is calculated (VP8LBuildHuffmanTable called with `root_table == NULL`), but it wasn't somehow unused and the fixed maximum size was assumed. So if the Huffman tree was crafted in the way that maximizes the number of entries, it will overflow the allocation. To be fair, I can see why this happened; the Huffman decoding step is one of the most computationally intensive part of many compression format and any small improvement matters. The Huffman decoder optimization described above is well known, but the longer code case is commonly considered less important to optimize because longer code should rarely appear in general. The original commit message refuted this, and was able to be merged. I'm not even sure that a memory safe language could have prevented this; this is a rare case where you actively want to avoid the overflow check [1]. [1] I should note that the memory corruption occurs during the table construction, which is not a tight loop, so a partial overflow check would be very helpful. The actual fix never altered the `ReadSymbol` function at all! But the safety of the tight loop should be still justified, so the wrong justification can ruin everything.
In Chrome: Heap buffer overflow in WebP
It's 2023, surely this is not yet another bug related to memory unsafety that could be avoided if we'd stop writing critical code that deals with extremely complex untrusted input (media codecs) in memory unsafe languages? Yep, of course it is: https://github.com/webmproject/libwebp/commit/902bc919033134... I guess libwebp could be excused as it was started when there were no alternatives, but even for new projects today we're still committing the same mistake[1][2][3]. [1] -- https://code.videolan.org/videolan/dav1d [2] -- https://github.com/AOMediaCodec/libavif [3] -- https://github.com/AOMediaCodec/libiamf Yep. Keep writing these in C; surely nothing will go wrong.
In Chrome: Heap buffer overflow in WebP

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.