# GHSA-m6m5-pp4g-fcc8: S3 storage write is not aborted on errors leading to unbounded memory usage

> An attacker can cause unbounded memory usage and denial of service by triggering errors during S3 storage writes in the maddy mail server.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Oct 2021
- **Also known as:** GO-2022-0374

## What is GHSA-m6m5-pp4g-fcc8?

GHSA-m6m5-pp4g-fcc8 is a denial of service vulnerability in github.com/foxcpp/maddy, published on 6 Oct 2021. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Impact

Anyone using storage.blob.s3 introduced in 0.5.0 with storage.imapsql.
```
storage.imapsql local_mailboxes {
  ...
  msg_store s3 {
    ...
  }
}
```

### Patches

The relevant commit is pushed to master and will be included in the 0.5.1 release.

No special handling of the issue has been done due to the small amount of affected users.

### Workarounds

None.

### References

* Original report: https://github.com/foxcpp/maddy/issues/395
* Fix: https://github.com/foxcpp/maddy/commit/07c8495ee4394fabbf5aac4df8aebeafb2fb29d8

## Which versions are affected by GHSA-m6m5-pp4g-fcc8?

3 open source packages ship an affected version, including github.com/foxcpp/maddy.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/foxcpp/maddy` | Go | All versions | 0.5.1 |
| `github.com/foxcpp/maddy` | Go | All versions | 0.5.1 |
| `github.com/foxcpp/maddy` | Go | All versions | 0.5.1 |

## How do I fix GHSA-m6m5-pp4g-fcc8?

Upgrade github.com/foxcpp/maddy to 0.5.1 or later.

## Is GHSA-m6m5-pp4g-fcc8 being exploited?

There is no known exploitation of GHSA-m6m5-pp4g-fcc8 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-m6m5-pp4g-fcc8 and fix it if it is affected.

What it is: GHSA-m6m5-pp4g-fcc8 is a denial of service vulnerability in github.com/foxcpp/maddy, published on 6 Oct 2021. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-m6m5-pp4g-fcc8 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/foxcpp/maddy (Go): affected all versions; fixed in 0.5.1
- github.com/foxcpp/maddy (Go): affected all versions; fixed in 0.5.1
- github.com/foxcpp/maddy (Go): affected all versions; fixed in 0.5.1

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-m6m5-pp4g-fcc8/ (Markdown: https://insights.sbomify.com/GHSA-m6m5-pp4g-fcc8/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-m6m5-pp4g-fcc8

---
From sbomify Insights: https://insights.sbomify.com/GHSA-m6m5-pp4g-fcc8/
Summaries are generated and may contain mistakes; the official description above is the record.
