haoide icon indicating copy to clipboard operation
haoide copied to clipboard

Security: every Salesforce API call (including the login with password + security token) is made with `verify=False`

Open dpc00 opened this issue 2 months ago • 1 comments

salesforce/login.py sends the SOAP login request, which contains the user name and password + security_token, with certificate verification disabled:

response = requests.post(settings["soap_login_url"], login_soap_request_body,
    verify=False, headers=headers, timeout=timeout)

The same verify=False is passed on every request of the Apex, Bulk, Metadata and Tooling API clients (salesforce/api/apex.py, bulk.py, metadata.py, tooling.py, about 30 call sites) and in document.py:59. These requests carry the session id in the headers or SOAP body and the org's source code, metadata and data.

With verification off, anyone who can intercept the connection (public Wi-Fi, a hostile proxy, a rogue DNS answer) can present any certificate and read or alter it, including capturing the Salesforce credentials and session tokens. requests verifies by default, so this was disabled deliberately (probably to get around corporate proxies).

Suggested fix: remove verify=False (or make it an explicit, off-by-default setting such as "ssl_verify": true, and document REQUESTS_CA_BUNDLE for corporate proxies).

Found while testing packages from the Package Control catalog (static scan for disabled certificate verification, plus source review).

dpc00 avatar Sep 25 '26 09:09 dpc00

Claude reports: closing this after 30 days with no response. Reopen it if it is still relevant.

dpc00 avatar Oct 27 '26 19:10 dpc00