gchq / gchq/CyberChef

Bug report: empty value in input shows error and output "[object Object]" in Generate Lorem Ipsum operation

Open
#2,085 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**
In the _Generate Lorem Ipsum_ operation, entering an empty value in the Length field

1. shows a toast popup that says "[object Object]",
2. prints an output that says "[object Object]",
3. the operation _Generate Lorem Ipsum_ stays green, despite being in an error state, and
4. logs an error message and a regular message with "[object Object]" to the browser console.

**To Reproduce**

1. In the Operations tab, search for "lorem".
2. Drag the _Generate Lorem Ipsum_ operation to the Recipe tab.
3. In the _Length_ field, delete the existing value of "3". The number input should be empty.
4. The _Output_ block should say `[object Object]` the _Generate Lorem Ipsum_ operation should stay green, and a toast with the text `[object Object]` will appear at the bottom of the screen.

**Expected behaviour**
* A human readable error message -- either in the Output block (recipe/operation wide error), or in a form-style input validation error message (input-level error).
* The operation block being red, in order to indicate an error state, instead of green.
* The toast either not showing up at all -- like some other error messages -- or showing a human readable error message instead of "[object Object]".

**Screenshots**

Bug demonstration with browser console open:

Invalid input value (empty string) with browser console open, with bug



Expected behavior for invalid input:

Expected behavior for invalid input



Bug demonstration, for comparison with the expected behavior:

Bug demonstration, for comparison with the expected behavior

**Desktop**
- OS: Windows 11
- Browser: 135.0.7049.84 (Official Build, ungoogled-chromium) (64-bit)
- CyberChef version: 10.19.4
- Compile time: 23/07/2025 10:26:40 UTC
- User-Agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36
- [Link to reproduce](https://gchq.github.io/CyberChef/#recipe=Generate_Lorem_Ipsum(null,'Paragraphs'))

**Additional context**
`[object Object]` appears when a JS object is coerced/converted into a string without using `JSON.stringify`, or when an object is set as the `innerHTML` of an HTML element

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.