Skip to content

Bugfix/xss#1327

Merged
HenryHengZJ merged 6 commits intoFlowiseAI:mainfrom
vinodkiran:BUGFIX/XSS
Dec 9, 2023
Merged

Bugfix/xss#1327
HenryHengZJ merged 6 commits intoFlowiseAI:mainfrom
vinodkiran:BUGFIX/XSS

Conversation

@vinodkiran
Copy link
Contributor

No description provided.

@automaton82
Copy link
Contributor

XSS is typically solved via CSP and x-frame-options, plus CORS headers.

Wrapping every single param call with .notEmpty().escape() seems messy, and while I'm not overly familiar with node or react my gut feeling is there's a cleaner way to do this?

@vinodkiran
Copy link
Contributor Author

@automaton82 Thanks! Yes CSP and CORs can be handled in multiple ways.

This PR and Removal of localstorage PR are the first steps towards improving overall security. Additional PRs will be needed to get to the desired state.

As we traverse the path towards the desired state, we need to take baby steps to ensure that these modifications do not break backward compatibility. As you rightly pointed out, CSP/CORS would be handled differently if this was a greenfield exercise. Currently, Flowise is used by a number of users in ways that are not fully documented. While the current implementation is slightly messy, it prevents most cases of Reflected XSS. Next PRs will address DOM XSS and Storage XSS along with introducing Basic CSP (violation reporting). Further to those changes, we will then implement the final set of changes to enforce policies and lockdown the complete application.

Hope this note provides some clarity on the overall thinking towards improving security in Flowise

@HenryHengZJ
Copy link
Contributor

I love this newer approach, much cleaner, but the library strip-js is deprecated, any other alternatives?

@HenryHengZJ
Copy link
Contributor

HenryHengZJ commented Dec 7, 2023

I love this newer approach, much cleaner, but the library strip-js is deprecated, any other alternatives?

this looks like a better library and its up to date - https://github.com/apostrophecms/sanitize-html.
blog - https://www.webmound.com/sanitise-html-nodejs-express-server/

@HenryHengZJ HenryHengZJ merged commit 3eaca7c into FlowiseAI:main Dec 9, 2023
hemati pushed a commit to hemati/Flowise that referenced this pull request Dec 27, 2023
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.

3 participants