Repository navigation
Conversation
Adds a new operation to decode JavaScript obfuscated using only 6 characters ([ ] ( ) ! +), commonly known as an esoteric JS encoding style. - Added src/core/operations/FromJS6Chars.mjs - Added operation to Code tidy category in Categories.json - Added tests in tests/operations/tests/FromJS6Chars.mjs fix: correct invalid input test to check error message output
|
that operation is high risk of xss and very unsafe @Roma476 example [][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(![]+[])[+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(!![]+[])[+[]])((![]+[])[+!+[]]+(![]+[])[!+[]+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+!+[]]+(!![]+[])[+[]])()and then will trigger an alert 1 popup since you calling |
|
@HackingRepo Fair point, I'll rework it to decode statically instead of executing the code. |
|
@GCHQDeveloper581 @HackingRepo Would it be possible to add me as an outside collaborator so the PR can be reviewed? I'm happy to make any changes required. I'll close this PR once #2932 is merged. |
|
Thank you for your contribution - unfortunately this repository only accepts pull requests from organisation members or approved outside collaborators. Due to that, this pull request has been closed automatically. |
Adds a new operation to decode JavaScript obfuscated using only 6 characters ([ ] ( ) ! +), commonly known as an esoteric JS encoding style named JS6Chars.
Description
This is a rework of a previously closed PR (#2358), renamed following maintainer feedback regarding the original operation name not being corporately acceptable. All references to the original name have been removed from the code, description, and tests, and the commit history has been squashed into a single commit as requested.
Existing Issue
Closes #1054
Screenshots
N/A, this operation does not change any existing visual aspects of CyberChef.
AI disclosure
I used Claude (Anthropic) to help debug a test failure I ran into while preparing this PR (a test using
expectedError: truewas failing becauseRecipe.executehandlesOperationErroras expected/handled output rather than a thrown error, so the test neededexpectedOutputwith the error message instead). I wrote the operation logic, description, and tests myself; Claude helped me understand the CyberChef Recipe/Chef error-handling flow to fix that specific test. I have reviewed and understand all the code being submitted.Test Coverage
Added 4 tests covering: basic decoding, a longer string ("Hello"), numeric input, and invalid character input (verifying the error message output).