Skip to content

XXE: Changes for review #9

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

Merged
merged 44 commits into from
Mar 4, 2022

Conversation

RasmusWL
Copy link

@RasmusWL RasmusWL commented Mar 3, 2022

Update for github#6112

It turned out quite long... but also involved me writing some tests for what the actual behaviors of the parsing frameworks were.

I kept up with looking at the .expected file for quite a long time, too long I would say, but rewriting the tests to NOT use these (and instead inline expectations) was probably the best decision for this rewrite. I think I did this to try and keep your work as intact as possible... but in the end I think I had to break that.

This IS quite a mouthful. I think there are interesting things for you to learn from this, but I can also understand that it could take some time for you to process this. If you have not had time to review this within 1 week, I think I will just merge your PR, and apply this commits on top, so we can get your good work closer to being part of the default query suite (unless you object to this 1 week).

RasmusWL and others added 30 commits March 2, 2022 14:24
The tests for type-trackers were not that interesting, since they did
not have XML input in both cases, which is the problem we were trying
hard to solve.

I did keep the test-case of not-user-supplied url alive as well though
:+1:

I added OK/NOT OK annotations.

Notice that we report all 4 kinds of vulnerabilities on line 93
This gives some freedom in changing the name presented, and not worrying about whether you have made a typo that makes everything break :|
This made it much easier to debug the current alerts on tests at least.

Notice that it's important that we have `strictconcat` and not just
`concat`, since `concat` will also allow flow to sinks that are not
vulnerable to any kind of XML vulnerability :|
And add annotations, see PoC.py for reference

Some of these needs fixing though
This was a rough quick-n-dirty query, and should get some qhelp as well at some point.
I was loosing my mind from looking through those .expected files

Just going to take it one file at time, to make reviewing easier
I had forgotten about this, but better late than never... also added a
small representative test
But handling this in a nice way will require some restructuring
@github-actions github-actions bot added the Python label Mar 3, 2022
@jorgectf
Copy link
Owner

jorgectf commented Mar 4, 2022

Outstanding rewrite 🤯. I've commited some qldocs' typos and made a very little polishing.

I think there are interesting things for you to learn from this

This PR is gold! I've made some notes on stuff to give a deeper look soon. Really liked the commit messages' explanations :)

Thank you! 😊

(I should have made a review instead of throwing simple comments 😳)

@jorgectf jorgectf self-assigned this Mar 4, 2022
@RasmusWL RasmusWL requested a review from jorgectf March 4, 2022 13:46
@jorgectf jorgectf merged commit 5552834 into jorgectf:jorgectf/python/deserialization Mar 4, 2022
@RasmusWL RasmusWL deleted the WIP branch March 4, 2022 16:27
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.

2 participants