# GHSA-g4m4-9q4c-mfw6: Fiona affected by CVE-2020-14152 related to madler-zlib

> A denial of service vulnerability in libjpeg, a transitive dependency of Fiona, may cause excessive memory consumption when processing malformed PROJ grid files.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 16 Jul 2024

## What is GHSA-g4m4-9q4c-mfw6?

GHSA-g4m4-9q4c-mfw6 is a denial of service vulnerability in fiona, published on 16 Jul 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

### Summary
Vulnerability scan of fiona shows [CVE-2020-14152](https://nvd.nist.gov/vuln/detail/CVE-2020-14152). The vulnerability is in libjpeg, a transitive dependency of fiona (via GDAL and PROJ).

### Details
In IJG JPEG (aka libjpeg) before 9d, jpeg_mem_available() in jmemnobs.c in djpeg does not honor the max_memory_to_use setting, possibly causing excessive memory consumption.

### Impact
fiona will not open JPEG files and is not vulnerable to attack in that way. fiona might be vulnerable to malformed PROJ grid files using JPEG compression. No such vulnerability or compromise has been demonstrated.

## Which versions are affected by GHSA-g4m4-9q4c-mfw6?

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


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `fiona` | PyPI | All versions | 1.10b2 |
| `fiona` | PyPI | All versions | 1.10b2 |

## How do I fix GHSA-g4m4-9q4c-mfw6?

Upgrade fiona to 1.10b2 or later.

## Is GHSA-g4m4-9q4c-mfw6 being exploited?

There is no known exploitation of GHSA-g4m4-9q4c-mfw6 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g4m4-9q4c-mfw6 and fix it if it is affected.

What it is: GHSA-g4m4-9q4c-mfw6 is a denial of service vulnerability in fiona, published on 16 Jul 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-g4m4-9q4c-mfw6 in the wild and no public exploit code.

Affected packages and fixed versions:
- fiona (PyPI): affected all versions; fixed in 1.10b2
- fiona (PyPI): affected all versions; fixed in 1.10b2

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-g4m4-9q4c-mfw6/ (Markdown: https://insights.sbomify.com/GHSA-g4m4-9q4c-mfw6/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g4m4-9q4c-mfw6

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g4m4-9q4c-mfw6/
Summaries are generated and may contain mistakes; the official description above is the record.
