Skip to content

fix: add path traversal validation in deleteAvatar method#822

Open
AYOMI-cmd wants to merge 1 commit into
MettaChain:mainfrom
AYOMI-cmd:deleteAvatar-filename-parameter-lacks-path-traversal-validation
Open

fix: add path traversal validation in deleteAvatar method#822
AYOMI-cmd wants to merge 1 commit into
MettaChain:mainfrom
AYOMI-cmd:deleteAvatar-filename-parameter-lacks-path-traversal-validation

Conversation

@AYOMI-cmd

Copy link
Copy Markdown

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

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

1 participant