Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix potential security issue with
scrape_supported_devices.py
Note: Tool is used internally by library developers to automatically generate documentation prior to a release and to warn when files are missing the required documentation. * Update Regex used to eliminate potential denial of service. - Deemed a Low severity & impact threat. - Does NOT require or necessitate a new version/release of the library. - The tool is only used after review of code/PR etc which would already be very suspicious. - The tool is not something a user would typically use or run. (i.e. Internal use only) - Very unlikely to be exploited as the tool is not typically automatically run. - Expected worse case scenario would be the Continuous Integration tests failing due to a timeout, or a Developer losing some CPU time if they didn't notice a malicious PR/commit. (It would be very very obvious) - Remediation tested using supplied Proof of Concept code. i.e. Guaranteed Sub mSecond CPU use instead of exponential CPU use. - Addressed all other regex as a precaution as well via sensible range limitations. * Documented the Regex used via `re.VERBOSE` and made easier to read/follow. * Simplified some of the Regex. Fixes #1616 Thanks to @srikanthprathi for reporting the issue & providing POC via the Huntr.Dev team. Thanks to Huntr.Dev team for bring the issue to our attention. (Kudos to @zidingz, @JamieSlome) Ref: https://huntr.dev/bounties/4da00a75-50dc-458b-acc6-cc216e1c854a/
- Loading branch information