Skip to content

Soroban dry-run mode is indistinguishable from a real on-chain success in persisted data, risking silent fake payouts in misconfigured environments #7

Closed

Description

@chonilius

Background

SorobanClientService.invoke short-circuits to a dry-run result
(status: DRY_RUN with a fake dry-run txHash) whenever isConfigured()
is false (missing ESCROW_CONTRACT_ID/TREASURY_SECRET).
EscrowService then persists escrow.fundTxHash and escrow.releaseTxHash
from that result unconditionally — the DRY_RUN status itself is stashed
in escrow.metadata for fund but is not checked anywhere before marking
Escrow/Payment rows as LOCKED/RELEASED/CONFIRMED.

Problem Statement

If ESCROW_CONTRACT_ID or TREASURY_SECRET is accidentally unset in a
supposedly-production environment (e.g. a bad deploy config, a secret that
failed to inject), the system will happily keep operating: bounties will
appear FUNDED, PAID with confirmed Payment rows and fake dry-run
transaction hashes, contributors' dashboards will show earnings
that don't correspond to any real on-chain settlement, and nobody will
notice until a contributor tries to actually spend funds that were never
sent. This is a severe silent-failure mode for a platform whose entire value
proposition is "money moves automatically and verifiably" — worse than an
outright crash, because it looks like success.

Requirements

  • Add an explicit, loud safety mechanism: in NODE_ENV=production,
    SorobanClientService.invoke must refuse to dry-run (throw a hard error
    at startup or per-call) rather than silently degrading — mirror the
    pattern already used in main.ts for the insecure default JWT secret
    (INSECURE_DEFAULT_JWT_SECRET check).
  • In non-production environments where dry-run is intentional, propagate the
    DRY_RUN status distinctly through Escrow/Payment status enums (or a
    dedicated boolean flag) so it's queryable and clearly surfaced in any API
    response / Swagger schema, never conflated with a real CONFIRMED
    on-chain payment.
  • Add a startup health check / admin endpoint that reports whether the
    escrow subsystem is in dry-run or live mode.
  • Write tests asserting the production guard actually throws, and that
    dry-run payments are visibly marked as such end-to-end (entity ->
    DTO/response).

Acceptance Criteria

  • Starting the app with NODE_ENV=production and no
    ESCROW_CONTRACT_ID/TREASURY_SECRET fails fast (fails startup or
    the first escrow call, contributor's choice, but must be loud, not
    silent).
  • Dry-run payments/escrows are distinguishable from real ones in the DB
    schema and any API surface that exposes payment status.
  • Test coverage for both the production guard and the dry-run marking.

Technical Notes

Files: src/escrow/soroban-client.service.ts, src/escrow/escrow.service.ts,
src/common/enums (status enums), src/main.ts (existing pattern to
mirror).

Difficulty Justification

Requires reasoning about operational failure modes of a financial system,
not just code correctness — the "hard part" is recognizing that a silently
degraded mode is more dangerous than a crash and designing guardrails that
are strict in production but don't break the intentionally-supported local
dry-run development workflow described in the README.

Activity

  1. added
    very hard
    bug
    security
    testing
    on Jul 15, 2026
  2. added
    GrantFox OSS
    Maybe Rewarded
    Official Campaign | FWC26
    on Jul 15, 2026
  3. added
    Stellar Wave
    on Aug 27, 2026
  4. alamuoyeemmanuel7-create commented on Aug 27, 2026

    @alamuoyeemmanuel7-create

    @alamuoyeemmanuel7-create has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello please I'd like to work on this issue

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @alamuoyeemmanuel7-create to this issue.

  5. bolajigate-cell commented on Aug 27, 2026

    @bolajigate-cell

    @bolajigate-cell has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Hello, this task matches my skills and I’m confident I can resolve it properly. Kindly assign it to me.

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @bolajigate-cell to this issue.

  6. codemagician1949 commented on Aug 27, 2026

    @codemagician1949
    Contributor

    @codemagician1949 has applied to work on this issue as part of the Stellar Wave Program's 8th wave.

    Applying for this issue in this repo.

    Why me:

    Solid hands-on experience with required Stack Shipped Similar Past Work — similar scope/complexity Can turn this around in 7hrs Available [Now] Would appreciate the opportunity to work on this. Thanks for considering my application!

    ℹ️ Repo Maintainers: To accept this application, review their application or assign @codemagician1949 to this issue.

  7. drips-wave commented on Aug 27, 2026

    @drips-wave

    Congratulations, @codemagician1949! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on August 31, 2026.

    🧑‍💻 @codemagician1949: Please resolve the issue such that the repo's maintainers have enough time to review your contribution before the due date. You'll earn Points for completing the issue on-time, which will make you eligible for a share of the Stellar Wave Program's reward pool.

    Warning

    When opening a PR, please link it to this issue to ensure it gets tracked accurately. Points are awarded when this issue is marked as completed by the maintainer.

    🤠 Repo maintainers: Please keep an eye on the contributor's progress and review their work before the due date. You can manage this issue, including adjusting its complexity and points, here.

    🌊 Happy Wave 🌊

  8. drips-wave commented on Aug 27, 2026

    @drips-wave

    This issue has been completed by @codemagician1949 as part of the Stellar Wave Program's 8th Wave 🥳

    😎 @codemagician1949: You earned 200 Points for completing this issue! After the current Wave ends, you'll be eligible for a percentage of the Wave's reward pool based on the percentage of total points you've earned. Learn more here. You can also Leave a review to share your experience working on this issue.

    🧑‍💻 Repo maintainers: How'd the contributor do? Leave a review to share your experience working with them.

  9. removed
    Stellar Wave
    on Oct 15, 2026
  10. added
    Stellar Wave
    on Oct 15, 2026
  11. removed
    Stellar Wave
    on Oct 15, 2026
  12. added
    Stellar Wave
    on Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

GrantFox OSSMaybe RewardedOfficial Campaign | FWC26Stellar Wavebugsecuritytestingvery hard

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions