Skip to content

feat(security): restrict file attachments to attachments directory - #87

Merged
dwickr merged 1 commit into
masterfrom
fix-attachments-check
Feb 20, 2026
Merged

dwickr merged 1 commit into
masterfrom
fix-attachments-check

Conversation

@dwickr

@dwickr dwickr commented Feb 10, 2026

Copy link
Copy Markdown
Contributor
  • Add path validation to prevent directory traversal attacks
  • Create attachments directory on startup
  • Add tests for valid and invalid attachment paths
  • Refactor to use centralized userAttachmentsDir constant

- Add path validation to prevent directory traversal attacks
- Create attachments directory on startup
- Add tests for valid and invalid attachment paths
- Refactor to use centralized userAttachmentsDir constant
Comment thread web_interface.js
}

bot.setAdminOnly(false)
fs.mkdirSync(userAttachmentsDir, { recursive: true })

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were previously doing this on every file upload, I moved it here to only run at startup.

@dwickr
dwickr merged commit d273d54 into master Feb 20, 2026
6 checks passed
@dwickr
dwickr deleted the fix-attachments-check branch February 20, 2026 19:04
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