GithubHelp home page GithubHelp logo

jayvdb / veripypi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from alichtman/veripypi

0.0 2.0 0.0 8 KB

WIP: Verify the package installed from PyPi is the same as the code on Github

License: MIT License

Python 100.00%

veripypi's Introduction

Veripypi

Ensure the package you're installing from PyPi is the same as the source code advertised on GitHub.

Installation and Usage

$ pip3 install veripypi
$ veripypi <PACKAGE_NAME>

Motivation

Open-sourced repositories provide a false sense of security. Since the code is readable, other developers must have read and audited it, right? Someone would surely say something if there were really an issue...

(See the Bystander Effect.)

But, even when the source code has been thoroughly audited, it's trivial to showcase a clean version of the project on GitHub and a distribute a trojaned package on PyPi.

This is a PoC to minimize this attack vector. (Although the real solution to this problem is probably more along the lines of enforcing PGP signed releases, but there's a whole lot of controversy surrounding this that I won't delve into here.)

How it works

First, a source distribution is created from the latest release of a GitHub repository of the package to be verified. This sdist is used as "ground truth." Then, the PyPi version of the package is installed. Both versions are compared, and if they're not identical, a flag is raised.

Interpreting Results

A green flag from veripypi only tells you that the source code being distributed matches the source code that can be viewed on GitHub. It does not imply anything about the safety of the code being installed.

Similarly, a red flag does not necessarily mean that the package is trojaned. One simple explanation for a rejection from this tool is a maintainer pushing an updated release to PyPi and forgetting to push to GitHub.

veripypi's People

Contributors

alichtman avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.