# GHSA-H6VP-4QR8-GVH5: Login CSRF: OAuth callback accepted when no login was started

- Database: GitHub
- Severity: CVSS 5.4 (Medium)
- Published: 2026-12-03
- Modified: 2026-12-03

## Affected versions

- decap-cms-lib-auth (npm): through 3.4.0
- decap-cms-app (npm): through 3.18.0
- decap-cms (npm): through 3.18.0

## Description

### Summary

`validateNonce()` in `decap-cms-lib-auth` compared the `state` nonce of an OAuth callback with the nonce stored in `sessionStorage` without checking that a nonce had been stored. When no login was started in the tab, the stored side is `null`, so a callback carrying `state={"nonce":null}` passed the check. The OAuth state check, which protects against login CSRF, was bypassed.

Example attack URL for the implicit flow:

```
/admin/#access_token=ATTACKER_TOKEN&token_type=bearer&state={"nonce":null}
```

The CMS stores the attacker's token as the signed-in user and sends it to the Git provider's API.

### Impact

Login CSRF. An editor who opens a crafted link is signed into the CMS with the attacker's Git provider account. Content the editor then saves (entries, drafts, media, editorial workflow pull requests) is written with the attacker's token wherever that account has access, and is attributed to the attacker.

Affected: backends that use the implicit flow (Azure, and GitLab or Bitbucket with `auth_type: implicit`). PKCE flows also passed the nonce check, but the code exchange then fails without the matching `code_verifier`.

### Patches

Fixed in `decap-cms-lib-auth` 3.5.0, shipped in `decap-cms` and `decap-cms-app` 3.19.0. A callback is now accepted only when a non-empty nonce was stored by this tab and matches.

### Workarounds

None besides upgrading.

### Credit

Reported by Zachariah Mithani (AploSec).

## References

- https://github.com/decaporg/decap-cms/security/advisories/GHSA-h6vp-4qr8-gvh5

Page: https://cve.now/GHSA-H6VP-4QR8-GVH5

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
