Skip to content

Escape conferences user input#6641

Merged
ivan-mr merged 1 commit intodecidim:developfrom
codegram:fix/escape-conference-user-input
Oct 9, 2020
Merged

Escape conferences user input#6641
ivan-mr merged 1 commit intodecidim:developfrom
codegram:fix/escape-conference-user-input

Conversation

@josepjaume
Copy link
Copy Markdown
Contributor

🎩 What? Why?

This escapes some user input fields on the conferences module that weren't properly escaped.

Note: As it turns out, cells are not escaped by default. Maybe we should consider adding the Escaped module sometime.

📌 Related Issues

None

Testing

Add "><h1><font color=red>XSS_Conference_title</font></h1><img src=x onerror=alert(1)> as an user input on a conference, and check out a related activity on your profile. You should see the title escaped.

📋 Checklist

🚨 Please review the guidelines for contributing to this repository.

  • CONSIDER adding a unit test if your PR resolves an issue.
  • ✔️ DO check open PR's to avoid duplicates.
  • ✔️ DO keep pull requests small so they can be easily reviewed.
  • ✔️ DO build locally before pushing.
  • ✔️ DO make sure tests pass.
  • ✔️ DO make sure any new changes are documented in docs/.
  • ✔️ DO add and modify seeds if necessary.
  • ✔️ DO add CHANGELOG upgrade notes if required.
  • ✔️ DO add to GraphQL API if there are new public fields.
  • ✔️ DO add link to MetaDecidim if it's a new feature.
  • AVOID breaking the continuous integration build.
  • AVOID making significant changes to the overall architecture.

📷 Screenshots

None

@andreslucena
Copy link
Copy Markdown
Member

Hi @josepjaume, glad to see you again here :D

As far as I'm aware when you say "user" you're referring to Administrators, right?

Maybe we should consider adding the Escaped module sometime.

That'd be great!

On the other hand, we prefer to be not so transparent on explaining publicly how to exploit current unsolved vulnerabilities. We have a Security Policy for these cases.

Thanks for the PR!

@andreslucena
Copy link
Copy Markdown
Member

I can confirm the exploit and the fix locally.

mrcasals
mrcasals previously approved these changes Oct 8, 2020
@ivan-mr
Copy link
Copy Markdown
Contributor

ivan-mr commented Oct 8, 2020

Oh!, that's a great solution to fix this issue. But can you create some test for the modified view and cell, please?
Thanks in advance @josepjaume

Copy link
Copy Markdown
Contributor

@ivan-mr ivan-mr left a comment

Choose a reason for hiding this comment

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

Now I see all checks have passed. Thanks @josepjaume and good job!

@ivan-mr ivan-mr merged commit bef9a35 into decidim:develop Oct 9, 2020
@josepjaume
Copy link
Copy Markdown
Contributor Author

Thanks @ivan-mr! I was about to write the tests for this, but they looked a bit too specific to me. Maybe we should find a way to ensure things get properly escaped in all cells?

@mrcasals mrcasals added module: conferences type: fix PRs that implement a fix for a bug labels Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants