CVE-2024-37906: Admidio/admidio SQL Injection Vulnerability

CRITICAL
Advisory Identifier: GHSA-69wx-xc6j-28v3
CVSS 9.9
CWE-89
Published
Advisory Summary

CVE-2024-37906 is a CRITICAL (CVSS 9.9) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Admidio/admidio libraries in the Packagist ecosystem. The issue involves admidio has blind sql injection in ecard_send.php. Remediation is available by upgrading affected packages to version 4.3.9.

CVE-2024-37906 at a Glance

CVE Identifier CVE-2024-37906
GHSA Identifier GHSA-69wx-xc6j-28v3
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Admidio/admidio
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2024-37906

To remediate this vulnerability, upgrade all affected Admidio/admidio dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

admidio/admidio fixed: 4.3.9
Upgrade admidio/admidio to 4.3.9
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for admidio/admidio

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-37906, inspect your project dependencies for Admidio/admidio:

inspect dependencies for admidio/admidio

Analyze the terminal output to locate any version of Admidio/admidio in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.9), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Admidio/admidio, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Description: An SQL Injection has been identified in the `/adm_program/modules/ecards/ecard_send.php` source file of the Admidio Application. The SQL Injection results in a compromise of the application's database. The value of `ecard_recipients `POST parameter is being directly concatenated with the SQL query in the source code causing the SQL Injection. The SQL Injection can be exploited by a member user, using blind condition-based, time-based, and Out of band interaction SQL Injection payloads. I successfully exploited SQL Injections by causing Time Delays. Advancing the payload, I was able to exfiltrate data from the database based on trial and error conditions and step-wise enumerating the characters of the database name. This was done as a POC of SQL Injection. An attacker could simply drop the database by providing a single payload, steal data, and potentially update the database according to their will. ### Impact: SQL injection (SQLi) vulnerabilities can have serious consequences for the security of a web application and its underlying database. Attackers can use SQLi to access sensitive data, and modify, delete, or add data to the database. SQLi can also be potentially used to perform RCE. ### Remediation: Use parameterized queries or prepared statements instead of concatenating user input directly into SQL queries. Parameterized queries ensure that user input is treated as data and not executable queries. OR Sanitize the input before including it in the SQL Query. ### Steps to Reproduce: - Intercept the POST request to `/adm_program/modules/ecards/ecard_send.php`, which is used to send photo as greeting card. - Change the value of `ecard_recipients%5B%5D` POST parameter to `2%2bsleep(10)`. - Sending the request will cause a time delay. ### Proof Of Concept: ![image](https://github.com/Admidio/admidio/assets/59286712/8ea87f4f-dad0-4df1-999d-212b07e02527) Figure 1: Code Vulnerable to SQL Injection ![image](https://github.com/Admidio/admidio/assets/59286712/d803a92c-3469-45aa-a844-e8aa311b55f4) Figure 2: Code Vulnerable to SQL Injection ![image](https://github.com/Admidio/admidio/assets/59286712/2ccdf865-2867-4dc8-abe1-f25b5e906db3) Figure 3: SQLi to trigger time delay ![image](https://github.com/Admidio/admidio/assets/59286712/eed06ce6-6591-427f-b98e-5314233b5996) Figure 4: Data Exfiltration via Condition-based Time Delays

CVE-2024-37906 Affected Admidio/admidio Versions

1 component(s)
Fixed Versions:
4.3.9
Product / Package Ecosystem Affected Versions Fixed Version
admidio/admidio
Packagist
< 4.3.9
4.3.9

References

Frequently Asked Questions

What is CVE-2024-37906?
CVE-2024-37906 is a security vulnerability in Admidio/admidio involving Admidio has Blind SQL Injection in ecard_send.php under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Admidio/admidio versions are affected?
Affected versions include releases prior to 4.3.9 across affected packages: admidio/admidio.
What version fixes CVE-2024-37906?
Upgrading to 4.3.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is admidio/admidio affected?
Yes, admidio/admidio is affected in releases prior to 4.3.9. Upgrade your dependency to 4.3.9 or later.
What is the CVSS score of CVE-2024-37906?
CVE-2024-37906 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2024-37906?
CVE-2024-37906 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2024-37906?
Run the dependency tree command: 'inspect dependencies for admidio/admidio'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-69wx-xc6j-28v3",
  "modified" : "2024-07-29T16:31:46Z",
  "published" : "2024-07-29T16:31:46Z",
  "aliases" : [ "CVE-2024-37906" ],
  "summary" : "Admidio has Blind SQL Injection in ecard_send.php",
  "details" : "### Description:\nAn SQL Injection has been identified in the `/adm_program/modules/ecards/ecard_send.php` source file of the Admidio Application. The SQL Injection results in a compromise of the application's database. The value of `ecard_recipients `POST parameter is being directly concatenated with the SQL query in the source code causing the SQL Injection.\n\nThe SQL Injection can be exploited by a member user, using blind condition-based, time-based, and Out of band interaction SQL Injection payloads. I successfully exploited SQL Injections by causing Time Delays. Advancing the payload, I was able to exfiltrate data from the database based on trial and error conditions and step-wise enumerating the characters of the database name. This was done as a POC of SQL Injection. An attacker could simply drop the database by providing a single payload, steal data, and potentially update the database according to their will. \n\n### Impact:\nSQL injection (SQLi) vulnerabilities can have serious consequences for the security of a web application and its underlying database. Attackers can use SQLi to access sensitive data, and modify, delete, or add data to the database. SQLi can also be potentially used to perform RCE. \n\n### Remediation:\nUse parameterized queries or prepared statements instead of concatenating user input directly into SQL queries. Parameterized queries ensure that user input is treated as data and not executable queries. \nOR \nSanitize the input before including it in the SQL Query.\n\n### Steps to Reproduce:\n- Intercept the POST request to `/adm_program/modules/ecards/ecard_send.php`, which is used to send photo as greeting card.\n- Change the value of `ecard_recipients%5B%5D` POST parameter to `2%2bsleep(10)`.\n- Sending the request will cause a time delay.\n\n### Proof Of Concept:\n\n![image](https://github.com/Admidio/admidio/assets/59286712/8ea87f4f-dad0-4df1-999d-212b07e02527)\nFigure 1: Code Vulnerable to SQL Injection\n\n![image](https://github.com/Admidio/admidio/assets/59286712/d803a92c-3469-45aa-a844-e8aa311b55f4)\nFigure 2: Code Vulnerable to SQL Injection\n\n![image](https://github.com/Admidio/admidio/assets/59286712/2ccdf865-2867-4dc8-abe1-f25b5e906db3)\nFigure 3: SQLi to trigger time delay\n\n![image](https://github.com/Admidio/admidio/assets/59286712/eed06ce6-6591-427f-b98e-5314233b5996)\nFigure 4: Data Exfiltration via Condition-based Time Delays",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "admidio/admidio"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/security/advisories/GHSA-69wx-xc6j-28v3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-37906"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Admidio/admidio/commit/3ff02b0c64a6911ab3e81cd61077f392c0b25248"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Admidio/admidio"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-29T16:31:46Z",
    "nvd_published_at" : "2024-07-29T15:15:10Z"
  }
}