Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
6117380
fix(cursor): reject overflowing uint32 varints
outlier27-cell Oct 11, 2026
afe71d9
test(cursor): use valid uint32 protobuf descriptor
outlier27-cell Oct 11, 2026
36c8832
style(cursor): format uint32 decoder test
outlier27-cell Oct 11, 2026
f703bae
test(cursor): cover the first overflowing uint32 byte
outlier27-cell Oct 11, 2026
dce9348
Merge branch 'main' into fix/issue-748-protobuf-uint32-overflow
tt-a1i Oct 14, 2026
0eb4ce3
Merge current main into PR #749, preserving decoder guards
tt-a1i Oct 15, 2026
4a87b80
Merge branch 'main' into fix/issue-748-protobuf-uint32-overflow
outlier27-cell Oct 16, 2026
de2d6a6
Merge remote-tracking branch 'origin/main' into fix/issue-748-protobu…
outlier27-cell Oct 16, 2026
6c57ad9
ci: rerun Web E2E after session-history restore flake
outlier27-cell Oct 16, 2026
aa5e875
Merge branch 'main' into fix/issue-748-protobuf-uint32-overflow
outlier27-cell Oct 17, 2026
e95424b
Merge remote-tracking branch 'origin/main' into HEAD
outlier27-cell Oct 19, 2026
7e8a2a4
Merge remote-tracking branch 'origin/main' into HEAD
outlier27-cell Oct 19, 2026
d3a4e04
Merge commit '16841623911c97dffc0b4cc3d233af2519cbfd2d' into HEAD
outlier27-cell Oct 19, 2026
b4ac3e6
Merge commit 'adcc79018f3a3a4ed1f5b030b7a66c4689b1779d' into HEAD
outlier27-cell Oct 23, 2026
1727f06
Merge commit '31fc7ffb4f7262be4f3ece08ab1f819b9ff244f3' into HEAD
outlier27-cell Oct 23, 2026
ebb5b7c
Merge commit '3497f23dec97ff04c8ade1a21b8e9b0b454fee4c' into HEAD
outlier27-cell Oct 23, 2026
8f55595
Merge commit 'abc59e74e97cfe8e507131547ac4c91666a000ae' into HEAD
outlier27-cell Oct 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions extensions/ai-providers/cursor/protobuf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -933,6 +933,9 @@ class Reader {
let shift = 0;
while (this.pos < this.len) {
const byte = this.buf[this.pos++];
if (shift === 28 && byte > 0x0f) {
throw new Error("Varint exceeds 32 bits");
}
result |= (byte & 0x7f) << shift;
if ((byte & 0x80) === 0) return result >>> 0;
shift += 7;
Expand Down
19 changes: 19 additions & 0 deletions tests/extensions/ai-providers/cursor-protobuf.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,22 @@ test("protobuf maps do not decode beyond a declared entry boundary", () => {
/Unexpected EOF reading bytes/,
);
});

interface Counter extends ProtoMessage {
count: number;
}

const Counter = pb<Counter>("test.Counter", [
{ kind: "uint32", no: 1, name: "count" },
]);

test("uint32 rejects a terminating fifth byte that exceeds 32 bits", () => {
assert.equal(
Counter.decode(Uint8Array.from([0x08, 0xff, 0xff, 0xff, 0xff, 0x0f])).count,
0xffff_ffff,
);
assert.throws(
() => Counter.decode(Uint8Array.from([0x08, 0x80, 0x80, 0x80, 0x80, 0x10])),
/Varint exceeds 32 bits/,
);
});
Loading