# GHSA-rcrv-228c-gprj: Invalid URL generation in bitlyshortener

> The library generates invalid URLs due to upstream changes, requiring an upgrade to restore functionality.

- **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:** 21 Jan 2022

## What is GHSA-rcrv-228c-gprj?

GHSA-rcrv-228c-gprj is a vulnerability in bitlyshortener, published on 21 Jan 2022. 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.6.0 generate invalid short URLs. All users are affected and must update immediately.

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

### Workarounds
A workaround is to replace "https://j.mp/" in each generated short URL with "https://bit.ly/".

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

## Which versions are affected by GHSA-rcrv-228c-gprj?

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


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

## How do I fix GHSA-rcrv-228c-gprj?

Upgrade bitlyshortener to 0.6.0 or later.

## Is GHSA-rcrv-228c-gprj being exploited?

There is no known exploitation of GHSA-rcrv-228c-gprj in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-rcrv-228c-gprj and fix it if it is affected.

What it is: GHSA-rcrv-228c-gprj is a vulnerability in bitlyshortener, published on 21 Jan 2022. 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-rcrv-228c-gprj in the wild and no public exploit code.

Affected packages and fixed versions:
- bitlyshortener (PyPI): affected all versions; fixed in 0.6.0
- bitlyshortener (PyPI): affected all versions; fixed in 0.6.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-rcrv-228c-gprj/ (Markdown: https://insights.sbomify.com/GHSA-rcrv-228c-gprj/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-rcrv-228c-gprj

---
From sbomify Insights: https://insights.sbomify.com/GHSA-rcrv-228c-gprj/
Summaries are generated and may contain mistakes; the official description above is the record.
