An Empirical Study of Transitive Vulnerability Exposure in PyPI

dc.contributor.authorIqbal, Mohammad Jaffer
dc.date.accessioned2026-08-28T17:39:58Z
dc.date.issued2026-08-28
dc.date.submitted2026-08-24
dc.description.abstractPackages in the Python Package Index (PyPI) declare direct dependencies that may download additional packages transitively. When a package becomes vulnerable, any other package that can reach it through a transitive dependency path may also become exposed, even if the vulnerable package lies several hops away in the path. Accurately measuring this exposure is challenging. Prior work either traces paths through reachability analysis on the dependency graph (which is prone to overestimation because not every declared dependency path can be realized by the installer) or examines actual installations for only small samples, often at a single point in time. Even at the ecosystem scale, prior work resolves each release’s default installation, which can miss exposure because a package’s constraints may admit other valid installations that select vulnerable dependencies. This thesis measures transitive vulnerability exposure in PyPI packages. We adopt a possibility-based definition. A dependent-release (release of a dependent package) is exposed at a given time if its then-available requirements admit any valid installation that selects the root-version (affected release of a vulnerable package), either directly or transitively. To find exposures at ecosystem scale, we utilize pip’s dependency resolution logic over an offline reconstruction of PyPI’s historical dependency graph. For a dependent-package, we model exposure durations as windows over time, recording when each window opens, how long it remains open, and why it closes. We compare these results with those produced by the naive reachability-based approach used in prior works. Our analysis identifies 7.71 million resolution-confirmed exposure windows spanning 1,545 PYSEC advisories and 291,089 dependent packages. The results show that transitive vulnerability exposure is widespread and persistent. Among packages capable of reaching a vulnerable version, 80% become exposed at least once. Exposure is concentrated in a small set of widely used packages like urllib3, pillow, and django. The exposure duration also varies non-monotonically with dependency depth: it increases from depth 1 (direct) to depth 2 (the first transitive level), then declines at greater depths, forming an inverted-U pattern. For 84% of windows, a fixed version of the affected transitive dependency was already available when exposure began, with a median lead time of 3.8 years, yet later dependent releases continued to admit the vulnerable version. Compared with resolution-based analysis, naive graph reachability identifies 1.47× as many exposure windows and overestimates total exposure time by 43%, with the largest differences occurring in deeper dependency chains. Together, these findings provide a broad view of PyPI’s transitive vulnerability exposure, showing how exposure is distributed, how long it persists, and how strongly its measurement depends on dependency resolution.
dc.identifier.urihttps://hdl.handle.net/10012/24125
dc.language.isoen
dc.pendingfalse
dc.publisherUniversity of Waterlooen
dc.subjectsoftware engineering
dc.subjectempirical software engineering
dc.subjectPyPI
dc.subjectpip
dc.subjectdependency
dc.subjectdependency analysis
dc.subjectvulnerable dependencies
dc.titleAn Empirical Study of Transitive Vulnerability Exposure in PyPI
dc.typeMaster Thesis
uws-etd.degreeMaster of Mathematics
uws-etd.degree.departmentDavid R. Cheriton School of Computer Science
uws-etd.degree.disciplineComputer Science
uws-etd.degree.grantorUniversity of Waterlooen
uws-etd.embargo.terms1 year
uws.contributor.advisorNie, Pengyu
uws.contributor.advisorGodfrey, Michael
uws.contributor.affiliation1Faculty of Mathematics
uws.peerReviewStatusUnrevieweden
uws.published.cityWaterlooen
uws.published.countryCanadaen
uws.published.provinceOntarioen
uws.scholarLevelGraduateen
uws.typeOfResourceTexten

Files

Original bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
Iqbal_MohammadJaffer.pdf
Size:
2.08 MB
Format:
Adobe Portable Document Format

License bundle

Now showing 1 - 1 of 1
Loading...
Thumbnail Image
Name:
license.txt
Size:
6.4 KB
Format:
Item-specific license agreed upon to submission
Description: