Bug report: Protobuf imprecision on uint64
- Dominant language
- JavaScript
- Stars
- 35.8k
- Forks
- 4.1k
- Avg merge
- 2d 26m
- Merged PRs (30d)
- 33
Description
**Describe the bug**
It seems that for unsigned 64-bit integers that are too large (didn't characterize them), Protobuf Encode and Protobuf Decode provide wrong outputs.
**To Reproduce**
Example:
https://gchq.github.io/CyberChef/#recipe=From_Hex('Auto')Protobuf_Decode('message%20x%20%7B%5Cn%20%20required%20uint64%20a%20%3D%201;%5Cn%7D',false,true)&input=MDhhNmU4ZGFiMWZiZjNkN2RkNzc
returns
```json
{
"a (uint64)": 8627594650719794000
}
```
**Expected behaviour**
It should output
```json
{
"a (uint64)": 8627594650719794214
}
```
**Desktop**
- CyberChef version: 9.39.1
Contributor guide
Research direction
Start with the Protobuf_Decode and Protobuf Encode operations and reproduce the linked CyberChef example using the uint64 value shown in the report. Trace how large unsigned 64-bit values are parsed and represented, then verify that the reported input produces 8627594650719794214 rather than the imprecise result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100