REDHAT-BUG-2584205: Pypi/pulp-python vulnerability
PythonRemote.getremoteartifacturl() in pulppython/app/models.py returns the request's redirect query parameter as the download URL. It does not compare that value with the remote's URL or with the URL the upstream simple page listed for the file.
pullthroughpackagesimple() in pulppython/app/pypi/views.py builds the simple-page link as <filename>?redirect=<upstream file URL>. Handler.matchandstream() in pulpcore/content/handler.py calls getremoteartifacturl() when the distribution has a remote and the relative path is not already stored. It builds a RemoteArtifact with that URL and no digest, then downloads it through Remote.getdownloader(). DownloaderFactory.httporhttps() sets aiohttp basic auth from the remote's username and password whenever the username is set, and HttpDownloader passes that auth on the GET to the URL it was given.
The response body is written to the client. The remote policy field defaults to immediate. For immediate and ondemand, the content type for a package file is PythonPackageContent, saveartifact() stores the file, and PythonRepository.asyncpullthroughaddcontent() adds it to the repository. PythonPackageContent.initfromartifactandrelativepath() takes the filename from the request path and the project name and version from the file's metadata. The package simple page builds its listing from the remote and then applies the repository's files with releases.update(localreleases), so a stored filename is the one later clients see. A streamed policy skips the save. The download, the returned body, and the basic-auth header still happen. A relative path that is already in the repository is served from the stored artifact.
An anonymous client can read the response of a URL it chooses, from the content app's network position. When the remote has a username and password, those credentials are sent to the host in that URL. From pulppython 3.14.0 onward the saved file is part of the repository and is served to later clients of the distribution.
The caller needs no Pulp account. Distribution.contentguard is null by default, and Handler.permit() allows the request when no guard is set. The distribution must have a remote. That is the pull-through configuration. No extra plugin is required.
The redirect return was introduced by Gerrod Ubben in commit 81b613388069487d50f9db19c5e3a3675c9d7bc7, committed 2021-11-30. pulppython 3.6.0, released 2021-12-15, is the first release that contains it. Saving pull-through content into the repository was added in commit df8b5ad22dbac8537d427975815e05b4894ed492 on 2025-04-02, released in pulppython 3.14.0 on 2025-04-10.
The same function appends .metadata to the client-supplied URL when the requested path ends in .metadata. Remote.getremoteartifacturl() joins the configured remote URL and the relative path.
Affected Software
Event History
Frequently Asked Questions
Who is exposed to credential leakage through this behavior?
Pulp Python distributions that have a remote configured with a username and password are exposed when a requested package file is not already stored locally. The downloader applies the remote's basic-auth credentials to the URL supplied through the redirect parameter.
What does an attacker need to do to trigger the issue?
The attacker needs to cause a request for a package file through a distribution with a configured remote, where the requested relative path is not already stored. The redirect query parameter can supply the download URL without being checked against the remote URL or the upstream simple-page file URL.
Are default remote settings affected?
The remote policy defaults to immediate. Both immediate and on_demand policies download the package file and can store it as PythonPackageContent, so either policy is affected under the described conditions.
How can administrators identify potentially affected activity?
Review requests for package-file paths that were not already stored locally and contained a redirect query parameter. In affected flows, the supplied redirect URL is used to create a RemoteArtifact without a digest and is fetched by the configured remote downloader.