Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): Prevent XSS via static cache dir #10339

Merged
merged 3 commits into from
Aug 9, 2024

Conversation

ivov
Copy link
Contributor

@ivov ivov commented Aug 9, 2024

@n8n-assistant n8n-assistant bot added core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team labels Aug 9, 2024
const { n8nFolder } = Container.get(InstanceSettings);
const restrictedPaths = [n8nFolder];
const { n8nFolder, staticCacheDir } = Container.get(InstanceSettings);
const restrictedPaths = [n8nFolder, staticCacheDir];
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to have a test for this?


### What changed?

The `N8N_RESTRICT_FILE_ACCESS_TO` environment variable now also blocks access to n8n's static cache directory at `~/.cache/n8n/public`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't this be N8N_BLOCK_FILE_ACCESS_TO_N8N_FILES?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch!

@ivov ivov requested a review from tomi August 9, 2024 12:54
Copy link
Contributor

@tomi tomi left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

Copy link

cypress bot commented Aug 9, 2024



Test summary

395 0 0 0Flakiness 1


Run details

Project n8n
Status Passed
Commit 785a313
Started Aug 9, 2024 2:17 PM
Ended Aug 9, 2024 2:21 PM
Duration 04:44 💡
OS Linux Debian -
Browser Electron 118

View run in Cypress Cloud ➡️


Flakiness

e2e/30-editor-after-route-changes.cy.ts Flakiness
1 Editor actions should work > after switching between Editor and Executions

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Cloud

Copy link
Contributor

github-actions bot commented Aug 9, 2024

✅ All Cypress E2E specs passed

@ivov ivov merged commit 4f392b5 into master Aug 9, 2024
30 checks passed
@ivov ivov deleted the sec-61-241-persistent-cross-site-scripting branch August 9, 2024 14:40
MiloradFilipovic added a commit that referenced this pull request Aug 9, 2024
* master:
  fix(core): Prevent XSS via static cache dir (#10339)
  fix(editor): Enable credential sharing between all types of projects (#10233)
  refactor(core): Extract webhook request handler to own file (#10301)
  feat: Allow sharing to and from team projects (no-changelog) (#10144)
  refactor(editor): Convert ChangePasswordModal to composition api (no-changelog) (#10337)
  docs: Change display name for WhatsApp Trigger API Credential (#10334)
  fix(core): Do not load ScalingService in regular mode (no-changelog) (#10333)
  docs: Update wording in X credentials (#10327)
  fix(editor): Fixing XSS vulnerability in toast messages (#10329)
  fix(core): Rate limit MFA activation and verification endpoints (#10330)
  refactor(core): Decouple emailing and workflow sharing from internal hooks (no-changelog) (#10326)
  refactor(core): Stop reporting disk I/O error to Sentry (no-changelog) (#10324)
@github-actions github-actions bot mentioned this pull request Aug 14, 2024
@janober
Copy link
Member

janober commented Aug 15, 2024

Got released with [email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Enhancement outside /nodes-base and /editor-ui n8n team Authored by the n8n team Released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants