Skip to content

Security: Path Traversal Vulnerability in Asset Hasher#7353

Open
tomaioo wants to merge 1 commit into
lablup:mainfrom
tomaioo:fix/security/path-traversal-vulnerability-in-asset-ha
Open

Security: Path Traversal Vulnerability in Asset Hasher#7353
tomaioo wants to merge 1 commit into
lablup:mainfrom
tomaioo:fix/security/path-traversal-vulnerability-in-asset-ha

Conversation

@tomaioo
Copy link
Copy Markdown

@tomaioo tomaioo commented May 11, 2026

Summary

Security: Path Traversal Vulnerability in Asset Hasher

Problem

Severity: Critical | File: packages/backend.ai-docs-toolkit/src/asset-hasher.ts:L48

The writeHashedAsset function in asset-hasher.ts does not validate the logicalName parameter. An attacker could provide paths like '../../../etc/passwd' to write files outside the intended assets directory.

Solution

Add path validation to ensure logicalName does not contain path traversal sequences. Use path.resolve() to normalize paths and verify the result stays within the assetsDir.

Changes

  • packages/backend.ai-docs-toolkit/src/asset-hasher.ts (modified)

…asher

The writeHashedAsset function in asset-hasher.ts does not validate the logicalName parameter. An attacker could provide paths like '../../../etc/passwd' to write files outside the intended assets directory.

Signed-off-by: tomaioo <203048277+tomaioo@users.noreply.github.com>
@github-actions github-actions Bot added the size:XS ~10 LoC label May 11, 2026
@cla-assistant
Copy link
Copy Markdown

cla-assistant Bot commented May 11, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS ~10 LoC

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant