Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ There is no bug bounty. But one maintainer has bought people a drink before, fo
- PyShp is a pure-Python library that typically gets called from other Python code. Attackers with the ability to run Python code on a target in the first place, can already peform any function Python allows them to. As long as PyShp was not the means by which the Attacker gained the ability to run arbitrary Python code, PyShp cannot prevent this.
- `eval`, `compile` and `exec` etc. are not used, and should be considered to be banned.
- The vulnerabilities we fail to consider are even more important than those we are aware of. That said, by its very nature, PyShp does read arbitrary binary data. An attack via a maliciously crafted shapefile is possible. To mitigate this, PyShp -should- only convert arbitrary binary data into specific Python types (floats, ints, strings, booleans, dates, lists, arrays, tuples and dicts). These do contain arbitrary data, but they should never result in arbitrary code execution (or even in Python raising a non-standard system-affecting Exception or crash).
- Lun (@lunuyennhi-dev) pointed out PyShp could hang if a negative .shp shape record length was encountered (more checks are now applied to these, from v3.1.7). A basic review for similar bugs has been carried out. The declared file lengths are now checked for all the constituent files. If `strict=True`, .dbf record lengths are required to match the declared field sizes. Shaperecords are already temporarily read into memory in their entirety (to minimise seeks on disk) and the numPoints field is used to form a struct fmt string used to unpack that, not for runtime control flow. Bug reports for any similar issues are more than welcome.
- We therefore consider the overall security risk from using PyShp to be low. If you think otherwise, please contact a maintainer.
Loading