Cloudanix VulnDB

CVE-2024-35195

Medium · 5.6

CVSS

5.6

EPSS

0.3%

Published

May 20, 2024

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Track

Some Python software may think it is securely checking a website’s identity after a previous insecure connection, but it may keep trusting the unsafe connection instead.

Chainable
Exploitation
Requires User Interaction
Attacker needs
High Privilege
Complexity
High
Impact
Data Exposure
Component
Library
Class
Cryptographic Weakness
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

In affected versions of the Python Requests library before 2.32.0, TLS certificate verification state can persist incorrectly within a Session connection pool. If a Session first connects to a host with verify=False, the pooled connection for that host may continue to skip certificate validation for later requests even when verify is changed back to True or a certificate bundle is supplied. The flaw weakens HTTPS trust guarantees and can allow a man-in-the-middle attacker, in the right network position, to read or modify traffic that the application developer expected to be certificate-validated.

Why it matters to the business

Applications using vulnerable Requests versions may silently send sensitive API calls, credentials, tokens, or business data over HTTPS connections that are not actually verifying the remote server identity. Because Requests is widely used across Python applications, the operational risk is mainly hidden exposure in internal services, automation, integrations, and scripts where developers temporarily disabled verification and assumed later calls were safe. The vulnerability is not listed in CISA KEV, has low EPSS, and has no known public exploit maturity in the provided data, so prioritization should be risk-based, with higher urgency for software that handles secrets, payments, customer data, administrative APIs, or runs on untrusted networks.

How an attack unfolds

An attacker cannot generally exploit this flaw by sending a simple remote request to an application. The vulnerable pattern requires an application to use a persistent requests.Session, make an initial HTTPS request to a target host with verify=False, and then reuse the same Session and pooled connection for later requests to that same host while expecting certificate verification to be enabled. If an attacker can observe or intercept network traffic between the application and that host, they can present a spoofed or untrusted certificate and still have the client accept the connection because the pooled connection remains in an unverified state. The attacker can then inspect sensitive data in transit, alter responses, inject malicious payloads into API responses, or capture authentication material depending on what the application sends over the affected connection.

How to fix it

Upgrade Python Requests to version 2.32.0 or later wherever it is installed directly or bundled transitively. For source-based deployments, include the upstream fix at commit d6ebc4a2f1f68b7e355fb7e4dd5ffc0845547f9f or a later release containing it. Regenerate lockfiles and container images so the fixed package is actually deployed, not only declared. Remove avoidable uses of verify=False from application code; where custom trust is needed, configure verify with an explicit CA bundle path rather than disabling verification. Avoid reusing a Session across mixed trust modes; if verification must be disabled for a specific diagnostic or controlled endpoint, isolate it in a separate short-lived Session and close it immediately after use. Ensure urllib3, certifi, and related HTTP dependencies are kept current as part of normal dependency hygiene.

How to confirm the fix worked

Confirm the installed package version at runtime and in build artifacts using commands such as python -m pip show requests, pip freeze, poetry show requests, pipenv graph, or SBOM/dependency scanner output; the effective version should be 2.32.0 or later. Search code for requests.Session usage combined with verify=False, especially where the same Session object is reused for multiple calls to the same host. Validate container images, serverless packages, virtual environments, and vendored dependencies because Python applications often carry their own dependency copies. As a functional regression test, create a Session, make a first request to a test HTTPS endpoint with verify=False, then make a subsequent request through the same Session to the same host with verify=True while presenting an invalid certificate; fixed versions should reject the invalid certificate on the verified request.

Typical attack path

  1. Identify or infer a Python application, automation job, or service that uses the Requests library before 2.32.0.
  2. Find a code path where a persistent requests.Session is used and an initial request to a host is made with verify=False.
  3. Position on the network path between the application and the target host, such as through compromised Wi-Fi, proxy infrastructure, DNS manipulation, routing control, or a hostile internal network segment.
  4. Wait for the application to reuse the same Session connection pool for later HTTPS requests to the same host that the developer expects to be certificate-validated.
  5. Present a forged, self-signed, expired, or otherwise invalid certificate while intercepting the connection.
  6. Read sensitive request or response data, capture tokens or credentials, or modify responses returned to the application.

