Skip to content

fix: sanitize lora paths to prevent directory traversal#1

Merged
mostlygeek merged 1 commit intomasterfrom
claude/fix-lora-path-security-mmdfp
Mar 15, 2026
Merged

fix: sanitize lora paths to prevent directory traversal#1
mostlygeek merged 1 commit intomasterfrom
claude/fix-lora-path-security-mmdfp

Conversation

@mostlygeek
Copy link
Copy Markdown
Owner

Reject absolute paths in user-supplied lora references and validate
that resolved relative paths stay within lora_model_dir using
fs::canonical(). This prevents path traversal attacks like
lora:../../etc/passwd:1 or lora:/etc/shadow:1 from reading
arbitrary files on the host.

https://claude.ai/code/session_01RnNL2d3tAHW4pNuBDu3wi8

Reject absolute paths in user-supplied lora references and validate
that resolved relative paths stay within lora_model_dir using
fs::canonical(). This prevents path traversal attacks like
<lora:../../etc/passwd:1> or <lora:/etc/shadow:1> from reading
arbitrary files on the host.

https://claude.ai/code/session_01RnNL2d3tAHW4pNuBDu3wi8
@mostlygeek mostlygeek merged commit a63c5c3 into master Mar 15, 2026
@mostlygeek mostlygeek deleted the claude/fix-lora-path-security-mmdfp branch March 15, 2026 05:06
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.

2 participants