release-drift
release-drift compares two releases of a package, and a release with the git tag it was built from, before you install it. It reports which files changed, which new code runs at install or interpreter start-up, and which files of the release are not in the project's tagged source.
Recent supply-chain attacks used these places: a .pth file in a PyPI wheel that Python runs at
every start, an npm release published from a stolen account instead of the project's CI, and
npm preinstall scripts. A new .pth file or install script is a record in release-drift's
output, and so is a file in a release that is not in the project's tag.
release-drift only reports. It does not decide whether a package is malicious, and it does not block or quarantine anything; what to do with a record is up to you, for example a required check in CI. There is no AI and no scoring: the same inputs always give byte-identical output.
Requirements
- Python 3.9 or later, standard library only.
- git, for
release-drift source. - No platform-specific code; tested on macOS.
- Network access only for the optional
fetchcommand.
Install
From a clone:
git clone https://github.com/jacob-adm/release-drift
cd release-drift
pip install .
pip installs release-drift as a console script. Without installing, it runs from a clone as
python3 -m release_drift.
How it works
- Get the artifacts. Download the wheel, sdist or npm tarball of each version, or let
release-drift fetchdownload them from PyPI or npm and check them against the registry's digests. - Read them without unpacking. Each artifact is read into memory. Absolute paths,
.., links leading outside the archive, device files and oversized members are refused; nothing from the artifact is written to disk and nothing is run. - Find the execution surfaces.
.pthfiles,sitecustomize.py,setup.pyand build backends, npmpreinstall,install,postinstallandpreparescripts,.pycfiles without source, native binaries (ELF, Mach-O, PE, WebAssembly) and links; also URL hosts and long base64 or hex strings. - Compare.
difflists the files added, removed or changed between two releases, and the surfaces, hosts and strings that are new.sourcelists the files of a release that are not, as they are, in git at a tag, apart from a documented list of files packaging tools generate. - Act on the result. release-drift exits 1 when it finds something, 0 when it finds nothing
and 2 on an error, like
grep. A finding is a new or changed execution surface, a new URL host or encoded string, or, forsource, a file not in the tag. Files that merely changed between two releases are listed but are not findings.
Commands
release-drift diff OLD NEW [--json] compare two artifacts
release-drift source ARTIFACT --repo DIR --ref REF files not in git at REF
[--prefix PATH] [--json]
release-drift fetch {pypi,npm} NAME VERSION DIR download one version; no install
[--type {sdist,wheel,all}]
Output is one TAB-separated record per line: CATEGORY, STATUS, PATH, DETAIL, sorted.
--json prints a JSON array instead. fetch downloads only the sdist from PyPI unless --type
says otherwise.
Quick start
Compare two releases of six:
mkdir old new
release-drift fetch pypi six 1.16.0 old
release-drift fetch pypi six 1.17.0 new
release-drift diff old/six-1.16.0.tar.gz new/six-1.17.0.tar.gz
echo $?
build changed setup.py setup.py
file changed CHANGES -
file changed LICENSE -
file changed PKG-INFO -
file changed README.rst -
file changed documentation/conf.py -
file changed documentation/index.rst -
file changed setup.cfg -
file changed setup.py -
file changed six.egg-info/PKG-INFO -
file changed six.py -
file changed test_six.py -
1
fetch downloads the sdist and prints the path it saves. In the diff, no file was added and no new
start-up hook, install script, binary or URL host appeared. The exit status is 1 because
setup.py, which runs when the sdist is built, changed: build changed setup.py is a finding.
The file changed records are listed but are not findings; the two wheels of the same versions,
in which no build script runs, give exit 0. Then check the release against its tag:
git clone https://github.com/benjaminp/six
release-drift source new/six-1.17.0.tar.gz --repo six --ref 1.17.0
echo $?
0
Every file of the sdist is in the tag 1.17.0, apart from the files setuptools generates.
Documentation
- Commands: each command's input, records, options and exit status.
- Source comparison: which generated files
sourceaccepts, and why. - Limitations and security: what release-drift reads, refuses and does not detect.
- Using it with other tools: tested stacks for releases and dependency bumps, and GuardDog and Socket, and what release-drift adds.
- Contributing: running the tests and contributing a change.
- Reporting a vulnerability
License
Apache License 2.0; see LICENSE.
Metadata
Release files for release-drift 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| release_drift-0.1.0.tar.gz | 28.1 kB | With provenance | Details for release_drift-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| release_drift-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for release_drift-0.1.0-py3-none-any.whl |
Total release size: 49.2 kB
Release files / release_drift-0.1.0.tar.gz
| Download URL | release_drift-0.1.0.tar.gz |
|---|---|
| Size | 28.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
21e6e237ebc0d0ca1980f8ebdd24f18859e5d1f403f148b02f5bab82c6faa47b
|
|
BLAKE2b-256 checksum How to use checksums |
401f0574af2ff2876c6619a750d24be1740b01d596c3c2928f3c640d441b47fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logRelease files / release_drift-0.1.0-py3-none-any.whl
| Download URL | release_drift-0.1.0-py3-none-any.whl |
|---|---|
| Size | 21.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
420b0262c66130c75901e1870f6833196241810dbdd9f32e0b438762439cfe2d
|
|
BLAKE2b-256 checksum How to use checksums |
5c82128a0ced47803cac46a3eef09e8954565a9d0d8c1ba35332745c8f3eae39
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logSecurity for release-drift 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for release_drift-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 19, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.