Skip to content

Governance propose lacks minimum deposit #992

Closed

Description

@DevMuhdishaq

Problem

The API route api/artist/[id].tsx does not validate the id parameter, allowing path traversal attacks and SQL injection through the artist ID parameter. Users can manipulate the URL to access unauthorized data or inject SQL commands.

Why it matters

Unvalidated route parameters:

  1. Path traversal can access files outside the intended directory
  2. SQL injection can compromise the database
  3. Exposes internal system structure and data
  4. Allows attackers to bypass authentication and authorization

Suggested Direction

  1. Add zod or express-validator validation for the id parameter in api/artist/[id].tsx.
  2. Validate that id is a positive integer or valid UUID format.
  3. Use parameterized queries instead of string concatenation for any database operations.
  4. Add rate limiting on the artist API endpoint.
  5. Write a test asserting the validation works and blocks injection attempts.
  6. Check api/marketplace/[id].tsx and api/portfolio/[id].tsx for the same parameter validation gaps.

Acceptance Criteria

  • api/artist/[id].tsx validates the id parameter format
  • Invalid IDs return 400 Bad Request with clear error message
  • SQL injection attempts are blocked
  • Path traversal attempts are blocked
  • Test asserts validation blocks malicious inputs
  • All artist/marketplace/portfolio API routes validate their parameters
  • No unvalidated route parameters remain in the API

Related

api/artist/[id].tsx, api/marketplace/[id].tsx, api/portfolio/[id].tsx, validators/artist-id.validator.ts, test/artist-api.test.ts

Activity

  1. shobhamerabacha-star commented on Oct 13, 2026

    @shobhamerabacha-star

    Greetings,

    I looked into the details for "Governance propose lacks minimum deposit" and would like to contribute the fix.

    Technical Implementation Outline:

    1. Review contract state storage keys, TTL policies, and auth guards (Address::require_auth).
    2. Implement safe state transition logic with checked arithmetic preventing under/overflow.
    3. Write comprehensive Soroban unit tests covering standard flows, unauthorized callers, and reverts.
    4. Verify contract execution footprint passes Soroban CPU/memory budget limits.

    Please assign this issue to me. I will submit a clean, well-tested, and production-ready PR promptly!

  2. Yungmon22 commented on Oct 19, 2026

    @Yungmon22

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

    Hi Maintainer, I've gone through the issue requirements and relevant documentation and have a clear direction for tackling the task. I'd be happy to contribute to its resolution and discuss my proposed approach if needed.

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

  3. sandrawillow001-afk commented on Oct 19, 2026

    @sandrawillow001-afk
    Contributor

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

    sir i can work on this issue sir

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

  4. drips-wave commented on Oct 19, 2026

    @drips-wave

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

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

  5. sandrawillow001-afk commented on Oct 21, 2026

    @sandrawillow001-afk
    Contributor

    Checked this against the repo: there is no api/ directory, no Express/Next API routes and no server-side query layer here — src/types/api holds only wire DTOs for the external backend. The SPA does read unvalidated useParams() values (listingId, artworkId, slug, username), but adding client-side route-param validation changes routing behaviour, so I did not fold it into #1048 (the #1000 fix). This one belongs with the backend repo that owns api/artist/[id].tsx.

  6. drips-wave commented on Oct 26, 2026

    @drips-wave

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

    😎 @sandrawillow001-afk: 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions