{"id":"CVE-2025-66305","aliases":["CVE-2025-66305","GHSA-m8vh-v6r6-w7p6"],"related":[],"kind":"vulnerability","state":"published","title":"Grav vulnerable to Denial of Service via Improper Input Handling in 'Supported' Parameter","summary":"Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a Denial of Service (DoS) vulnerability was identified in the \"Languages\" submenu of the Grav admin configuration panel (/admin/config/system). Specifically, the Supported parameter fails to properly validate user input. If a malformed value is inserted—such as a single forward slash (/) or an XSS test string—it causes a fatal regular expression parsing error on the server. This leads to application-wide failure due to the use of the preg_match() function with an improperly constructed regular expression, resulting in an error. Once triggered, the site becomes completely unavailable to all users. This vulnerability is fixed in 1.8.0-beta.27.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Grav is a file-based Web platform. Prior to 1.8.0-beta.27, a Denial of Service (DoS) vulnerability was identified in the \"Languages\" submenu of the Grav admin configuration panel (/admin/config/system). Specifically, the Supported parameter fails to properly validate user input. If a malformed value is inserted—such as a single forward slash (/) or an XSS test string—it causes a fatal regular expression parsing error on the server. This leads to application-wide failure due to the use of the preg_match() function with an improperly constructed regular expression, resulting in an error. Once triggered, the site becomes completely unavailable to all users. This vulnerability is fixed in 1.8.0-beta.27.","source":"cvelist"},{"lang":"en","text":"**Endpoint**: `admin/config/system`  \n**Submenu**: `Languages`  \n**Parameter**: `Supported`  \n**Application**: Grav v 1.7.48\n\n---\n\n## Summary\n\nA Denial of Service (DoS) vulnerability was identified in the **\"Languages\"** submenu of the Grav **admin configuration panel** (`/admin/config/system`). Specifically, the `Supported` parameter fails to properly validate user input. If a malformed value is inserted—such as a single forward slash (`/`) or an XSS test string—it causes a fatal regular expression parsing error on the server.\n\nThis leads to application-wide failure due to the use of the `preg_match()` function with an **improperly constructed regular expression**, resulting in the following error:\n\n`preg_match(): Unknown modifier 'o' File: /system/src/Grav/Common/Language/Language.php line 244`\n\nOnce triggered, the site becomes completely unavailable to all users.\n\n---\n\n## Details\n\n- **Vulnerable Endpoint**: `POST /admin/config/system`\n    \n- **Submenu**: `Languages`\n    \n- **Parameter**: `Supported`  \n    \n\nThe application dynamically constructs a regular expression using the contents of the `Supported` field without escaping the input using `preg_quote()` or proper validation. This allows attackers to inject invalid syntax into the regex engine, crashing the application during language resolution.\n\n**Stack trace excerpt**:\n\n`Whoops \\ Exception \\ ErrorException (E_WARNING) preg_match(): Unknown modifier 'o' /system/src/Grav/Common/Language/Language.php244`\n\n---\n\n## Proof of Concept (PoC)\n\n### Payloads:\n\n`/ `\n\n### Steps to Reproduce:\n\n1. Log into the Grav Admin Panel.\n    \n2. Navigate to: **Configuration** → **System** → **Languages**.\n    \n3. Locate the `Supported` field.\n    \n4. Insert one of the payloads above (e.g., a single slash `/`).\n    \n5. Click **Save**.\n\n<img width=\"1897\" height=\"639\" alt=\"Pasted image 20250719183223\" src=\"https://github.com/user-attachments/assets/d3a54a20-d30d-46c6-9015-722f80701cfb\" />\n\n1. Observe: All pages in the application begin throwing a fatal error and become inaccessible.\n\n<img width=\"1802\" height=\"998\" alt=\"Pasted image 20250719175229\" src=\"https://github.com/user-attachments/assets/b16750c2-507f-4c30-a9bb-d07fa92bb777\" />\n\n---\n\n## Impact\n\n- Application-wide Denial of Service (DoS)\n    \n- All login and admin views crash with the same error\n    \n- Potentially exploitable by:\n    \n    - Admin panel users\n        \n    - CSRF if misconfigured        \n    \n\n---\n\n## References\n\n- **CWE-1333**: Improper Regular Expression\n    \n- **CWE-20**: Improper Input Validation\n\n\n## Discoverer\n\n[Marcelo Queiroz](www.linkedin.com/in/marceloqueirozjr) \n\nby [CVE-Hunters](https://github.com/Sec-Dojo-Cyber-House/cve-hunters)","format":"markdown","source":"ghsa"},{"lang":"es","text":"Grav es una plataforma web basada en archivos. Versiones anteriores a la 1.8.0-beta.27, se identificó una vulnerabilidad de denegación de servicio (DoS) en el submenú 'Idiomas' del panel de configuración de administración de Grav (/admin/config/system). Específicamente, el parámetro Supported no valida correctamente la entrada del usuario. Si se inserta un valor malformado —como una sola barra inclinada (/) o una cadena de prueba XSS—, provoca un error fatal de análisis de expresión regular en el servidor. Esto conduce a una falla en toda la aplicación debido al uso de la función preg_match() con una expresión regular construida incorrectamente, lo que resulta en un error. Una vez activado, el sitio queda completamente no disponible para todos los usuarios. Esta vulnerabilidad se corrige en la 1.8.0-beta.27.","source":"nvd"}],"published":"2025-12-01T21:43:29.725Z","modified":"2026-09-10T03:50:58.807Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","score":6.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:H","rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H","score":4.9,"rating":"MEDIUM"}],"cwes":["CWE-248"],"affected":[{"ranges":[{"version":"< 1.8.0-beta.27","status":"affected"}],"vendor":"getgrav","product":"grav","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"1.8.0-beta.27"}],"ecosystem":"Packagist","package":"getgrav/grav","purl":"pkg:composer/getgrav/grav","source":"ghsa"},{"ranges":[{"status":"affected","introduced":"1.7.48","fixed":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"},{"status":"affected","version":"1.8.0"}],"vendor":"getgrav","product":"grav","cpe":"cpe:2.3:a:getgrav:grav:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/getgrav/grav/security/advisories/GHSA-m8vh-v6r6-w7p6","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/getgrav/grav/commit/ed640a13143c4177af013cf001969ed2c5e197ee","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66305","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/getgrav/grav","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2025-12-02T20:14:17.748Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-66305","url":"https://www.cve.org/CVERecord?id=CVE-2025-66305","licence":"CVE Terms of Use","modified":"2025-12-02T20:14:21.770Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-m8vh-v6r6-w7p6","url":"https://github.com/advisories/GHSA-m8vh-v6r6-w7p6","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:58.807Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-66305","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-66305","licence":"Public domain","modified":"2026-06-17T09:56:38.860Z"}],"updatedAt":"2026-11-25T22:59:08.146Z","epss":{"score":0.00414,"percentile":0.37699,"date":"2026-12-01T12:00:22.000Z"}}