gchq / gchq/CyberChef

bug(AMF Decode): Buffer exhausted while reading 8 bits at offset 0 via just empty input or newline

Open
#2,492 2 comments 0 reactions 0 assignees View on GitHub
bug help wanted
Dominant language
JavaScript
Stars
35.8k
Forks
4.1k
Avg merge
2d 26m
Merged PRs (30d)
33

Description

To reproduce that extremly very simple, just drag AMF decode
then you will see an uncaught error

```js
AMF Decode - Error in https://gchq.github.io/CyberChef/modules/Encodings.js on line 2.

Message: Buffer exhausted while reading 8 bits at offset 0, context:
- [ye] Ue#marker
- [readField()] Ue#marker
- [read()] Ue
- [Ue.read()] Ue
```

Direct Test Link:
- https://gchq.github.io/CyberChef/#recipe=AMF_Decode('AMF3')&oenc=65001&oeol=VT
- https://gchq.github.io/CyberChef/#recipe=AMF_Decode('AMF3')&input=ChMBA2EFQAg&oenc=65001&oeol=VT
- https://gchq.github.io/CyberChef/#recipe=AMF_Decode('AMF3')&input=CRMBA2EFQAg&oenc=65001&oeol=VT

Contributor guide

Open the contributing guide

Research direction

Start by running the linked AMF Decode recipes with empty input, a newline, and the provided sample data. Inspect the AMF Decode path associated with the error reported from Encodings.js. Done means these inputs no longer produce an uncaught buffer-exhaustion error and the existing sample cases still decode correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.