-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"Line 6654 of `htdocs/core/class/commonobject.class.php` reads:\n\n```php\n$this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');\n```\n\n`dol_eval` is Dolibarr's wrapper around PHP's native `eval()`. The fourth argument is named `$onlysimplestring` in the function signature, and the docblock identifies mode `'2'` as \"used for example for the compute property of extrafields.\" The string handed to the wrapper is the `computed` attribute of an extrafield, an administrator-configured value stored in the `fieldcomputed` column of `llx_extrafields`. `fetch_optionals()` runs every time Dolibarr loads a business object. CVE-2026-37713 is what happens when an administrator writes `phpversion()` into that column and any authenticated user opens a societe card.\n\nThis is the sixth CVE filed against `dol_eval` since 2022. Each of the preceding five was fixed by adding names to a deny list. The list now contains seventy function names. The call at line 6654 still runs.\n\n## The four sinks are the CRUD cycle\n\nThe `computed` extrafield expression is not evaluated once. It is evaluated by four call sites in `commonobject.class.php`, each gating a different verb of the object lifecycle:\n\n```php\n// Line 6654, inside fetch_optionals():\n$this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');\n\n// Line 6783, inside insertExtraFields():\n$value = dol_eval((string) $attrfieldcomputed, 1, 0, '2');\n\n// Line 7232, inside updateExtraField():\n$value = dol_eval((string) $attrfieldcomputed, 1, 0, '2');\n\n// Line 8549, inside showOutputField():\n$value = dol_eval((string) $computed, 1, 0, '2');\n```\n\n`fetch_optionals` is read. `insertExtraFields` is create. `updateExtraField` is update. `showOutputField` is display. The four CRUD operations exposed by Dolibarr's base business-object class are four eval sinks for the same administrator-controlled string. Whichever verb the next authenticated request happens to execute, the stored expression runs against the same `eval()` with the same mode.\n\nThe mode itself is documented as a use-case selector, not a security level:\n\n```php\n/**\n * @param string $onlysimplestring '0' (deprecated, do not use it anymore) = Accept all chars,\n * '1' (most common use) = Accept only simple string with char 'a-z0-9\\s^$_+-.*>&|=!?():\"\\',/@';',\n * '2' (used for example for the compute property of extrafields) = Accept also '<[]'\n */\nfunction dol_eval($s, $returnvalue = 1, $hideerrors = 1, $onlysimplestring = '1')\n```\n\nMode `'2'` exists because the `computed` extrafield UI advertises array indexing and comparison operators. The mode parameter widens the allowed character set to make the legitimate use case parseable. The mode is not a security control. It is a notation for which feature the call site is supporting.\n\n## The security boundary is a regex\n\n`dol_eval_standard` performs no parsing of the input. It treats the input as a character set:\n\n```php\n$specialcharsallowed = '^$_+-.*>&|=!?():\"\\',/@';\nif ($onlysimplestring == '2') {\n $specialcharsallowed .= '<[]';\n}\nif (preg_match('/[^a-z0-9\\s'.preg_quote($specialcharsallowed, '/').']/i', $s)) {\n return 'Bad string syntax to evaluate ...';\n}\n```\n\nAnything composed of those characters survives the gate. After the character-set check, a second pass walks a deny list of function and identifier names by case-insensitive substring match:\n\n```php\n$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array(\"function\", \"call_user_func\", \"call_user_func_array\"));\n$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array(\"array_map\", \"array_walk\", \"preg_replace_callback\", \"usort\", \"uasort\", \"uksort\", /* ... */));\n$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array(\"exec\", \"passthru\", \"shell_exec\", \"system\", \"proc_open\", \"popen\"));\n$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array(\"eval\", \"create_function\", \"assert\", \"mb_ereg_replace\"));\n$forbiddenphpfunctions = array_merge($forbiddenphpfunctions, array(\"chdir\", \"fopen\", \"file_get_contents\", \"file_put_contents\", \"mkdir\", \"unlink\", /* ... */));\n```\n\nWhat the deny list does not contain is the rest of the PHP standard library. `phpversion()` is not on the list. Neither is `header()`. Neither is `setcookie()`. Neither is `unserialize()`. The input `phpversion()` clears the character-set regex (only lowercase letters and parentheses) and clears the deny-list scan (the substring `phpversion` matches none of the blocked identifiers). What runs is:\n\n```php\n$tmps = $hideerrors ? @eval('return ' . $s . ';') : eval('return ' . $s . ';');\n```\n\n`return phpversion();` returns the PHP version. Substitute `unserialize($_COOKIE[\"x\"])` and the deny list refuses it on the `_COOKIE` superglobal entry; substitute the unserialize of a property on a value the eval scope already exports (`$user`, `$conf`, `$object`, all `global`-declared at the top of `dol_eval_standard` so they reach the interpreter), and the list does not.\n\n## The injection lives in the database\n\nWriting the payload is a database write. The admin UI offers it at Setup → Extrafields → Computed value. The SQL form is one statement:\n\n```sql\nUPDATE llx_extrafields\nSET fieldcomputed = 'phpversion()'\nWHERE name = 'rce_test' AND elementtype = 'societe';\n```\n\nThe trigger is any authenticated request that loads, creates, updates, or displays an object with the extrafield. The simplest path is the societe card:\n\n```bash\ncurl -b \"DOLSESSID_xxx=...\" \\\n \"https://target/societe/card.php?id=1\"\n```\n\n`fetch_optionals(1)` runs. Line 6654 reads `'phpversion()'` from the database. `dol_eval` admits it. PHP evaluates it. The version string appears in the rendered HTML where the extrafield's value cell would normally appear.\n\nThe injection requires administrator privileges. The trigger does not. Any authenticated user is sufficient to execute the stored expression, including users whose role explicitly excludes administrative permission. The CVSS vector on the public record reads `AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L`. PR:N is true for the trigger and false for the injection. The vector has no notation for \"stored eval injection from a privileged role, executed against every subsequent unprivileged caller.\" It collapses the two halves into the half that scores higher.\n\n## The deny list is the patch series\n\nFive CVEs have been filed against `dol_eval` between 2022 and 2026. Each one was a known-bypass against the deny list. Each fix was an extension of the deny list.\n\n| Year | CVE | Bypass | Fix |\n|------|-----|--------|-----|\n| 2022 | CVE-2022-0819 | Direct call to disallowed function | Deny-list addition |\n| 2022 | CVE-2022-40871 | Database-stored payload via verifCond | Deny-list addition |\n| 2024 | CVE-2024-40137 | Functions not in deny list | Deny-list addition |\n| 2025 | CVE-2025-56588 | `array_map` and callable-accepting helpers | Deny-list addition (commit `b03f30c7e`) |\n| 2026 | CVE-2026-22666 | Dynamic callable syntax `('exec')('id')` | Deny-list addition |\n\nThe 2025 fix is the cleanest illustration. Commit `b03f30c7e` modified `dol_eval_standard`'s deny list. The commit modified no call site. The `dol_eval` invocations that reached the function survived the patch unchanged. They survive in v22.0.4. CVE-2026-37711 is one of them; CVE-2026-37713 is another.\n\nThe shape across all five is identical: append rows to `$forbiddenphpfunctions`. The shape produces a deny list of seventy entries and a call to PHP's `eval()` that has not moved. The next CVE is the next PHP standard-library identifier that clears both the character-set regex and the substring check. The substring check operates on function names rather than on the capabilities those functions expose, so the next entry is whatever the next researcher finds first. `dol_eval` is a design-debt-driver in the form of a single function: the substrate is the choice to interpret administrator-controlled strings via PHP's `eval()`, and `eval()` is the unpatchable-primitive at the bottom of the wrapper that every patch closes a path to without removing a path to. ActiveMQ's BrokerView shipped a [fourteen-row transport deny list](/posts/activemq-cve-2026-40466-row-two) that got two CVE numbers and twelve \"part 2\" pull requests for the same reason: when the boundary is a list of forbidden names, the list extends until the namespace runs out.\n\n## The chain is in the same disclosure\n\nThe two siblings of CVE-2026-37713 are also in v22.0.4 and also unpatched. CVE-2026-37711 is the same shape against the `perms` extrafield: 31 `dol_eval` sites the 2025 patch did not touch, with mode `'1'` instead of `'2'`. CVE-2026-37712 is unrelated to `dol_eval` and unrelated to a deny list. Cron jobs accept `methodename='system'` and `params='id'` and pass them directly to `call_user_func_array` with no allowlist and no deny list. CVE-2026-37712 supplies the OS-command primitive that the CVE-2026-37713 deny list refuses. Both are unfixed against the same admin role.\n\nThe CVSS vector on CVE-2026-37713 reads `C:L/I:L/A:L` because the deny list blocks `system` and `exec` and `file_get_contents` and the score author imagined the bug as PHP-bounded code execution. Chained against CVE-2026-37712, the bounded primitive becomes unbounded. The two CVE records score the two halves separately. The chain is not on either record.\n\n## The vendor closed the report\n\nThe disclosure timeline reported by the researcher is on the public record:\n\n| Date | Event |\n|------|-------|\n| 2026-02-24 | First contact, 90-day clock starts |\n| 2026-02-28 to 03-02 | Lab reproduction confirmed by maintainer |\n| 2026-03-10 | Maintainer closes the three advisories citing \"high level of non valid report\"; researcher blacklisted |\n| 2026-03-13 | GitHub Security Advisory Database declines CVE assignment |\n| 2026-04-10 | MITRE Primary assigns CVE-2026-37711, CVE-2026-37712, CVE-2026-37713 |\n| 2026-05-25 | Public disclosure at the 90-day deadline |\n\n\"High level of non valid report\" is the maintainer's only public response. No technical refutation followed. GitHub declined the advisory. MITRE assigned over the closure forty-seven days later. The full lineage analysis was [published by bryamzxz on 2026-05-25](https://bryamzxz.github.io/2026/05/25/dol_eval-five-years/), the day the 90-day clock expired. The three CVEs were assigned by MITRE; the patch is not.\n\n## The eval() call is the boundary\n\nThe deny list is not the security boundary. The character-set regex is not the security boundary. The mode parameter is not a security boundary. The security boundary in `commonobject.class.php` is the design choice to interpret an attacker-controllable string with PHP's `eval()`, and that boundary has been the same boundary across five CVEs and four years.\n\nFive CVEs across four years added rows to a deny list. None of them removed a call to PHP's `eval()`. CVE-2026-37713 is unfixed at the time of disclosure. The next entry in the deny list is the next CVE.","closing_line":"The deny list adds rows. The eval() call does not move.","hook_md":"Line 6654 of `htdocs/core/class/commonobject.class.php` reads:\n\n```php\n$this->array_options['options_' . $key] = dol_eval((string) $extrafields->attributes[$this->table_element]['computed'][$key], 1, 0, '2');\n```\n\n`dol_eval` is Dolibarr's wrapper around PHP's native `eval()`. The fourth argument is named `$onlysimplestring` in the function signature, and the docblock identifies mode `'2'` as \"used for example for the compute property of extrafields.\" The string handed to the wrapper is the `computed` attribute of an extrafield, an administrator-configured value stored in the `fieldcomputed` column of `llx_extrafields`. `fetch_optionals()` runs every time Dolibarr loads a business object. CVE-2026-37713 is what happens when an administrator writes `phpversion()` into that column and any authenticated user opens a societe card.\n\nThis is the sixth CVE filed against `dol_eval` since 2022. Each of the preceding five was fixed by adding names to a deny list. The list now contains seventy function names. The call at line 6654 still runs.","post_id":628,"slug":"dolibarr-cve-2026-37713-eval-call-did-not-move","title":"CVE-2026-37713: Five Years Of Patches Grew Dolibarr's Deny List. The eval() Call Did Not Move.","type":"initial","unreadable_sentence":"Five CVEs across four years added rows to a deny list. None of them removed a call to PHP's `eval()`."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCatu3OQAKCRDeZjl4jgkQ JvUVAQCwzqc52yCWTYGIHxwS+LQOj54Ul3S0vWp4QdFLbI5JdQD/W8OE1KRgrn7Y S/JTJuPom7Zlm73wwb3+WPQGvPQerwE= =pFvl -----END PGP SIGNATURE-----