Skip to content

[Backend] createStreamSchema Zod validator is still unused; depositedAmount has no MAX_I128 cap #1532

Closed

Description

@K1NGD4VID

Labels: backend, bug, security, validation, third-wave-audit
File/location: backend/src/validators/stream.validator.ts:36 (createStreamSchema), backend/src/routes/v1/stream.routes.ts:40, backend/src/controllers/stream.controller.ts:102-230 (createStream)

Description:
createStreamSchema (with its MAX_I128 bound on ratePerSecond) is defined and unit-tested in isolation but is never imported by any route or controller — router.post('/', requireAuth, streamCreationRateLimiter, createStream) calls the manual ad-hoc BigInt parsing in createStream instead of createStreamSchema.safeParse. That manual path validates ratePerSecond/depositedAmount are positive integers but never caps depositedAmount against MAX_I128 (170141183460469231731687303715884105727), so an oversized depositedAmount string can pass validation and reach BigInt arithmetic / persisted i128 DB columns unchecked.

Acceptance Criteria:

  • POST /v1/streams rejects a depositedAmount value greater than i128::MAX with a 400 error
  • createStream either uses createStreamSchema.safeParse or the manual validation path gains an equivalent MAX_I128 check for depositedAmount
  • A regression test posts a depositedAmount > i128::MAX and asserts a 400 response

Notes:
Two prior issues (#452 'Wire createStreamSchema validation into POST /v1/streams' and #1273 'A stricter validation schema exists but is never used') were filed and closed for this exact defect class, but the current code on main still shows the schema unused and the depositedAmount bound missing — worth checking whether the fix regressed or was never actually merged into this code path.

Activity

  1. added
    bugSomething isn't working
    backendBackend related tasks
    securitySecurity related tasks
    third-wave-auditFiled from the third-wave repo audit sweep
    on Sep 27, 2026
  2. Ranjeet2063 commented on Oct 4, 2026

    @Ranjeet2063

    Hi maintainers,

    I reviewed this issue and would like to contribute the fix.

    Solution overview:

    1. Audit authorization boundaries and enforce defensive validation barriers.
    2. Implement multi-role permission checks and invocation validation.
    3. Write adversarial unit tests simulating edge failure modes and invalid callers.
    4. Ensure zero regressions across existing test suites and CI workflows.

    I can deliver a clean, tested PR within 24 hours. Please assign!

  3. ejiromowarin commented on Oct 18, 2026

    @ejiromowarin

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

    I would like to work on this issue

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

  4. OmniZlatoon commented on Oct 18, 2026

    @OmniZlatoon

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

    KINGDAVID sir, Can I work on this in 3 hours sir?

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

  5. fadesany commented on Oct 18, 2026

    @fadesany
    Contributor

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

    Hello maintainer, i would like to work on this issue

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

  6. drips-wave commented on Oct 18, 2026

    @drips-wave

    Congratulations, @fadesany! 🎉 Your application was accepted by the repo's maintainers, and the issue is due on October 22, 2026.

    🧑‍💻 @fadesany: 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 🌊

  7. added a commit that references this issue on Oct 18, 2026
  8. grantfox-oss commented on Oct 18, 2026

    @grantfox-oss

    🎉 This issue has been marked as completed on GrantFox!

    @fadesany's PR #1630 was approved and merged by @K1NGD4VID.

    🏆 @fadesany: You earned 40 FoxPoints for this contribution! Your current tier: Builder (1,225 total points). Track your full progress on GrantFox.

    👏 Great work, @fadesany! Keep contributing to LabsCrypt.

  9. drips-wave commented on Oct 18, 2026

    @drips-wave

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

    😎 @fadesany: You earned 200 Points for completing this issue! Once the Wave's rewards are finalized, 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.

  10. added a commit that references this issue on Oct 18, 2026
    5a6c73a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasksbugSomething isn't workingsecuritySecurity related tasksthird-wave-auditFiled from the third-wave repo audit sweepvalidation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions