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

CPE: use safe_load, update CPEs #296

Merged
merged 4 commits into from
Oct 28, 2020

Conversation

tsellers-r7
Copy link
Contributor

@tsellers-r7 tsellers-r7 commented Oct 27, 2020

Description

This PR changes update_cpes.py so that it uses yaml.safe_load() instead of yaml.load(). This should reduce the risk when loading YAML. I've also run it against our fingerprint databases using the latest data from NIST.

I've also added a .snyk file in order to suppress the Synk warning on PyYAML. We don't currently use a vulnerable code path, Snyk doesn't check to see if you are using the vulnerable code path, and there is no full library level fix for this other than to use safe_load() (which this PR does) or the SafeLoader loader.

https://app.snyk.io/vuln/SNYK-PYTHON-PYYAML-590151

Motivation and Context

Risk reduction

How Has This Been Tested?

rspec, Github PR hooks

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have updated the documentation accordingly (or changes are not required).
  • I have added tests to cover my changes (or new tests are not required).
  • All new and existing tests passed.

@@ -32,7 +33,8 @@
<example chromecast.generation="11" chromecast.capabilities="Video Assist">CN=Chromecast ICA 11 (Video Assist),OU=Cast,O=Google Inc,L=Mountain View,ST=California,C=US</example>
<example chromecast.generation="12">CN=Chromecast ICA 12,OU=Cast,O=Google Inc,L=Mountain View,ST=California,C=US</example>
<param pos="0" name="os.vendor" value="Google"/>
<param pos="0" name="os.product" value="ChromeOS"/>
<param pos="0" name="os.product" value="Chrome OS"/>
Copy link
Contributor Author

@tsellers-r7 tsellers-r7 Oct 27, 2020

Choose a reason for hiding this comment

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

Note: this change aligns the name with the Google usage of the term (space vs no space) and allows the NIST CPE mapping to automatically match. If this causes issues I can handle it with a remapping instead.

CC @hdm

@tsellers-r7 tsellers-r7 mentioned this pull request Oct 27, 2020
@tsellers-r7 tsellers-r7 merged commit 5e2d7bc into rapid7:master Oct 28, 2020
@tsellers-r7 tsellers-r7 deleted the YAML_safe_load branch October 28, 2020 13:04
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.

2 participants