gchq / gchq/CyberChef-server

Bug report: Strange toTable behavior

Open
#85 4 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
JavaScript
Stars
179
Forks
66
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**

0. toTable in the live client implementation seems to work as expected:

Image

1. I then tried to do the same via CyberChef-server swagger interface running in docker (per the clone, build, run instructions in the [README](https://github.com/gchq/CyberChef-server?tab=readme-ov-file#docker))

Image

```json
{
"input": "mess with the best, die like the rest",
"recipe": [
{
"op": "toTable"
}
]
}
```

Image

2. Note "rest" is missing in the output 😞

3. Wondering WTF is going on I go back and insert another "rest" in the input (at this point thinking, is "rest" a reserved word or something weird like that). `mess with the best, die rest like the rest` which also results in a broken output:

Image

4. It seems like each space R ` r` is being treated as `\r` for some reason? But that's just my guess.

**To Reproduce**
As above

**Expected behavior**
The result should be the same as when using the live client version.

```md
+--------------------+--------------------+
| mess with the best | die like the rest |
+--------------------+--------------------+
```

or

```md
+--------------------+-------------------------+
| mess with the best | die rest like the rest |
+--------------------+-------------------------+

```

**Node version:**

Seems to be 17:

```console
docker run -it --rm --name=cyberchef-server -p 3000:3000 cyberchef-server

> cyberchef-server@1.1.0 prod
> NODE_ENV=production node index.mjs

(node:17) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:17) Warning: Accessing non-existent property 'b2u' of module exports inside circular dependency
(node:17) Warning: Accessing non-existent property 'u2b' of module exports inside circular dependency
(node:17) Warning: Accessing non-existent property 'Pair' of module exports inside circular dependency
CyberChef Server listening on port 3000!
```

**Additional context**

On the off chance that it's relevant this is on macOS Tahoe 26.2.

Contributor guide

Open the contributing guide

Research direction

Start with the Docker instructions in the README and reproduce the recipe through the Swagger interface using the issue's toTable example. Compare the server result with the live client and trace the server entry point handling the recipe; done means trailing words and spaces are preserved and the output matches the expected table.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.