Skip to content

fix: remove unsafe exec() in +server.ts#2113

Open
orbisai0security wants to merge 1 commit into
danielmiessler:mainfrom
orbisai0security:fix-path-traversal-notes-endpoint
Open

fix: remove unsafe exec() in +server.ts#2113
orbisai0security wants to merge 1 commit into
danielmiessler:mainfrom
orbisai0security:fix-path-traversal-notes-endpoint

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

Summary

Fix high severity security issue in web/src/routes/notes/+server.ts.

Vulnerability

Field Value
ID V-001
Severity HIGH
Scanner multi_agent_ai
Rule V-001
File web/src/routes/notes/+server.ts:11
CWE CWE-22

Description: The notes endpoint extracts a 'filename' field directly from the JSON request body without any path sanitization or validation. The raw filename value is used to construct a file system path for writing note content to disk. An attacker can supply path traversal sequences such as '../../etc/cron.d/malicious' or '../config/api_keys.json' to write arbitrary files outside the intended notes directory, potentially achieving remote code execution or overwriting sensitive configuration files.

Changes

  • web/src/routes/notes/+server.ts

Verification

  • Build passes
  • Scanner re-scan confirms fix
  • LLM code review passed

Automated security fix by OrbisAI Security

Automated security fix generated by Orbis Security AI
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.

1 participant