Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Issue with your package from pypi.org #28

Open
rakovskij-stanislav opened this issue Aug 8, 2022 · 0 comments
Open

Security Issue with your package from pypi.org #28

rakovskij-stanislav opened this issue Aug 8, 2022 · 0 comments

Comments

@rakovskij-stanislav
Copy link

rakovskij-stanislav commented Aug 8, 2022

Hello! Found a security issue in your package in pypi:
https://pypi.org/project/curlify/

Affected versions of package:

  • 2.2.0 (Jul 21, 2019)

There's an unmet dependency on module shlex if you will try to install these versions of curlify:

>python -m pip install --upgrade curlify==2.2.0
Collecting curlify==2.2.0
  Downloading curlify-2.2.0.tar.gz (3.0 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: requests in python\python310\lib\site-packages (from curlify==2.2.0) (2.28.0)
ERROR: Could not find a version that satisfies the requirement shlex>="3" (from curlify) (from versions: none)
ERROR: No matching distribution found for shlex>="3"

It happens because there is missed requirement in setup.py file:

...
setup(
    name='curlify',
    version='2.2.0',
    py_modules=[
        'curlify',
    ],
    include_package_data=True,
    install_requires=[
        'requests',
        'shlex >= "3"',
        'pipes < "3"',
    ],
    license='MIT License',
...

It's dangerous because the intruder can create malicious package shlex on pypi and:

  • Make online guides how to use your package and abuse this malicious supply chain attack to compromise users
  • Infect automated CI/CD pipelines that uses old version of your package
  • Infect other users by hardcoding those versions of package in opensource projects that use it

It's dangerous because usage of curlify, even a bit outdated (it's the second fresh release before 2.2.1 on pypi), is not something strange. Everyone likes hardcoded versions of packages, even in the era of protestware.

The best solution is to delete exact version of package from pypi. Better to break dependencies in some old pipelines than compromise them. You can also make a post-release of this version.

Also suggest you to set security email address for reporting this type of vulnerabilities: https://github.com/ofw/curlify/security/policy

Rakovsky Stanislav (Positive Technologies)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant