Advisory published

XYZ-2026-00077

Flask-Security-Too: two overlapping requests could both redeem one single-use refresh token

Low severityflask-securityflask-security-toofixed in flask-security@5.9.3, flask-security-too@5.9.3
the timeline of this fixpypi · flask-security · dates in UTC

Flagged 11 days before the advisory

CyberXYZ reads the changes made to a package's source code. We spotted this security fix on 10 Nov 2026. The maintainers' advisory (GHSA-vm9m-262m-x92p) followed 11 days later.

11 daysfrom our flag to the advisory
  1. CyberXYZ flagged the fix
  2. Advisory published

What was wrong

Refresh tokens are documented as single use. The refresh path read the token family's generation, compared it, and then wrote the next generation, with no row lock and no update conditioned on the old value. Two overlapping requests with the same valid token could both pass the check, and each received new credentials. The reuse was not detected, so the family was not revoked.

Impactlow

Weaker reuse detection, not a new way in. An attacker must already hold a live refresh token and use it at the same moment as its owner. The reporter tested this with controlled timing on SQLite and did not measure how often the race occurs in a deployed application.

Who is affected

Applications on Flask-Security-Too 5.9.0 to 5.9.2 that turn refresh tokens on with SECURITY_REFRESH_TOKEN=True. The feature is off by default.

What to do

Upgrade to Flask-Security-Too 5.9.3.

Reported to the maintainers by @nirodhav and fixed by the Flask-Security maintainers. Advisory: GHSA-vm9m-262m-x92p.

XYZ-2026-00077.json · OSV
{
  "id": "XYZ-2026-00077",
  "summary": "Flask-Security-Too: two overlapping requests could both redeem one single-use refresh token",
  "aliases": [
    "GHSA-vm9m-262m-x92p"
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "flask-security"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "5.9.3"
            }
          ]
        }
      ]
    },
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "flask-security-too"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "5.9.3"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "FIX",
      "url": "https://github.com/pallets-eco/flask-security/commit/3da03afeaaeb48896f52ccbf3e7d11b90202e802"
    },
    {
      "type": "FIX",
      "url": "https://github.com/pallets-eco/flask-security/commit/bc85c9b6ff725deaccf309189b997b08315c89ef"
    }
  ],
  "credits": [
    {
      "name": "CyberXYZ Security Threat Intel Team",
      "contact": [
        "https://cyberxyz.io"
      ],
      "type": "ANALYST"
    }
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-367"
    ]
  }
}

An excerpt of this record in the OSV format, for tools that read advisories. The full record as JSON.

The bug was found and fixed by the package's maintainers. CyberXYZ flagged the fix in the source and recorded the release that carries it. All CyberXYZ Advisories · The flask-security report


Think this record is wrong? Tell us; we respond within 2 business days.