gchq / gchq/CyberChef

Bug report: From Base64 in Strict mode with URL safe alphabet doesn't work

Open
#1,629 1 comment 2 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**
`From Base64` with `URL safe` alphabet doesn't work in `Strict mode`. It shows `Error: Base64 input contains non-alphabet char(s)`

**To Reproduce**
_Input:_ "test"
_Recipe:_
- To Base64 (URL safe alphabet)
- From Base64 (URL safe alphabet, Strcit mode)

_Output:_ "Error: Base64 input contains non-alphabet char(s)"

https://gchq.github.io/CyberChef/#recipe=To_Base64('A-Za-z0-9-_')From_Base64('A-Za-z0-9-_',false,true)&input=dGVzdA

**Expected behaviour**
Expected output: "test"

**Screenshots**
![image](https://github.com/gchq/CyberChef/assets/20068194/542e26b2-b583-4087-a381-5d87fd3bc345)

CyberChef version: 10.5.2

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the linked CyberChef recipe using the To Base64 and From Base64 operations with the URL-safe alphabet and Strict mode enabled. Trace how the encoded value is validated, then confirm that the recipe returns "test" without the non-alphabet-character error and add or update coverage for this case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.