Repository navigation
Conversation
Contributor
|
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. |
Collaborator
|
@Roma476 we are currently working out the process on working with approved outside collaborators. When we've completed this exercise, relevant affected PRs will be reopened/looked at for processing. In the meantime I suggest not making any changes to older PRs as this is likely to result in the bot closing them (as happened with your earlier PR), and older ones are more likely to be missed when reopening. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds the
From JS6Charsoperation to decode JavaScript obfuscated using only[ ] ( ) ! +.The decoder is implemented as a static interpreter:
esprima, which is already a production dependency. No new package is added.Functionconstructor. Function bodies that are a singlereturn <constant>are constant-folded; every other body is returned as source text.eval,new Function,vm, or any equivalent. Input code is never executed.Codemodule, so the interpreter is only downloaded when the operation is used.The operation is registered in the
Code tidycategory. A payload that constructs a Function body (return atont) is covered by a regression test: it is returned as text and never executed. A separate test uses a validalert(1)payload.Existing Issue
Relates to #1054.
Screenshots
N/A, this operation does not change any existing visual aspects of CyberChef.
AI disclosure
I used an AI coding assistant (DeepSeek V4.1 Flash) as a learning and development aid to help write parts of the code and to better understand some theoretical concepts. I defined the requirements and security constraints, reviewed and tested the final implementation, and take responsibility for the code submitted.
Test Coverage
Added 7 operation tests in
tests/operations/tests/FromJS6Chars.mjs:a)Hello)123)alert(1)payload that must be decoded without being executedreturn atont) and must not be executedVerified locally with:
npm test: 279 Node tests + 2334 operation tests passingnpm run lint: passing