# GHSA-h5fq-653g-gxrm: ots has a negative expire override that can bypass its secret retention policy

> Unauthenticated attackers can bypass secret retention policies by sending negative expiry values, causing secrets to persist longer than intended.

- **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:** 5 May 2026
- **Also known as:** GO-2026-5413

## What is GHSA-h5fq-653g-gxrm?

GHSA-h5fq-653g-gxrm is a vulnerability in github.com/Luzifer/ots, published on 5 May 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

## Summary

The `/api/create` endpoint accepted negative `expire` query values. For the memory storage backend, negative values were passed to secret creation as a negative duration and treated as no expiry, allowing callers to create secrets that persisted longer than intended.

## Impact

Unauthenticated users could bypass configured retention expectations for secrets they create by sending `POST /api/create?expire=-1`.

This does not allow reading or modifying secrets created by other users. Secrets remain one-time-read and, in the normal web flow, client-side encrypted.

## Affected versions

Versions up to and including v1.21.4 are affected.

## Patched versions

Fixed in v1.21.5.

## Workarounds

Disable expiry overrides via `disableExpiryOverride: true` until upgrading.

## Credit

Reported by Chai Cheng Xun via email.

## Which versions are affected by GHSA-h5fq-653g-gxrm?

3 open source packages ship an affected version, including github.com/Luzifer/ots.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/Luzifer/ots` | Go | All versions | 1.21.5 |
| `github.com/Luzifer/ots` | Go | All versions | 1.21.5 |
| `github.com/Luzifer/ots` | Go | All versions | 1.21.5 |

## How do I fix GHSA-h5fq-653g-gxrm?

Upgrade github.com/Luzifer/ots to 1.21.5 or later.

## Is GHSA-h5fq-653g-gxrm being exploited?

There is no known exploitation of GHSA-h5fq-653g-gxrm in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-h5fq-653g-gxrm and fix it if it is affected.

What it is: GHSA-h5fq-653g-gxrm is a vulnerability in github.com/Luzifer/ots, published on 5 May 2026. 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-h5fq-653g-gxrm in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/Luzifer/ots (Go): affected all versions; fixed in 1.21.5
- github.com/Luzifer/ots (Go): affected all versions; fixed in 1.21.5
- github.com/Luzifer/ots (Go): affected all versions; fixed in 1.21.5

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-h5fq-653g-gxrm/ (Markdown: https://insights.sbomify.com/GHSA-h5fq-653g-gxrm/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-h5fq-653g-gxrm

---
From sbomify Insights: https://insights.sbomify.com/GHSA-h5fq-653g-gxrm/
Summaries are generated and may contain mistakes; the official description above is the record.
