Skip to content

Security: admin/avatar auth, open-redirect fix, blockchain fail-closed - #1142

Merged
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
temiport25:temiport25/security-auth-openredirect-blockchain-default
Aug 26, 2026
Merged

Security: admin/avatar auth, open-redirect fix, blockchain fail-closed#1142
nanaf6203-bit merged 2 commits into
MettaChain:mainfrom
temiport25:temiport25/security-auth-openredirect-blockchain-default

Conversation

@temiport25

Copy link
Copy Markdown
Contributor

Four security fixes:

  • Admin rate-limit endpoints now require an authenticated ADMIN.
  • Avatar upload/delete/get now require authentication.
  • /track/click validates the redirect target (scheme + host allow-list, fail closed).
  • Blockchain service no longer initializes against the placeholder RPC URL.

Closes #1018

Closes #1019

Closes #1020

Closes #1021

…losed blockchain

- RateLimitAdminController: require authenticated ADMIN (JwtAuthGuard+RolesGuard) (MettaChain#1018)
- AvatarUploadController: require authentication on all routes (MettaChain#1019)
- TrackingController: validate redirect scheme + host allow-list (fail closed) (MettaChain#1020)
- BlockchainService: refuse placeholder RPC URL; run disabled when unset (MettaChain#1021)

Closes MettaChain#1018
Closes MettaChain#1019
Closes MettaChain#1020
Closes MettaChain#1021

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_01NJauhMw3eEcE45J1hUX2aZ
@drips-wave

drips-wave Bot commented Aug 25, 2026

Copy link
Copy Markdown

@temiport25 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

The @UseGuards(JwtAuthGuard) added to AvatarUploadController requires
AuthService in the DI container. Without this mock, NestJS fails to
compile the test module.

@nanaf6203-bit nanaf6203-bit left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks for getting this over the line!

@nanaf6203-bit
nanaf6203-bit merged commit 7fc14c1 into MettaChain:main Aug 26, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment