# CVE-2021-22897: schannel cipher selection surprise

libcurl's schannel backend used a static algIds array, so concurrent easy handles with different CURLOPT_SSL_CIPHER_LIST overwrote each other's cipher config.

- Payout: hidden
- Severity: low
- Program: curl
- Found by: nyymi
- Disclosed: 2021-05-26
- CVE: CVE-2021-22897
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1172857
- Library page: https://bugbountylibrary.com/r/h1%3A1172857
- Tags: area:oss domain:oss impact:integrity kind:bounty platform:hackerone sev:low tech:curl technique:source-review vuln:misconfiguration vuln:race-condition

**Target:** libcurl schannel TLS backend (set_ssl_ciphers)
**Root cause:** set_ssl_ciphers stores selected cipher algorithm IDs in a static algIds array shared across all connections, so the last-configured cipher list overrides others.
**Steps:**
1. Create two curl easy handles via `curl_easy_init`
2. Set different cipher lists on each with `curl_easy_setopt(h, CURLOPT_SSL_CIPHER_LIST, ...)`
3. Initiate simultaneous connections from both handles
4. Observe one connection using the other handle's cipher configuration due to shared static algIds
**How found:** Code review of the commit adding schannel cipher selection; noticed algIds declared static in set_ssl_ciphers, implying cross-connection state sharing.
**Insight:** When auditing TLS backend option handling, grep for `static` buffers/arrays in per-connection setter functions; shared state across easy handles breaks per-handle isolation and can silently downgrade cipher policy.

