decentraland / decentraland/profile-images
Path traversal via unvalidated entityId from SQS message
- 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
Assessment
This issue has not been assessed yet.