Skip to content

fix: resolve InternalServerError variant mismatch and staking auth IDOR#633

Open
Hovibby wants to merge 1 commit into
Arenax-gaming:mainfrom
Hovibby:fix/internal-server-error-variant-staking-idor
Open

fix: resolve InternalServerError variant mismatch and staking auth IDOR#633
Hovibby wants to merge 1 commit into
Arenax-gaming:mainfrom
Hovibby:fix/internal-server-error-variant-staking-idor

Conversation

@Hovibby

@Hovibby Hovibby commented Jun 26, 2026

Copy link
Copy Markdown

closes #630

closes #631

  • Change ApiError::InternalServerError from unit to tuple variant (String)
    to fix compile-time error across gas_estimation_handler, staking_service,
    and analytics_service

  • Sanitize error responses: stop echoing internal error details to clients

  • Remove user_id from StakeBody/ClaimBody; identity now sourced from JWT
    claims only, preventing users from acting on behalf of other accounts

  • Validate stellar_address against wallets.stellar_public_key for the
    authenticated user on stake and claim endpoints (403 on mismatch)

  • Protect unstake/{user_id} path param against JWT identity mismatch (403)

  • Add tracing::error! logging in gas estimation handler before 500 response

  • Add unit tests: unauthenticated stake -> 401, wrong-user unstake -> 403

- Change ApiError::InternalServerError from unit to tuple variant (String)
  to fix compile-time error across gas_estimation_handler, staking_service,
  and analytics_service

- Sanitize error responses: stop echoing internal error details to clients

- Remove user_id from StakeBody/ClaimBody; identity now sourced from JWT
  claims only, preventing users from acting on behalf of other accounts

- Validate stellar_address against wallets.stellar_public_key for the
  authenticated user on stake and claim endpoints (403 on mismatch)

- Protect unstake/{user_id} path param against JWT identity (403 on mismatch)

- Add tracing::error! logging in gas estimation handler before 500 response

- Add unit tests: unauthenticated stake -> 401, wrong-user unstake -> 403
@Hovibby Hovibby requested a review from anonfedora as a code owner June 26, 2026 06:40
@vercel

vercel Bot commented Jun 26, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the paul joseph's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

[server] - Security: Staking Endpoints Accept user_id from Request Body [server] - Fix Compile Error in gas_estimation_handler.rs

1 participant