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

Use defusedxml to avoid loading potentially dangerous xml #2709

Merged
merged 3 commits into from
Sep 17, 2023
Merged

Conversation

amolenaar
Copy link
Member

@amolenaar amolenaar commented Sep 15, 2023

PR Type

What kind of change does this PR introduce?

  • Bug fix
  • Feature
  • Chore (refactoring, formatting, local variables, other cleanup)
  • Documentation content changes

What is the new behavior?

Gaphor should be less vulnerable to maliciously crafted XML.

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

See https://cwe.mitre.org/data/definitions/611.html.

@github-actions github-actions bot added the python Pull requests that update Python code label Sep 15, 2023
@danyeaw danyeaw added chore Maintenance related PR and removed python Pull requests that update Python code labels Sep 17, 2023
@danyeaw
Copy link
Member

danyeaw commented Sep 17, 2023

Hey @amolenaar good idea to think about this. Would the attack vector that someone shares a malicious Gaphor model with others?

@amolenaar
Copy link
Member Author

amolenaar commented Sep 17, 2023

Yes, that can be a possibility.

I hooked up Gaphor with Snyk and it exposed this as a weakness. Snyk also suggested to use defusedxml.

Copy link
Member

@danyeaw danyeaw left a comment

Choose a reason for hiding this comment

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

Cool, nice one @amolenaar!

@danyeaw danyeaw merged commit 6fd8aed into main Sep 17, 2023
34 checks passed
@danyeaw danyeaw deleted the saver-xml branch September 17, 2023 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Maintenance related PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants