Skip to content

chore: remove obfuscated code smuggled into jest.config.js - #375

Merged
github-actions[bot] merged 1 commit into
TRELLIS-STELLAR:mainfrom
OkeyAmy:chore/jest-config-payload-removal
Oct 18, 2026
Merged

github-actions[bot] merged 1 commit into
TRELLIS-STELLAR:mainfrom
OkeyAmy:chore/jest-config-payload-removal

Conversation

@OkeyAmy

@OkeyAmy OkeyAmy commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

What changed

The exported Jest config in jest.config.js had roughly 26 KB of obfuscated code appended to the same line as the closing };. This removes it, leaving the file as configuration again. Nothing else in the tree changed.

Why it went

The blob plays no part in Jest configuration. It sits after the exported object, so it runs every time the config file loads — that is, on every npm test. What it contains:

  • eval(...) over a string assembled at run time
  • spawn(<cmd>, ['-e', <same string>], { detached: true, windowsHide: true }), invoked so a detached child process keeps running outside the test run
  • a lookup-table decode feeding new URL(...) and outbound fetches; no literal address survives in the file, the strings are recovered from a hex table while it executes

It arrived in e4c92ad ("test: add quiet hours and alert dedup tests (#304)"), a commit whose message never suggests it touches Jest configuration.

Indicators

Item Value
Injecting commit e4c92ad
Location jest.config.js line 40, one 26,296-character line appended after };
Signatures eval(DiRknXtYt+, spawn(, windowsHide, !![], new URL( decode loop
Blast radius In the original tree, grep -rl windowsHide matched only this file; a repo-wide scan for appended high-entropy lines (over 1,500 characters containing 0x.., !![], eval() found nothing else

Verification

  • node -e "require('./jest.config.js')" loads the cleaned config and stops there.
  • The suite runs under the cleaned config. Previously, simply loading the config was enough to set the payload off.

Related

Two further files in main are committed as Base64 rather than source (src/common/guard/quota.guard.spec.ts, scripts/validate-openapi.ts). They are repaired in a follow-up PR, so this one stays focused on the executable payload.

Line 40 of jest.config.js carried ~26KB of minified/obfuscated JavaScript
appended after the legitimate config object. It contained eval() and a
detached child_process.spawn of a -e script, plus outbound fetch calls,
and executed every time Jest loaded its configuration.

Introduced in e4c92ad. This restores the file to the intended 40-line
config; no configuration values change.
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

Hey @OkeyAmy! 👋 It looks like this PR isn't linked to any issue.

If this PR is for one of the issues assigned to you as part of a Wave, please link it to ensure your contribution is tracked properly. You can do this by adding a keyword to the PR description (e.g., Closes #123), or by clicking a button below:

Issue Title
#214 Trellis API: Add high-cardinality telemetry protection with redaction and sampling rules Link to this issue
#220 Trellis API: Add maintainer action approval flow with signed intent receipts Link to this issue
#218 Trellis API: Build multi-actor concurrency harness for race-prone mutations Link to this issue

ℹ️ Learn more about linking PRs to issues

@github-actions

Copy link
Copy Markdown

Code Review & Auto-Merge — @dorismaduegbunam 🚀

Thank you @OkeyAmy for your contribution!

  • PR Title: chore: remove obfuscated code smuggled into jest.config.js

  • Author: @OkeyAmy

  • Branch: chore/jest-config-payload-removal -> main

  • Status: Approved & Merged into main.

Verified code changes and repository requirements. Merging pull request.

@github-actions
github-actions Bot merged commit 09f0dfd into TRELLIS-STELLAR:main Oct 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant