Variant analysis: 1 unfixed sibling safety gap in protobuf
Maintainers usually reply within 1 day
@JasonLunn is already working on this.
Since Oct 6, 2026.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 58/100
Research direction
Start in third_party/upb/upb/hash/common.c and compare the listed copy, clear, and compact allocation sites with upb_strtable_init() and its existing upb_MulOverflow() usage. Review the upb hash-table code and the protobuf_protobuf_fuzzer harness first. Done means the sibling allocation paths handle overflow consistently and the relevant parser or fuzzing checks pass.
Written by the indexing model from the issue text.
Description
Summary
Variant analysis of historical fixes in protobuf identified 1 code site where an integer-overflow guard, bounds check, or safe-allocation wrapper exists at one location but is missing at a structurally identical sibling location (same file, same function, or same pattern family) elsewhere in the codebase.
Each finding below is code-confirmed against the current HEAD (verified by cloning the repository fresh and checking the pattern is still present), with the exact file/line locations, the root cause, a description of the trigger path, and — where available — ASan/execution verification output or a proof-of-concept.
Note on origin: these were surfaced by an automated variant-analysis pipeline that diffs historical fix commits against sibling code paths, then has each candidate manually reviewed. I'm posting them together per-project rather than as separate issues to respect maintainer time. Happy to split, close, or reprioritize any of these as you see fit.
Finding 1: protobuf — upb_strtable_copy() missing overflow check (sibling of upb_strtable_init() fix in c6b856d)
Verified against HEAD: 99f6640631b66b52853278f631226da808e8c9f6 (2026-09-25)
*- Project: protobuf (protocolbuffers/protobuf, upb C micro-library)
- Class: Heap-buffer-overflow write (via integer overflow in allocation size for hash table copy)
- Status: Code-confirmed, exec-blocked
- Sibling of: Fix commit
c6b856d— convertedupb_strtable_init()and ~15 other allocation sites to useupb_MulOverflow()for overflow-safe multiplication*
Discovery method
Variant analysis. Commit c6b856d was a large overflow-check overhaul that converted ~15 table_size * sizeof(T) patterns to use upb_MulOverflow() — a function that returns false on overflow instead of wrapping. Three sites in the same files were missed: upb_strtable_copy(), and two table clear functions.
Vulnerable code
third_party/upb/upb/hash/common.c
FIXED — upb_strtable_init() after c6b856d:
// SAFE:
size_t bytes;
if (!upb_MulOverflow(t->table_size, sizeof(upb_tabent), &bytes))
return false;
t->entries = upb_gmalloc(bytes);
UNFIXED siblings:
upb_strtable_copy()at line 601:
// VULNERABLE — no overflow check:
t->entries = upb_gmalloc(t->table_size * sizeof(upb_tabent));
upb_inttable_clear()at line 561:
// VULNERABLE:
upb_inttable_clear(t, upb_gmalloc(t->table_size * sizeof(upb_tabent)));
upb_strtable_clear()at line 747:
// VULNERABLE:
upb_strtable_clear(t, upb_gmalloc(t->table_size * sizeof(upb_tabent)));
upb_strtable_compact()at line 1023:
// VULNERABLE:
upb_strtable_clear(t, upb_gmalloc(t->table_size * sizeof(upb_tabent)));
Root cause
The overflow-check overhaul (c6b856d) was thorough but mechanically incomplete — it converted init() functions across the hash table module but missed copy(), clear(), and compact() functions that use the identical table_size * sizeof(T) pattern. The init() and copy() functions are literally adjacent in the source file.
Trigger path
- Crafted protobuf binary with a deeply nested or large-repeated message
- → Deserialization triggers string table reallocation (
upb_strtable_copy/upb_strtable_compact) - → Large
table_size(e.g., ~2³¹ on 32-bit) → multiplication wraps → undersized allocation → heap overflow write when entries are inserted
Fuzz harness: protobuf_protobuf_fuzzer (an OSS-Fuzz/fuzzbench harness) — exercises protobuf parsing including the upb runtime.
Sibling-gap quality
Excellent. Same file (hash/common.c), same multiplication pattern (table_size * sizeof(T)), same upb_MulOverflow() API that was already used to fix init()`. Three sibling functions missed within the same translation unit.
Analysis date: 2026-09-22. Code-confirmed, not execution-verified.
Methodology
For each historical vulnerability fix in the codebase, we identified the safe pattern the fix introduced (an overflow guard, a safe allocator wrapper, a bounds check) and searched the rest of the codebase for structurally identical code that predates or postdates the fix but never received it. Each candidate was then manually verified against the current HEAD listed above.
Happy to provide anything else that would help triage — additional PoC inputs, a minimal patch following the existing safe-sibling pattern, or a written reproduction script.
- Dominant language
- C++
- Stars
- 72.2k
- Forks
- 16.4k
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 342
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from protocolbuffers/protobuf
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
protocolbuffers/protobuf#31768 ·
Maintainers usually reply within 1 day
-
feature request packaging & distribution python
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31654 ·
Maintainers usually reply within 1 day
-
google-protobuf 0.36.2-release fails to compile for ARMv7: @progbits rejected in global_asm!Possibly taken @farisbasha claimed this 1 day ago. Openbug help wanted rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31619 · 3 comments ·
Maintainers usually reply within 1 day
-
Null pointer passed to memcpy in lupb_decode() when the second argument is nilPossibly taken A pull request linked to this issue is open or already merged. Openbug help wanted lua
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
protocolbuffers/protobuf#31392 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
protocolbuffers/protobuf#31032 ·
Maintainers usually reply within 1 day
All issues in protocolbuffers/protobuf
Similar issues
-
agent:Windows bug in progress pri:medium sev:low testing windows
Difficulty 1/5 Under an hour Newbie friendliness 91/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
godotengine/godot#125651 ·
Maintainers usually reply within 1 day
-
Android: with view recycling on, a recycled View keeps its nextFocusLeftPossibly taken A pull request linked to this issue is open or already merged. OpenNeeds: Triage :mag: Platform: Android
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
react/react-native#60167 ·
Maintainers usually reply within 2 days
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 2 days