Skip to content

fix: address security scan findings across ATS and Mass Payout - #1411

Open
nadinedelia wants to merge 1 commit into
hashgraph:mainfrom
nadinedelia:fix/security-scan-findings
Open

nadinedelia wants to merge 1 commit into
hashgraph:mainfrom
nadinedelia:fix/security-scan-findings

Conversation

@nadinedelia

Copy link
Copy Markdown

Addresses the findings from the internal security scan of this repo that were not already covered by the Halborn audit work now on main.

Contracts and deploy scripts

  • BusinessLogicResolver: the proxy is initialized in its deployment transaction (initializer calldata passed to the proxy constructor), so there is no window between deploy and initializeBusinessLogicResolver.
  • BusinessLogicResolver: addSelectorsToBlacklist / removeSelectorsFromBlacklist emit BlacklistSelectorsAdded / BlacklistSelectorsRemoved.
  • LifeCycleCashFlow: same atomic deploy + initialize in scripts/deploy.ts. The implementation calls _disableInitializers(), and initial role grants emit RoleGranted.
  • LifeCycleCashFlow: percentage snapshot payouts use the payment pool captured on the first paid batch, so every batch is paid from the same base. The new storage field is appended to the end of the namespaced struct.
  • LifeCycleCashFlow: executePercentageSnapshotByAddresses enforces the 100% cap, like the paged variant already does.
  • LifeCycleCashFlow: a zero snapshot amount no longer marks a holder as paid. Behaviour change: those holders are now returned in failed, so they can be paid later.
  • Deploy scripts: facet lookup, Hardhat detection and hash-stability baseline failures are now logged at warn and reported as partial results.

SDKs and apps

  • ATS and Mass Payout SDKs: shared log redaction for custodial settings (DFNS, Fireblocks, AWS KMS) and private keys. RPC API keys and full mirror node URLs are not logged. WalletConnect signatures are not logged.
  • Mass Payout backend: DTO validation for the listener config, with a field allow-list and URL validation. Mirror node host allow-list (BLOCKCHAIN_MIRROR_NODE_ALLOWED_HOSTS), checked on save and before every poll.
  • Mass Payout backend: page size capped at 1000, metadata lookups bounded (429 beyond the cap), generic client error messages with detail kept in the server log.
  • Mass Payout backend: one structured audit log line per state-changing request (actor taken from AUDIT_ACTOR_HEADER, body values never logged). docker-compose reads its credentials from .env and binds to 127.0.0.1.
  • Mass Payout docs: a new Security and Deployment section. The backend has no built-in authentication and must run behind the adopter's API gateway / identity layer on a private network.
  • Web apps: dev and preview servers bind to localhost and only accept localhost origins. Raw SDK errors are no longer shown to users, and form values and API URLs are no longer logged.

CI

  • persist-credentials: false on checkouts that don't push.
  • Every ${{ }} inside run: moved into env:.
  • id-token: write scoped to the publishing job, minimal workflow and job permissions.
  • Secrets withheld from pull_request runs, package cache disabled on publish/release jobs.
  • Dependabot cooldown of 7 days.

The three release and docs jobs that push (tag pushes in 002/003, doc regeneration in 106) keep persist-credentials: true explicitly.

Testing

  • ATS contracts: resolver tests 57 passing, deployment-system tests 80 passing, script unit tests 599 passing.
  • Mass Payout: contracts 645 passing, SDK 215 passing.
  • ATS SDK: 1,836 passing.
  • Mass Payout backend: 302 unit tests passing and 63 REST integration tests passing.
  • Web apps: Mass Payout frontend 258 passing, ATS web 192 passing.
  • Hedera testnet: deployed the full ATS system with these scripts (104 facets) and checked:
    • resolver admin, and that a second account can't initialize the resolver
    • the blacklist events
    • equity via the Factory: issue, transfer, and pause blocking transfers
  • Hedera testnet, LifeCycleCashFlow:
    • deploy and initialize in one transaction, with RoleGranted emitted for the initial roles
    • re-initialize and implementation initialize both rejected
    • a 200% by-addresses payout rejected
    • a two-batch 50% payout paid both holders the same amount from the same pool
  • Not run: the full ATS contracts integration suite.

Notes for reviewers

  • Mass Payout 1.1.x compiles against @hashgraph/asset-tokenization-contracts 7.0.0. ATS 9.0.0 changed the getERC20Metadata layout, so LifeCycleCashFlow.initialize reverts against 9.0 assets. This is pre-existing and not changed here. The testnet payout check used the suite's AssetMock for that reason.
  • scripts/deploy.ts passes a separately deployed ProxyAdmin as initialOwner of an OZ 5 TransparentUpgradeableProxy, which deploys its own ProxyAdmin. This is pre-existing and not changed here.

Contracts and deploy scripts
- BusinessLogicResolver proxy is initialized in its deployment transaction
- Selector blacklist changes emit BlacklistSelectorsAdded/Removed
- LifeCycleCashFlow proxy is initialized in its deployment transaction,
  the implementation disables initializers, initial role grants emit RoleGranted
- Percentage snapshot payouts reuse the pool captured on the first paid batch
- executePercentageSnapshotByAddresses rejects percentages above 100%
- A zero snapshot amount no longer marks a holder as paid
- Deployment scripts report lookup/detection/baseline failures instead of swallowing them

SDKs and apps
- ATS and Mass Payout SDKs redact custodial credentials, RPC API keys,
  mirror node URLs and WalletConnect signatures from logs
- Mass Payout backend: listener config DTO and mirror host allow-list,
  page size and metadata lookup caps, generic client errors, audit log
  line per state-changing request, docker-compose credentials from .env
- Docs: the Mass Payout backend has no built-in authentication and must
  run behind the adopter's gateway on a private network
- Web apps: dev servers accept localhost origins only, raw SDK errors are
  no longer shown, form values and API URLs are no longer logged

CI
- persist-credentials: false on checkouts that don't push
- ${{ }} expressions moved out of run: scripts into env
- id-token: write scoped to the publishing job, minimal workflow permissions
- Secrets withheld from pull_request runs, package cache off for publishing
- Dependabot cooldown

Signed-off-by: Nadine D’Elia <nadine.delia@yahoo.com>
@nadinedelia
nadinedelia requested review from a team as code owners November 3, 2026 12:44
@netlify

netlify Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for asset-tokenization-studio-hedera ready!

Name Link
🔨 Latest commit ccb359f
🔍 Latest deploy log https://app.netlify.com/projects/asset-tokenization-studio-hedera/deploys/6ae9d73e805231fd088707d1
😎 Deploy Preview https://deploy-preview-1411--asset-tokenization-studio-hedera.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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