gchq / CyberChef

The Cyber Swiss Army Knife - a web app for encryption, encoding, compression and data analysis
https://gchq.github.io/CyberChef
Apache License 2.0
29.49k stars 3.3k forks source link

Bug report: Entering a negative amount for the ROT13 operation leads to an incorrect toast message #1659

Open gregsadetsky opened 1 year ago

gregsadetsky commented 1 year ago

Describe the bug

When using the ROT13 operation, if you enter a negative "amount" (i.e. the amount that is 13 by default), an incorrect "toast" message appears at the bottom (see below for screenshot). An error also appears in the console: "Invalid ingredient value. Not a number: NaN"

To Reproduce

  1. go to https://gchq.github.io/CyberChef/#recipe=ROT13(true,true,false,-8)&input=VGhpcyBpcyBhIHRlc3Q
  2. in the "Amount" input in the ROT13 operation, delete the "8" and write "7" for example (making the amount -7)
  3. you will see an error in the console, and a toast message consisting of "[object Object]" will appear at the bottom

Expected behaviour

The expected behavior would be for no message to appear at the bottom, or for a human-readable one to appear.

Screenshots

image

Desktop (if relevant, please complete the following information):

Additional context

n/a

profbbrown commented 4 months ago

Several other operations have this same behavior. For example: ROT47, Affine Cipher Encode, LS47...

While I agree that displaying [object Object] is confusion and probably inappropriate, the question is: what should the UI do in these cases?