Skip to content

fix(satp-hermes): remove inverted condition bypassing Stage 3 commonBodyVerifier#4

Open
mn-ram wants to merge 9 commits intomainfrom
fix/satp-hermes-stage3-validation-bypass
Open

fix(satp-hermes): remove inverted condition bypassing Stage 3 commonBodyVerifier#4
mn-ram wants to merge 9 commits intomainfrom
fix/satp-hermes-stage3-validation-bypass

Conversation

@mn-ram
Copy link
Copy Markdown
Owner

@mn-ram mn-ram commented Apr 2, 2026

Summary

  • Removes inverted if (request.common == undefined) guard that was silently skipping all commonBodyVerifier protocol checks in Stage 3 server-side validation
  • Aligns stage3-server-service.ts with every other stage service that calls commonBodyVerifier unconditionally

Fixes #3

Changes

Three functions in stage3-server-service.ts had commonBodyVerifier wrapped inside if (request.common == undefined), causing validation to be skipped on every real request:

  • checkCommitPreparationRequest (before mintAsset)
  • checkCommitFinalAssertionRequest (before assignAsset)
  • checkTransferCompleteRequest (before transfer completion)

Removed the wrapping condition so validation runs unconditionally, matching stage1-server, stage2-server, and all client services.

Test plan

  • Verify existing SATP integration tests pass
  • Confirm Stage 3 requests with valid common body are now validated
  • Confirm Stage 3 requests with missing common body still throw SatpCommonBodyError
  • Confirm requests with wrong sequence number / session ID / pubkeys are rejected

@mn-ram mn-ram force-pushed the fix/satp-hermes-stage3-validation-bypass branch from 3e9b3a1 to 7b970e7 Compare April 2, 2026 12:29
Signed-off-by: Rahul Tripathi <rahul@Rahuls-Mac-mini.local>
@mn-ram mn-ram force-pushed the fix/satp-hermes-stage3-validation-bypass branch from a348ac8 to d6e7058 Compare April 13, 2026 12:37
RafaelAPB and others added 7 commits April 13, 2026 16:26
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

fix(satp-hermes):  fix  getOAS

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>

chore: update supported ledgers

Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
Signed-off-by: Rafael Belchior <rafael.belchior@tecnico.ulisboa.pt>
…acti#4150)

Replaced vulnerable `pull_request_target` with `pull_request`.
Wrapped `echo` arguments in quotes to guard against command injections.

Signed-off-by: VRamakrishna <vramakr2@in.ibm.com>
Replace Promise.all with Promise.allSettled so a single plugin failure
during shutdown does not abort HTTP/gRPC server cleanup. Log the plugin
instance ID when a shutdown failure occurs.

