Low

CSRF Vuln can expose user's QRcode

  • Disclosed: 08.04.2021
  • Updated: 11.10.2026 12:18

Impact

When a user is setting up two-factor authentication using an authenticator app, a QRcode is generated and made available via a GET request to /tf-qrcode. Since GETs do not have any CSRF protection, it is possible a malicious 3rd party could access the QRcode and therefore gain access to two-factor authentication codes. Note that the /tf-qrcode endpoint is ONLY accessible while the user is initially setting up their device. Once setup is complete, there is no vulnerability.

Patches

This is fixed in the upcoming 4.0.0 release.

Workarounds

You can provide your own URL for fetching the QRcode by defining SECURITY_TWO_FACTOR_QRCODE_URL and providing your own implementation (that presumably required a POST with CSRF protection). This would require changing the two-factor setup template as well.

References

None.

For more information

If you have any questions or comments about this advisory:

  • Read this pull request: #423

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) flask-security-too >= 3.2.0, < 3.4.5 3.4.5

References

CVSS score -
Weakness (CWE)
CWE-352
Platform
Python (PyPI)
Package
flask-security-too
Disclosed
08.04.2021
Updated
11.10.2026 12:18

Sources and licenses

OSV / GitHub Advisory Database - GHSA-fxq4-r6mr-9x64 - CC BY 4.0

Vulnerability history: flask-security-too

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
6
First → latest
01.2021 07.2026
Without a fix
1
Exploited in attacks
0

Severity breakdown

  • High 1
  • Medium 3
  • Low 2

Disclosures per year

  1. 2021: 3
  2. 2022: 0
  3. 2023: 1
  4. 2024: 0
  5. 2025: 0
  6. 2026: 2
  1. Low · 3.1 CVE-2021-32618 < 4.1.0 4.1.0
  2. CSRF Vuln can expose user's QRcode this entry
    Low ghsa-fxq4-r6mr-9x64 >= 3.2.0, < 3.4.5 3.4.5
  3. High · 7.4 CVE-2021-21241 >= 3.3.0, < 3.4.5 3.4.5

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.