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

Escape whole app state, as keys are also vulnerable to XSS injection #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tabazevedo
Copy link

Title self-explanatory

@tabazevedo tabazevedo changed the title Stringify whole app state, as keys are also vulnerable to XSS injection Escape whole app state, as keys are also vulnerable to XSS injection Sep 10, 2015
escape-filter = (k, v) -> if typeof v === 'string' then return exports.escape-state v else return v

exports.stringify-state = -> JSON.stringify it, escape-filter
exports.stringify-state = -> it |> JSON.stringify |> xss-filters.inHTMLData
Copy link
Member

Choose a reason for hiding this comment

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

Am I reading it right that this is exports. just for tests? Can we not move that function, and possibly even the pipeline in application.ls (wrapped in a function) to it's own module? Something like src/state-serialisation.ls or similar.

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