Fixes hyperledger-cacti#4160

Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>
Signed-off-by: Dev10-sys <kalpanagola9897@gmail.com>
Consolidates 10 recent dependabot PRs (hyperledger-cacti#4228, hyperledger-cacti#4225, hyperledger-cacti#4224, hyperledger-cacti#4220, hyperledger-cacti#4219,
 and hyperledger-cacti#4218, hyperledger-cacti#4217, hyperledger-cacti#4214, hyperledger-cacti#4213, hyperledger-cacti#4210) into a single update.

| Package | From | To |
| --- | --- | --- |
| [@angular/compiler](https://github.com/angular/angular) | 17.3.11 | 19.2.20 |
| [@angular/core](https://github.com/angular/angular) | 17.3.11 | 19.2.20 |
| [ajv](https://github.com/ajv-validator/ajv) | 8.17.1 | 8.18.0 |
| [axios](https://github.com/axios/axios) | 1.13.4 | 1.15.0 |
| [basic-ftp](https://github.com/patrickjuchli/basic-ftp) | 5.1.0 | 5.2.2 |
| [diff](https://github.com/kpdecker/jsdiff) | - | (updated) |
| [dompurify](https://github.com/cure53/DOMPurify) | 3.3.1 | 3.3.3 |
| [fastify](https://github.com/fastify/fastify) | 4.28.1 | 5.8.3 |
| [flatted](https://github.com/WebReflection/flatted) | 3.3.3 | 3.4.2 |
| [immutable](https://github.com/immutable-js/immutable-js) | 4.3.7 | 4.3.8 |
| [lodash](https://github.com/lodash/lodash) | 4.17.23 | 4.18.1 |
| [markdown-it](https://github.com/markdown-it/markdown-it) | 14.1.0 | 14.1.1 |
| [multer](https://github.com/expressjs/multer) | 1.4.5-lts.1 | 2.1.1 |
| [picomatch](https://github.com/micromatch/picomatch) | - | (updated) |
| [qs](https://github.com/ljharb/qs) | 6.13.0 | 6.14.2 |
| [rollup](https://github.com/rollup/rollup) | 2.79.2 | 2.80.0 |
| [simple-git](https://github.com/steveukx/git-js) | 3.19.1 | 3.32.3 |
| [sjcl](https://github.com/bitwiseshiftleft/sjcl) | 1.0.8 | 1.0.9 |
| [undici](https://github.com/nodejs/undici) | 7.8.0 | 7.24.0 |
| [webpack](https://github.com/webpack/webpack) | 5.94.0 | 5.104.1 |
| [yaml](https://github.com/eemeli/yaml) | 1.10.2 | 1.10.3 |

All dependency updates from April 10-13, 2026 are included in this single commit.

Supersedes PRs: hyperledger-cacti#4228, hyperledger-cacti#4225, hyperledger-cacti#4224, hyperledger-cacti#4220, hyperledger-cacti#4219, hyperledger-cacti#4218, hyperledger-cacti#4217, hyperledger-cacti#4214, hyperledger-cacti#4213, hyperledger-cacti#4210

Signed-off-by: Sandeep Nishad <sandeepn.official@gmail.com>
- Add pre-check step to display commit messages with line numbers and character counts
- Fix config file reference from commitlint.config.mjs to commitlint.config.js
- Add verbose logging and proper error handling
- Fix shellcheck issues (use -r flag with read, proper variable quoting)
- Increase header-max-length from 72 to 80 characters
- Increase body-max-line-length from 80 to 102 characters
- Increase footer-max-line-length from 80 to 102 characters

This helps identify exactly which lines violate the character limits and provides
more flexibility for detailed commit messages.

Signed-off-by: Sandeep Nishad <sandeepn.official@gmail.com>
@sandeepnRES sandeepnRES force-pushed the fix/satp-hermes-stage3-validation-bypass branch from d6e7058 to 418e97e Compare April 20, 2026 17:30
The mintAsset, burnAsset, and assignAsset methods in Stage 3 services
were calling persistLogEntry() and storeProof() without await, causing
fire-and-forget promises that lead to unhandled rejections, silent
proof loss, and potential duplicate blockchain transactions on crash
recovery.

Also fix the inverted condition in stage3ServerService that was
bypassing commonBodyVerifier on every real request. The three
server-side validation functions (checkCommitPreparationRequest,
checkCommitFinalAssertionRequest, checkTransferCompleteRequest)
wrapped the commonBodyVerifier call inside
if (request.common == undefined), so all Stage 3 protocol checks
(version, sequence number, session id, gateway pubkeys, hash chain
integrity, message type) were skipped before critical blockchain
operations.

Aligns stage3-server-service with the other stage services that call
commonBodyVerifier unconditionally.

Fixes hyperledger-cacti#4167

Signed-off-by: mn-ram <235066282+mn-ram@users.noreply.github.com>
@mn-ram mn-ram force-pushed the fix/satp-hermes-stage3-validation-bypass branch from 418e97e to a264e78 Compare April 20, 2026 18:15
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.

fix(satp-hermes): Inverted condition in Stage 3 server bypasses all commonBodyVerifier protocol checks

5 participants