KEVWire

Security intelligence, with context.

Response snapshot Oct 27, 2026, 01:01 UTC

Back to the wire
Permalink
VulnerabilityCVE-2026-114137

Django REST framework: TokenProxy.delete() reports success and revokes nothing

Deleting an authentication token through `TokenProxy` silently deletes nothing. The call raises no exception and reports success, the database row survives, and the token keeps authenticating. Any application, admin integration or operational script that revokes credentials by calling `.

At a glance

Exploited
Not known
Severity
7.4 High (CVSS 3.1)
Chance of exploitation
0.5% in the next 30 days
Sources
2 independent sources

What to do

GitHub lists first patched versions: djangorestframework: 3.18.2. Confirm the affected range and upgrade guidance in the exact advisory.

Read GitHub-reviewed advisory GHSA-xw6w-gcfp-cf8m (opens a new tab)

What happened

### Summary

Deleting an authentication token through `TokenProxy` silently deletes nothing. The call raises no exception and reports success, the database row survives, and the token keeps authenticating. Any application, admin integration or operational script that revokes credentials by calling `.delete()` on a `TokenProxy` instance believes it has revoked a token that is still live.

### Details

`TokenProxy` overrides `pk` to return the user id (`rest_framework/authtoken/models.py:49-63`):

Continue reading

```python @property def pk(self): return self.user_id ```

The concrete `Token` model keys on `key`, not on an integer id. `Model.delete()` builds its delete query from `pk`, so it emits:

```sql DELETE FROM "authtoken_token" WHERE "authtoken_token"."key" IN ('1') ```

That matches a user id against the 40-character key column. Nothing matches, nothing raises, and the call returns `(0, {'authtoken.TokenProxy': 0})`.

DRF already ships two workarounds for this same identity mismatch instead of a fix. In `rest_framework/authtoken/admin.py`, `TokenAdmin.delete_model` re-fetches the concrete row:

```python def delete_model(self, request, obj): Token.objects.get(key=obj.key).delete() # admin.py:30 ```

and `TokenAdmin` sets `actions = None` with the comment "Actions not compatible with mapped IDs" (`admin.py:50-53`). The shipped admin path is therefore safe, and every other caller of `TokenProxy.delete()` is not. Nothing in the API signals the difference.

