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

Close XXE vulnerability in ERRest's XML parser #937

Merged
merged 1 commit into from
Dec 21, 2020
Merged

Close XXE vulnerability in ERRest's XML parser #937

merged 1 commit into from
Dec 21, 2020

Conversation

hugithordarson
Copy link
Contributor

@hugithordarson hugithordarson commented Dec 9, 2020

As per discussions about the vulnerability on the WOCommunity slack channel on 2020-12-03. Fixes reflect OWASP recommendation from here: https://cheatsheetseries.owasp.org/cheatsheets/XML_External_Entity_Prevention_Cheat_Sheet.html

@paulhoadley paulhoadley self-requested a review December 10, 2020 22:02
@paulhoadley
Copy link
Contributor

This change appears to conform completely with the advice in the OWASP XML External Entity Prevention Cheat Sheet relating to the matter.

Copy link
Contributor

@paulhoadley paulhoadley left a comment

Choose a reason for hiding this comment

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

This appears to be a complete implementation of the OWASP advice.

Copy link
Contributor

@hprange hprange left a comment

Choose a reason for hiding this comment

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

I did a quick test using one of our apps. That's the response for a request using the XXE attack before applying this patch:

<?xml version="1.0" encoding="UTF-8"?>
<String>Failed to parse a [ERXRestFormat: xml] request. Failed to parse request document. /etc/passwd (Permission denied).</String>

The app tried to access the file system.

And the response to the same request after applying this patch:

<?xml version="1.0" encoding="UTF-8"?>
<String>Failed to parse a [ERXRestFormat: xml] request. Failed to parse request document. DOCTYPE is disallowed when the feature &quot;http://apache.org/xml/features/disallow-doctype-decl&quot; set to true.</String>

It looks good to me.

@hprange hprange merged commit 33cc626 into wocommunity:master Dec 21, 2020
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