decentraland / decentraland/profile-images

Path traversal via unvalidated entityId from SQS message

Open
#158 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

Description

## Summary
When the avatar comes inline in the SQS message, `consumer.ts:77-88` uses the message's `entity` without fetching the catalyst (so the id is never validated), and `message-validator.ts:50-58` only checks that `entityId` exists. `adapters/godot.ts:152-153` then interpolates `entity` into `path.join(outputPath, `${entity}_body.png`)`. An `entityId` like `../../..` writes the generated PNG outside the intended directory.

## Impact
Conditional on who can publish to the SQS queue (IAM). Out-of-directory file write.

## Fix
Validate `entityId` against the CID/hash format in `message-validator.ts` before using it in any path.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.