`TokenProxy` was added by `e2bd3b6a` (PR #7341, "Adjusted token admin to map to user ID"), first released in 3.12.0.

A fix would drop the `pk` override, or give `TokenProxy` a `delete()` that operates on the concrete row, or raise instead of silently reporting zero deletions.

### PoC

Save as `poc_tokenproxy_revocation.py` and run it.

```python #!/usr/bin/env python """ django-rest-framework: TokenProxy.delete() reports success and revokes nothing.

baseline token exists -> 200 TRIGGER TokenProxy.objects.get(...).delete() -> no exception, row survives, still 200 CONTROL Token.objects.get(key=...).delete() -> row gone, 401

The control is what makes the trigger meaningful: it proves the row was deletable and the credential check live, so the 200 after the proxy delete is a failed revocation and not a broken harness.

Requires: django, djangorestframework importable. No arguments. python poc_tokenproxy_revocation.py Exit status 0 means the revocation failure reproduced. """ import sys

import django from django.conf import settings

settings.configure( DEBUG=False, SECRET_KEY="poc", ALLOWED_HOSTS=["*"], ROOT_URLCONF=__name__, INSTALLED_APPS=[ "django.contrib.contenttypes", "django.contrib.auth", "rest_framework", "rest_framework.authtoken", ], DATABASES={"default": {"ENGINE": "django.db.backends.sqlite3", "NAME": ":memory:"}}, DEFAULT_AUTO_FIELD="django.db.models.AutoField", USE_TZ=True, ) django.setup()

from django.contrib.auth import get_user_model # noqa: E402 from django.core.management import call_command # noqa: E402 from django.db import connection # noqa: E402 from django.test import Client # noqa: E402 from django.test.utils import CaptureQueriesContext # noqa: E402 from django.urls import path # noqa: E402

from rest_framework.authentication import TokenAuthentication # noqa: E402 from rest_framework.authtoken.models import Token, TokenProxy # noqa: E402 from rest_framework.permissions import IsAuthenticated # noqa: E402 from rest_framework.response import Response # noqa: E402 from rest_framework.views import APIView # noqa: E402

class Whoami(APIView): authentication_classes = [TokenAuthentication] permission_classes = [IsAuthenticated]

def get(self, request): return Response({"user": request.user.get_username()})

urlpatterns = [path("", Whoami.as_view())]

def probe(client, key): response = client.get("/", headers={"authorization": "Token %s" % key}) return response.status_code

def main(): call_command("migrate", run_syncdb=True, verbosity=0) user = get_user_model().objects.create_user(username="revoke-user", password="pw") key = Token.objects.create(user=user).key client = Client()

print("TokenProxy._meta.proxy =", TokenProxy._meta.proxy) print("Token._meta.pk.attname =", Token._meta.pk.attname) print("user.pk =", user.pk) print("token key =", key)

print("\n--- baseline") print("rows =", Token.objects.count()) baseline = probe(client, key) print("GET / with token ->", baseline)

print("\n--- TRIGGER: delete through the proxy") proxy = TokenProxy.objects.get(user=user) print("proxy.pk =", proxy.pk, "(TokenProxy.pk property)") raised = None with CaptureQueriesContext(connection) as ctx: try: returned = proxy.delete() except Exception as exc: # noqa: BLE001 raised, returned = exc, None for q in ctx.

captured_queries: if "DELETE" in q["sql"]: print(" SQL:", q["sql"]) print("raised =", repr(raised)) print("returned =", returned) print("rows =", Token.objects.count()) after_proxy = probe(client, key) print("GET / with token ->", after_proxy)

print("\n--- CONTROL: delete the same row through the concrete model") with CaptureQueriesContext(connection) as ctx2: returned2 = Token.objects.get(key=key).delete() for q in ctx2.captured_queries: if "DELETE" in q["sql"]: print(" SQL:", q["sql"]) print("returned =", returned2) print("rows =", Token.objects.count()) after_real = probe(client, key) print("GET / with token ->", after_real)

ok = baseline == 200 and raised is None and after_proxy == 200 and after_real == 401 print( "\nrevocation failure reproduced:", ok, "(baseline 200, still 200 after proxy delete, 401 after real delete)", ) return 0 if ok else 1

if __name__ == "__main__": sys.exit(main()) ```

Observed output:

``` TokenProxy._meta.proxy = True Token._meta.pk.attname = key user.pk = 1 token key = 6a644878f252175d39205804c5a6faf16df67c10

--- baseline rows = 1 GET / with token -> 200

--- TRIGGER: delete through the proxy proxy.pk = 1 (TokenProxy.pk property)

Affected package ranges reported by GitHub: djangorestframework: >= 3.12.0, < 3.18.2

Scores and how they were measured

CVSS base severity

7.4

Version 3.1As of

CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:N

Measurement source (opens a new tab)

How bad it is if exploited. Not a prediction of exploitation or proof you are exposed.

EPSS probability

0.5%

Scored Percentile 40.7%

Model and measurement source (opens a new tab)

A model's estimate of exploitation in the next 30 days, not certainty or your own risk.

Related technology

Sources

  1. Primary source

    GitHub-reviewed advisory GHSA-xw6w-gcfp-cf8m (opens a new tab)

    The public advisory supplies the description, affected package/version ranges, and any listed CVSS metric. GitHub review is not local review.

    Published Checked

  2. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  3. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  4. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  5. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  6. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  7. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  8. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  9. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  10. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  11. Primary source

    GitHub public advisory API page (opens a new tab)

    The API page supplied GHSA-xw6w-gcfp-cf8m, its actual identifiers, source dates, and structured metrics.

    Published Date not suppliedChecked

  12. Primary source

    NVD CVE-2026-114137 (opens a new tab)

    NVD record: description, CVSS (the CNA score is preferred), affected products, and publication date. Not evidence of exploitation.

    Published Checked

  13. Primary source

    NVD CVE API 2.0 (opens a new tab)

    The NVD API page that supplied this CVE record.

    Published Date not suppliedChecked

  14. Primary source

    FIRST measured EPSS score (opens a new tab)

    Measured EPSS probability and percentile for CVE-2026-114137, scored 2026-10-26. This is a model estimate, not proof of exposure.

    Published Checked

Cite this record

For factual claims, cite the primary sources above; cite KEVWire for its compilation, dates, and classifications.

APA

KEVWire. (2026, October 23). Django REST framework: TokenProxy.delete() reports success and revokes nothing (CVE-2026-114137). https://kevwire.com/record/CVE-2026-114137

MLA

"Django REST framework: TokenProxy.delete() reports success and revokes nothing (CVE-2026-114137)." KEVWire, 23 Oct. 2026, kevwire.com/record/CVE-2026-114137.

Chicago

KEVWire. "Django REST framework: TokenProxy.delete() reports success and revokes nothing (CVE-2026-114137)." Last modified October 23, 2026. https://kevwire.com/record/CVE-2026-114137.

Evidence summary (plain text)

Django REST framework: TokenProxy.delete() reports success and revokes nothing (Oct 22, 2026).
Deleting an authentication token through `TokenProxy` silently deletes nothing. The call raises no
exception and reports success, the database row survives, and the token keeps authenticating. Any
application, admin integration or operational script that revokes credentials by calling `.delete()`
on a `TokenProxy` instance believes it has revoked a token that is still live.

`TokenProxy` overrides `pk` to return the user id (`rest_framework/authtoken/models.py:49-63`):
CVSS 7.4 (version 3.1; evidence as of Oct 23, 2026; https://nvd.nist.gov/vuln/detail/CVE-2026-114137).
EPSS 0.5% for the following 30 days, scored Oct 26, 2026 (https://api.first.org/data/v1/epss?cve=CVE-2026-114137&date=2026-10-26).
Sources:
GitHub-reviewed advisory GHSA-xw6w-gcfp-cf8m: https://github.com/advisories/GHSA-xw6w-gcfp-cf8m
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo1MTozMFrOAAf0Mg%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0OToxMlrOAAf0LQ%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NzoxN1rOAAf0Kg%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NTozNlrOAAf0Jw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0NTowNVrOAAf0JQ%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0Mzo0NVrOAAf0Iw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QyMDo0MzozMVrOAAf0Ig%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QxODozNTowMVrOAAZRcw%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QxODozMDoyN1rOAAY_5Q%3D%3D
GitHub public advisory API page: https://api.github.com/advisories?type=reviewed&per_page=100&sort=updated&direction=desc&after=Y3Vyc29yOnYyOpK0MjAyNi0xMC0yM1QxODoyOTowNVrOAAfz8g%3D%3D
NVD CVE-2026-114137: https://nvd.nist.gov/vuln/detail/CVE-2026-114137
NVD CVE API 2.0: https://services.nvd.nist.gov/rest/json/cves/2.0?pubStartDate=2026-10-12T13:35:55.142Z&pubEndDate=2026-10-26T13:35:55.142Z&resultsPerPage=500&startIndex=8000
FIRST measured EPSS score: https://api.first.org/data/v1/epss?cve=CVE-2026-114137&date=2026-10-26
Record ID: CVE-2026-114137.
Record origin: Ingested record.
AI evidence: Not assessed.
Known exploitation: Not assessed.
Zero-day status: Not assessed. KEV membership alone does not establish zero-day status.
About this data

This record was ingested from a data source. Retrieved: Oct 26, 2026, 19:40 UTC. Ingestion is not an independent editorial investigation.

A CISA KEV listing documents known exploitation, not necessarily a zero-day; absence from the catalog does not prove a vulnerability has never been exploited.

Technology tags indicate possible relevance, not verified exposure. Confirm the affected product, version, and configuration against your own inventory; KEVWire does not scan your systems.

A personal reading checklist on this device, not verified remediation.

Record JSON

Your account

Email alerts

Email alerts are not available yet. To follow your stack today, use its RSS feed, which honors your filters, or connect an AI agent through the API.

Suggest an improvement

Ideas, missing sources, corrections, and bugs are all welcome. No account needed. Suggestions are reviewed by a person before anything changes.

Record details

Record detail