# GHSA-r82c-j4mq-5xfw: Update bitlyshortener to >=0.5.0 to prevent generating some invalid short URLs

> An upstream API change causes the library to generate invalid short URLs when vanity domains are used, requiring an upgrade to fix.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 27 Oct 2020

## What is GHSA-r82c-j4mq-5xfw?

GHSA-r82c-j4mq-5xfw is a vulnerability in bitlyshortener, published on 27 Oct 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Impact
Due to a sudden upstream breaking change by Bitly, versions of `bitlyshortener` <0.5.0 can generate an invalid short URL when a vanity domain exists.

### Patches
Upgrading `bitlyshortener` to 0.5.0 or newer will prevent the generation of any such invalid short URLs.

### References
* [Release notes](https://github.com/impredicative/bitlyshortener/releases)

## Which versions are affected by GHSA-r82c-j4mq-5xfw?

2 open source packages ship an affected version, including bitlyshortener.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `bitlyshortener` | PyPI | All versions | 0.5.0 |
| `bitlyshortener` | PyPI | All versions | 0.5.0 |

## How do I fix GHSA-r82c-j4mq-5xfw?

Upgrade bitlyshortener to 0.5.0 or later.

## Is GHSA-r82c-j4mq-5xfw being exploited?

There is no known exploitation of GHSA-r82c-j4mq-5xfw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-r82c-j4mq-5xfw and fix it if it is affected.

What it is: GHSA-r82c-j4mq-5xfw is a vulnerability in bitlyshortener, published on 27 Oct 2020. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-r82c-j4mq-5xfw in the wild and no public exploit code.

Affected packages and fixed versions:
- bitlyshortener (PyPI): affected all versions; fixed in 0.5.0
- bitlyshortener (PyPI): affected all versions; fixed in 0.5.0

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-r82c-j4mq-5xfw/ (Markdown: https://insights.sbomify.com/GHSA-r82c-j4mq-5xfw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-r82c-j4mq-5xfw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-r82c-j4mq-5xfw/
Summaries are generated and may contain mistakes; the official description above is the record.
