-
Notifications
You must be signed in to change notification settings - Fork 8.9k
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(editor): Prevent clipboard XSS injection #10805
fix(editor): Prevent clipboard XSS injection #10805
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, just one comment about naming the sanitize function
@@ -37,6 +37,13 @@ export function sanitizeHtml(dirtyHtml: string) { | |||
return sanitizedHtml; | |||
} | |||
|
|||
export const sanitizeInput = <T>(message: T): string | T => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe this could be named sanitizeInputIfNeeded
or sanitizeIfString
to indicate that it conditionally sanitizes the input. Also a JSDoc comment would be nice (e.g. what does sanitize mean in this case) 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomi done! let me know if you had something different in mind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! Thank you for fixing 🙇 🚀
n8n Run #6872
Run Properties:
|
Project |
n8n
|
Branch Review |
sec-119-xss-vulnerability-when-pasting-into-canvas
|
Run status |
Passed #6872
|
Run duration | 04m 37s |
Commit |
b9bb0101ff: 🌳 🖥️ browsers:node18.12.0-chrome107 🤖 r00gm 🗃️ e2e/*
|
Committer | r00gm |
View all properties for this run ↗︎ |
Test results | |
---|---|
Failures |
0
|
Flaky |
0
|
Pending |
0
|
Skipped |
0
|
Passing |
429
|
View all changes introduced in this branch ↗︎ |
✅ All Cypress E2E specs passed |
* master: refactor(core): Set up worker server (#10814) fix(Google Vertex Chat Model Node): Clean service account private key (#10770) test(core): Mock filesystem in tests (#10823) test(core): Fix license mock in worker test (#10824) ci: Ignore certain paths for e2e tests for PRs (no-changelog) (#10533) fix(editor): Render image binary-data using img tags (#10829) refactor(core): Move `instanceType` to `InstanceSettings` (no-changelog) (#10640) ci(benchmark): Always perform az login before teardown (#10827) fix: Prevent copying workflow when copying outside of canvas (#10813) fix: Fix telemetry causing console error (#10828) refactor: Remove unused disable directives from `nodes-base` (#10825) refactor(core): Remove unused disable directives from backend packages (#10826) chore: Upgrade to TypeScript 5.6 (#10822) fix(editor): Prevent clipboard XSS injection (#10805) refactor(core): Simplify createDeferredPromise, and add tests (no-changelog) (#10811) fix(HTTP Request Tool Node): Fix subsequent tool calls reusung the same options (#10808) fix(editor): Make expression edit modal read-only in executions view (#10806) refactor(core): Move push message types to a new shared package (no-changelog) (#10742) fix(editor): Make schema view search copy more clear (#10807)
Got released with |
Summary
Related Linear tickets, Github issues, and Community forum posts
https://linear.app/n8n/issue/SEC-119/xss-vulnerability-when-pasting-into-canvas
Review / Merge checklist
release/backport
(if the PR is an urgent fix that needs to be backported)