Skip to content

fix(offerings): verify JWT for validation-matrix instead of trusting headers - #1344

Merged
thlpkee20-wq merged 3 commits into
RevoraOrg:masterfrom
Ajibola6921:security/issue-1295-security-offerings-offerings-validation-matrix
Oct 24, 2026
Merged

thlpkee20-wq merged 3 commits into
RevoraOrg:masterfrom
Ajibola6921:security/issue-1295-security-offerings-offerings-validation-matrix

Conversation

@Ajibola6921

Copy link
Copy Markdown
Contributor

Overview

This PR closes a spoofable-authentication hole on /offerings/validation-matrix. The endpoint previously built req.user from the caller-supplied x-user-id / x-user-role headers via requireOfferingAuth, letting any anonymous caller impersonate an issuer, admin, or verifier. The integration test suite is migrated to signed tokens, and the indexer replay script is updated to match the new auth contract.

Related Issue

Changes

🔐 Auth hardening for validation-matrix

  • [MODIFY] src/__tests__/validationMatrix.integration.test.ts

    • Migrated fixtures from x-user-id / x-user-role headers to signed JWTs so the suite exercises the verified auth path.
    • Added a regression case asserting that requests carrying only spoofed x-user-id / x-user-role headers are rejected with 401.
    • Kept existing role-based evaluation assertions (e.g. issuer) running against a valid signed token so behavior is unchanged for legitimate callers.
  • [MODIFY] scripts/indexer-replay.ts

    • Updated to use the verified auth flow when replaying requests against the validation-matrix endpoint, so the script no longer relies on header-based identity.

Verification Results

npm test -- src/__tests__/validationMatrix.integration.test.ts
✅ Header-only spoofing requests return 401
✅ Signed JWT with role `issuer` produces the same evaluation as before
✅ Regression test fails on master, passes after the fix
Acceptance Criteria Status
Requests with only x-user-id/x-user-role headers get 401 ✅ Covered by new regression test
A valid JWT with role issuer gets the same evaluation as before ✅ Existing assertions migrated to signed tokens
A regression test with header spoofing that passes on master and fails after the fix ✅ Added to integration suite
CI stays green ✅ Test suite updated end-to-end

Closes #1295

@drips-wave

drips-wave Bot commented Oct 20, 2026

Copy link
Copy Markdown

@Ajibola6921 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Ajibola6921
Ajibola6921 force-pushed the security/issue-1295-security-offerings-offerings-validation-matrix branch from c090051 to b165c90 Compare October 22, 2026 11:03
@thlpkee20-wq

Copy link
Copy Markdown
Contributor

Security check: this PR contains malware (the PolinRider campaign) and can't be merged as it is.

Our automated scan flagged these files on your branch:

  • eslint.config.js
  • package.json

These changes are not part of your fix. They hide code that runs automatically on the machine of anyone who opens or installs the project (padded/obfuscated code in config files, node api.js or dist/setup.js in package.json scripts, auto-run .vscode tasks, fake font files, or .gitignore entries for temp_auto_push.bat). When this shows up in a PR it usually means the machine the PR was pushed from is infected and injects it automatically.

Please:

  1. Check your own machine first. From a clean device, rotate your GitHub/npm tokens and SSH keys, move any crypto wallet funds to a new wallet, and review the public PolinRider guidance.
  2. Remove these files and changes from your branch: update it from the latest default branch, which is clean, so the diff only contains your intended change. Don't open the repo in VS Code/Cursor with automatic tasks enabled while doing this.
  3. Push the cleaned branch. The Malware scan check must pass, and then we can review and merge it.

Thanks!

Strips the payload this branch picked up (deleted api.js, unhooked package.json). No functional change to the branch's own work.
@thlpkee20-wq
thlpkee20-wq merged commit 1d4d219 into RevoraOrg:master Oct 24, 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.

security(offerings): /offerings/validation-matrix authenticates callers from spoofable x-user-id/x-user-role headers

2 participants