Skip to content

Shouldn't pip fail installing modified wheel file? (checking hash against RECORD) #2752

@m1keil

Description

@m1keil

Hello,
I've noticed that unpacking wheel, making some edits in its files and zipping everything right back without updating the RECORD file, doesn't result on any warnings or errors from pip.

Reading PEP 0427 it's not clear to me if the hash records in dist-info/RECORD should always be verified or only when wheel is signed. In case it's the second option, sorry for the noise :-)

Small example just in case:

(tmpenv)wheel > curl -sLO https://pypi.python.org/packages/2.7/c/certifi/certifi-2015.04.28-py2.py3-none-any.whl

(tmpenv)wheel > unzip certifi-2015.04.28-py2.py3-none-any.whl
Archive:  certifi-2015.04.28-py2.py3-none-any.whl
  inflating: certifi/__init__.py
  ...
  ...

(tmpenv)wheel > mv certifi-2015.04.28-py2.py3-none-any.whl{,.orig}

(tmpenv)wheel > echo -e '\n#just a friendly comment' >> certifi/__init__.py
(tmpenv)wheel > cat certifi/__init__.py
from .core import where
#just a friendly comment

(tmpenv)wheel > zip -r certifi-2015.04.28-py2.py3-none-any.whl certifi certifi-2015.04.28.dist-info/
  adding: certifi/ (stored 0%)
  adding: certifi/__init__.py (stored 0%)
  ...
  ...

(tmpenv)wheel > pip install certifi-2015.04.28-py2.py3-none-any.whl
Processing ./certifi-2015.04.28-py2.py3-none-any.whl
Installing collected packages: certifi
Successfully installed certifi-2015.4.28
(tmpenv)wheel > python -m certifi
certifi/cacert.pem

(tmpenv)wheel > pip list
certifi (2015.4.28)
pip (6.1.1)
setuptools (15.0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C: wheelThe wheel format and 'pip wheel' commandauto-lockedOutdated issues that have been locked by automationtype: securityHas potential security implications

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions