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

OPENCMS-1019: XSS vulnerability testing flagged a parameter in clipboard admin #66

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

adam-murray
Copy link
Contributor

Added test to ensure response from clipboard admin does not pass on scripts within parameters

@adam-murray
Copy link
Contributor Author

https://jiraagile.bip.uk.fid-intl.com/browse/OPENCMS-1019

Djangocms versioning filer clipboard admin was flagged by security. I have added a test to prove the response mentioned (monkeypatch/admin/clipboardadmin.py line 195) does not contain a script passed to the method.

with self.login_user_context(self.superuser):
response = self.client.post(
reverse('admin:filer-ajax_upload', kwargs={'folder_id': self.folder.id}),
data={'file': file, 'script': '<script>alert("Attack!")</script>'},
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that this test is doing anything, I don't think that this endpoint ever looks for "data". I don't think that the response would have the word alert in it anywhere too. The issue is that path is brought in un sanitised and then used later: https://github.com/divio/djangocms-versioning-filer/blob/master/djangocms_versioning_filer/monkeypatch/admin/clipboardadmin.py#L30

data={'path': '<script>alert("attack!")</script>'}
)

self.assertFalse('<script>alert("attack!")</script>' in response.request.values())
Copy link
Contributor

Choose a reason for hiding this comment

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

What's actually in response.request.values()? Does it have the values url encoded?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Request here is a dictionary representation of what was in the request. It strips that value and passes on the valid path value to the file being used.

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