Skip to content

fix: add path traversal validation in deleteAvatar method#822

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
AYOMI-cmd:deleteAvatar-filename-parameter-lacks-path-traversal-validation
Jun 28, 2026
Merged

fix: add path traversal validation in deleteAvatar method#822
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
AYOMI-cmd:deleteAvatar-filename-parameter-lacks-path-traversal-validation

Conversation

@AYOMI-cmd

Copy link
Copy Markdown
Contributor

Closes #685

✅ Update completed

The path traversal issue in avatar deletion has been fixed.

  • avatar-upload.service.ts now:

    • rejects invalid filenames with the allowed pattern ^[A-Za-z0-9._-]+$
    • resolves the candidate path and ensures it remains inside the user’s avatar directory before deleting anything
  • avatar-upload.spec.ts now includes a regression test for a traversal-style filename such as ../../secret.txt.

Verification

  • Editor diagnostics currently report no errors in the updated files.

Made changes.

@drips-wave

drips-wave Bot commented Jun 27, 2026

Copy link
Copy Markdown

@AYOMI-cmd 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

@nanaf6203-bit nanaf6203-bit merged commit 8072498 into MettaChain:main Jun 28, 2026
5 checks passed

Copy link
Copy Markdown
Contributor

✅ LGTM \u2014 nice work, thanks for the fix! 🚢

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.

deleteAvatar filename parameter lacks path-traversal validation

2 participants