How to detect it

There are no universal network or host indicators proving exploitation because abuse appears as HTTPS traffic to legitimate destinations and depends on application behavior. Investigate whether vulnerable applications both used Requests before 2.32.0 and executed code paths containing verify=False. Review application logs, debug logs, proxy logs, TLS inspection logs, and EDR/network telemetry for failed or unusual certificate validation events, unexpected certificate issuers, self-signed certificates, hostname mismatches, expired certificates, or HTTPS connections to sensitive API hosts through unusual proxies or network paths. Search source repositories, deployed artifacts, container layers, and runtime logs for verify=False and InsecureRequestWarning messages. For suspected compromise, compare server certificate fingerprints observed by the client/proxy against known-good certificates from the destination service during the relevant time window, and review downstream API audit logs for suspicious actions, token use, or data access following affected outbound requests.

  • verify=False
  • requests.Session(
  • Session()
  • InsecureRequestWarning
  • Unverified HTTPS request is being made
  • CERTIFICATE_VERIFY_FAILED
  • certificate verify failed
  • self signed certificate
  • hostname mismatch
  • certificate has expired
  • requests==2.31.0
  • requests==2.30.0
  • requests==2.29.0
  • requests==2.28.0
  • requests<2.32.0

What your security team should do

  • Inventory all Python applications, scripts, CI/CD jobs, notebooks, serverless functions, and containers that include Requests before 2.32.0.
  • Prioritize upgrades for workloads that transmit credentials, API tokens, customer data, payment data, administrative commands, or service-to-service authentication over HTTPS.
  • Patch by upgrading Requests to 2.32.0 or later and rebuilding lockfiles, virtual environments, containers, and deployed artifacts.
  • Perform targeted code review for requests.Session combined with verify=False and require security approval for any remaining certificate-verification bypasses.
  • Add static analysis or repository rules that flag verify=False in requests calls and fail builds for new unsafe uses unless explicitly waived.
  • Where immediate upgrade is not possible, avoid mixed verification states in the same Session, use separate short-lived Sessions, close Sessions after unverified calls, and restrict network paths to trusted segments.
  • Monitor dependency management systems for transitive reintroduction of vulnerable Requests versions.

The record

Requests is a HTTP library. Prior to 2.32.0, when making requests through a Requests `Session`, if the first request is made with `verify=False` to disable cert verification, all subsequent requests to the same host will continue to ignore cert verification regardless of changes to the value of `verify`. This behavior will continue for the lifecycle of the connection in the connection pool. This vulnerability is fixed in 2.32.0.

Affected packages

Ecosystem Package Introduced Fixed
PyPI requests 0 2.32.0
AlmaLinux:8 python3-requests 0 2.20.0-5.el8_10
AlmaLinux:9 python3-requests 0 2.25.1-9.el9
AlmaLinux:9 python3-requests+security 0 2.25.1-9.el9
AlmaLinux:9 python3-requests+socks 0 2.25.1-9.el9
Alpine:v3.18 py3-requests 0 2.32.3-r0
Alpine:v3.19 py3-requests 0 2.32.3-r0
Alpine:v3.20 py3-requests 0 2.32.3-r0
Alpine:v3.21 py3-requests 0 2.32.3-r0
Alpine:v3.22 py3-requests 0 2.32.3-r0
Chainguard airflow 0 2.9.1-r1
Chainguard airflow-bitnami-compat 0 2.9.1-r1
Chainguard airflow-compat 0 2.9.1-r1
Chainguard ansible-operator 0 1.41.0-r1
Chainguard ansible-operator-compat 0 1.41.0-r1
Chainguard apache-beam-python-3.11-sdk 0 2.59.0-r0
Chainguard az 0 2.61.0-r0
Chainguard az 0 2.70.0-r0
Chainguard az-iamguarded-compat 0 2.70.0-r0
Chainguard checkov 0 3.0.34-r1
Chainguard confluent-docker-utils 0 0.0.78-r0
Chainguard datadog-agent 0 7.54.0-r1
Chainguard datadog-agent-core-integrations 0 7.54.0-r1
Chainguard datadog-agent-fakeintake 0 7.54.0-r1
Chainguard datadog-agent-jmx 0 7.54.0-r1
Chainguard datadog-agent-oci-compat 0 7.54.0-r1
Chainguard datadog-agent-s6-overlay 0 7.54.0-r1
Chainguard datadog-cluster-agent 0 7.54.0-r1
Chainguard datadog-cluster-agent-oci-compat 0 7.54.0-r1
Chainguard dogstatsd 0 7.54.0-r1
Chainguard ggshield 0 1.28.0-r1
Chainguard graalvm-23 0 23.0.2-r7
Chainguard graalvm-23-ce 0 23.0.2-r7
Chainguard graalvm-23-ce-dbg 0 23.0.2-r7
Chainguard graalvm-23-ce-default-jdk 0 23.0.2-r7
Chainguard graalvm-23-ce-jmods 0 23.0.2-r7
Chainguard graalvm-23-ce-nodejs 0 23.0.2-r7
Chainguard graalvm-23-ce-nodejs-dbg 0 23.0.2-r7
Chainguard graalvm-23-ce-nodejs-default-jdk 0 23.0.2-r7
Chainguard graalvm-23-ce-nodejs-jmods 0 23.0.2-r7
Chainguard graalvm-23-graalpy 0 23.0.2-r7
Chainguard graalvm-23-truffleruby 0 23.0.2-r7
Chainguard graalvm-24 0 24.0.2-r6
Chainguard graalvm-24-ce 0 24.0.2-r6
Chainguard graalvm-24-ce-dbg 0 24.0.2-r6
Chainguard graalvm-24-ce-default-jdk 0 24.0.2-r6
Chainguard graalvm-24-ce-jmods 0 24.0.2-r6
Chainguard graalvm-24-ce-nodejs 0 24.0.2-r6
Chainguard graalvm-24-ce-nodejs-dbg 0 24.0.2-r6
Chainguard graalvm-24-ce-nodejs-default-jdk 0 24.0.2-r6
Chainguard graalvm-24-ce-nodejs-jmods 0 24.0.2-r6
Chainguard graalvm-24-graalpy 0 24.0.2-r6
Chainguard graalvm-24-truffleruby 0 24.0.2-r6
Chainguard jwt-tool 0 2.2.7-r0
Chainguard k8s-sidecar 0 1.27.2-r0
Chainguard k8s-sidecar-1.22 0 1.22.4-r2
Chainguard katib-cert-generator 0 0.18.0-r0
Chainguard katib-cert-generator-compat 0 0.18.0-r0
Chainguard katib-controller 0 0.16.0-r12
Chainguard katib-controller 0 0.18.0-r0
Chainguard katib-controller-compat 0 0.16.0-r12
Chainguard katib-controller-compat 0 0.18.0-r0
Chainguard katib-db-manager 0 0.16.0-r12
Chainguard katib-db-manager 0 0.18.0-r0
Chainguard katib-db-manager-compat 0 0.16.0-r12
Chainguard katib-db-manager-compat 0 0.18.0-r0
Chainguard katib-earlystopping 0 0.16.0-r12
Chainguard katib-earlystopping 0 0.18.0-r0
Chainguard katib-file-metricscollector 0 0.16.0-r12
Chainguard katib-file-metricscollector 0 0.18.0-r0
Chainguard katib-file-metricscollector-compat 0 0.16.0-r12
Chainguard katib-file-metricscollector-compat 0 0.18.0-r0
Chainguard katib-suggestion-goptuna 0 0.16.0-r12
Chainguard katib-suggestion-goptuna 0 0.18.0-r0
Chainguard katib-suggestion-goptuna-compat 0 0.16.0-r12
Chainguard katib-suggestion-goptuna-compat 0 0.18.0-r0
Chainguard katib-suggestion-hyperband 0 0.16.0-r12
Chainguard katib-suggestion-hyperband 0 0.18.0-r0
Chainguard katib-suggestion-hyperopt 0 0.16.0-r12
Chainguard katib-suggestion-hyperopt 0 0.18.0-r0
Chainguard katib-suggestion-nas-darts 0 0.16.0-r12
Chainguard katib-suggestion-nas-darts 0 0.18.0-r0
Chainguard katib-suggestion-nas-enas 0 0.16.0-r12
Chainguard katib-suggestion-nas-enas 0 0.18.0-r0
Chainguard katib-suggestion-optuna-enas 0 0.16.0-r12
Chainguard katib-suggestion-optuna-enas 0 0.18.0-r0
Chainguard katib-suggestion-pbt-enas 0 0.16.0-r12
Chainguard katib-suggestion-pbt-enas 0 0.18.0-r0
Chainguard katib-suggestion-skopt-enas 0 0.16.0-r12
Chainguard katib-suggestion-skopt-enas 0 0.18.0-r0
Chainguard katib-tfevent-metricscollector 0 0.16.0-r12
Chainguard katib-tfevent-metricscollector 0 0.18.0-r0
Chainguard kubeflow-jupyter-web-app 0 1.8.0-r7
Chainguard kubeflow-katib 0 0.16.0-r12
Chainguard kubeflow-katib 0 0.18.0-r0
Chainguard kubeflow-pipelines 0 2.2.0-r2
Chainguard kubeflow-pipelines-apiserver 0 2.2.0-r2
Chainguard kubeflow-pipelines-cache-deployer 0 2.2.0-r2
Chainguard kubeflow-pipelines-cache-deployer-compat 0 2.2.0-r2
Chainguard kubeflow-pipelines-cache_server 0 2.2.0-r2
Chainguard kubeflow-pipelines-frontend 0 2.2.0-r2
Chainguard kubeflow-pipelines-metadata-envoy-config 0 2.2.0-r2
Chainguard kubeflow-pipelines-metadata-writer 0 2.2.0-r2
Chainguard kubeflow-pipelines-metadata-writer-compat 0 2.2.0-r2
Chainguard kubeflow-pipelines-persistence_agent 0 2.2.0-r2
Chainguard kubeflow-pipelines-scheduledworkflow 0 2.2.0-r2
Chainguard kubeflow-pipelines-viewer-crd-controller 0 2.2.0-r2
Chainguard kubeflow-pipelines-visualization-server 0 2.3.0-r0
Chainguard kubeflow-volumes-web-app 0 1.8.0-r6
Chainguard mlflow 0 2.13.1-r0
Chainguard mlflow-bitnami 0 2.13.1-r0
Chainguard mlflow-iamguarded-compat 0 2.13.1-r0
Chainguard nvidia-apex-12.3-wheel 0 24.04.01-r1
Chainguard open-webui 0 0.6.36-r0
Chainguard open-webui-compat 0 0.6.36-r0
Chainguard patroni 0 3.3.1-r0
Chainguard py3-cassandra-medusa 0 0.21.0-r2
Chainguard py3-cassandra-medusa 0 0.23.0-r30
Chainguard py3-cassandra-medusa-compat 0 0.21.0-r2
Chainguard py3-cassandra-medusa-compat 0 0.23.0-r30
Chainguard py3-pipenv 0 2024.4.1-r0
Chainguard py3-supported-pipenv 0 2024.4.1-r0
Chainguard py3.10-pipenv 0 2024.4.1-r0
Chainguard py3.10-pipenv-bin 0 2024.4.1-r0
Chainguard py3.10-tensorflow-core 0 2.16.1-r1
Chainguard py3.11-pipenv 0 2024.4.1-r0
Chainguard py3.11-pipenv-bin 0 2024.4.1-r0
Chainguard py3.11-pytorch-cuda-12.3 0 2.3.1-r6
Chainguard py3.11-torchaudio-cuda-12.3 0 2.3.1-r1
Chainguard py3.11-torchvision-cuda-11.8 0 0.18.1-r3
Chainguard py3.11-torchvision-cuda-12.3 0 0.18.1-r5
Chainguard py3.11-wheels-torch-cuda-12.3 0 2.3.1-r6
Chainguard py3.11-wheels-torchaudio-cuda-12.3 0 2.3.1-r1
Chainguard py3.11-wheels-torchvision-cuda-11.8 0 0.18.1-r3
Chainguard py3.11-wheels-torchvision-cuda-12.3 0 0.18.1-r5
Chainguard py3.12-pipenv 0 2024.4.1-r0
Chainguard py3.12-pipenv-bin 0 2024.4.1-r0
Chainguard py3.13-pipenv 0 2024.4.1-r0
Chainguard py3.13-pipenv-bin 0 2024.4.1-r0
Chainguard reflex 0 0.5.5-r0
Chainguard request-1276 0 0.21.0-r1
Chainguard request-1276 0 0.23.0-r0
Chainguard request-1276-compat 0 0.21.0-r1
Chainguard request-1276-compat 0 0.23.0-r0
Chainguard superset 0 4.0.1-r1
Chainguard superset-ci 0 4.0.1-r1
Chainguard superset-entrypoint 0 4.0.1-r1
Chainguard superset-iamguarded-compat 0 4.0.1-r1
Debian:11 requests 0 No fix
Debian:12 requests 0 No fix
Debian:13 requests 0 2.32.3+dfsg-1
Debian:14 requests 0 2.32.3+dfsg-1
Mageia:9 python-requests 0 2.32.3-1.mga9
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-venv-tower 0 0:4.5.7-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-controller-venv-tower 0 0:4.5.8-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 automation-hub 0 0:4.9.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-aiohttp 0 0:3.9.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-aiohttp-debuginfo 0 0:3.9.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-black 0 0:22.8.0-2.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-cryptography 0 0:42.0.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-cryptography-debuginfo 0 0:42.0.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-galaxy-ng 0 0:4.9.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-gunicorn 0 0:22.0.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-idna 0 0:3.7-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-jinja2 0 0:3.1.4-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-pillow 0 0:10.3.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-pillow-debuginfo 0 0:10.3.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-pydantic 0 0:1.10.15-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-requests 0 0:2.32.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-social-auth-app-django 0 0:5.4.1-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python39-sqlparse 0 0:0.5.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-aiohttp 0 0:3.9.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-aiohttp-debugsource 0 0:3.9.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-black 0 0:22.8.0-2.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-cryptography 0 0:42.0.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-cryptography-debugsource 0 0:42.0.5-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-galaxy-ng 0 0:4.9.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-gunicorn 0 0:22.0.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-idna 0 0:3.7-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-jinja2 0 0:3.1.4-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-pillow 0 0:10.3.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-pillow-debugsource 0 0:10.3.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-pydantic 0 0:1.10.15-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-requests 0 0:2.32.2-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-social-auth-app-django 0 0:5.4.1-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 python3x-sqlparse 0 0:0.5.0-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 receptor 0 0:1.4.8-1.el8ap
Red Hat:ansible_automation_platform:2.4::el8 receptorctl 0 0:1.4.8-1.el8ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-venv-tower 0 0:4.5.7-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-controller-venv-tower 0 0:4.5.8-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 automation-hub 0 0:4.9.2-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-aiohttp 0 0:3.9.5-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-aiohttp-debugsource 0 0:3.9.5-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-black 0 0:22.8.0-2.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-cryptography 0 0:42.0.5-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-cryptography-debugsource 0 0:42.0.5-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-galaxy-ng 0 0:4.9.2-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-gunicorn 0 0:22.0.0-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-idna 0 0:3.7-1.el9ap
Red Hat:ansible_automation_platform:2.4::el9 python-jinja2 0 0:3.1.4-1.el9ap

Related vulnerabilities