gchq / gchq/CyberChef

Bug report: URL Encoding outputs extra characters

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

Description

**Describe the bug**
URL Encoding adds extra characters when certain bytes exist in the input.

**To Reproduce**
Steps to reproduce the behaviour or a link to the recipe / input used to cause the bug:

* Version: 9.21.0
* Compile time: 12/06/2020 12:53:19 UTC
* User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:81.0) Gecko/20100101 Firefox/81.0
* [Link to reproduce](https://gchq.github.io/CyberChef/#recipe=From_Hex('Auto')XOR(%7B'option':'Hex','string':'c50692d0026b3d91'%7D,'Standard',false)URL_Encode(false)&input=NzIgNjEgNzQgNmYgNzIgMDAgMDAgMDA)

**Expected behaviour**
The expected URL encoded value would be `%b7g%e6%bfpk=%91` but currently it's returning `%C2%B7g%C3%A6%C2%BFpk%3D%C2%91`.
Note that if we use a "To Hex" operation right after the XOR, the returned value is correct: `b7 67 e6 bf 70 6b 3d 91`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.