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

Add request parameters as sources for DOM-based XSS check #286

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

Conversation

faf0-addepar
Copy link
Contributor

@faf0-addepar faf0-addepar commented Dec 31, 2019

What does it implement/fix? Explain your changes.

Currently, the DOM-based XSS checker doesn't consider request parameters
as an input source.
This change allows the DOM-based XSS checker to detect code injected via
request parameters.

Where has this been tested?

Python Version: 3.7.5
Operating System: macOS

Does this close any currently open issues?

No

Does this add any new dependency?

No

Does this add any new command line switch/option?

No

Any other comments you would like to make?

#285 should be merged first, as this change relies on it.

Some Questions

  • I have documented my code.
  • I have tested my build before submitting the pull request.

The DOM scanner colors sources and sinks in script lines.  Moreover,
that scanner collects all colored lines:
https://github.com/s0md3v/XSStrike/blob/0ecedc1bba149931e3b32e53422d5b7c089ba9dc/core/dom.py#L50

As coloring is disabled on Windows, macOS, and iOS, no potentially
tainted lines will be collected on these platforms:
https://github.com/s0md3v/XSStrike/blob/0ecedc1bba149931e3b32e53422d5b7c089ba9dc/core/colors.py#L8-L9
Consequently, the report of potential DOM vulnerabilities is always
empty.

This change fixes this bug by surrounding sources and sinks with `*`
characters.

Also, this change removes unused colors imports.
Currently, the DOM-based XSS checker doesn't consider request parameters
as an input source.
This change allows the DOM-based XSS checker to detect code injected via
request parameters.
@faf0-addepar faf0-addepar changed the title Faf0/params as sources Add request parameters as sources for DOM-based XSS check Dec 31, 2019
@faf0-addepar
Copy link
Contributor Author

@s0md3v please review when you have a moment

@ItsIgnacioPortal
Copy link

Since @s0md3v seems to have abandoned this project, I've gone ahead and took the liberty to make a fork: XSStrike-Reborn
Your pull request has been merged into that project. Your efforts are appreciated 😁

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.

None yet

2 participants