{"answers":{"affected":"12 open source packages ship an affected version, including cakephp/cakephp and cakephp/database. It affects 1 product.","exploited":"There is no known exploitation of CVE-2023-22727 in the wild and no public exploit code.","fix":"Upgrade cakephp/cakephp to a fixed version for your release line: 4.2.12, 4.3.11 or 4.4.10.","what":"CVE-2023-22727 is a critical SQL injection vulnerability in cakephp, published on 17 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2023-22727 and fix it if it is affected.\n\nWhat it is: CVE-2023-22727 is a critical SQL injection vulnerability in cakephp, published on 17 Jan 2023. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of CVE-2023-22727 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- cakephp/cakephp (Packagist): affected from 4.2.0; fixed in 4.2.12\n- cakephp/cakephp (Packagist): affected from 4.2.0; fixed in 4.2.12\n- cakephp/cakephp (Packagist): affected from 4.3.0; fixed in 4.3.11\n- cakephp/cakephp (Packagist): affected from 4.3.0; fixed in 4.3.11\n- cakephp/cakephp (Packagist): affected from 4.4.0; fixed in 4.4.10\n- cakephp/cakephp (Packagist): affected from 4.4.0; fixed in 4.4.10\n- cakephp/database (Packagist): affected from 4.2.0; fixed in 4.2.12\n- cakephp/database (Packagist): affected from 4.2.0; fixed in 4.2.12\n- cakephp/database (Packagist): affected from 4.3.0; fixed in 4.3.11\n- cakephp/database (Packagist): affected from 4.3.0; fixed in 4.3.11\n- cakephp/database (Packagist): affected from 4.4.0; fixed in 4.4.10\n- cakephp/database (Packagist): affected from 4.4.0; fixed in 4.4.10\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2023-22727/ (Markdown: https://insights.sbomify.com/CVE-2023-22727/index.md)","id":"CVE-2023-22727","markdown":"https://insights.sbomify.com/CVE-2023-22727/index.md","name":"CVE-2023-22727","record":{"aliases":["GHSA-6g8q-qfpv-57wp","UBUNTU-CVE-2023-22727"],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP web framework","requires_auth":"none","summary":"Attackers can execute arbitrary SQL commands via unsanitized input in CakePHP's limit and offset methods, risking data exposure or modification.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"cakephp","vendor":"cakephp"}],"cvss":{"score":9.8,"severity":"critical","source":"cna","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","version":"3.1"},"cwes":[{"id":"CWE-89","name":"Improper Neutralization of Special Elements used in an SQL Command"}],"description":"CakePHP is a development framework for PHP web apps. In affected versions the `Cake\\Database\\Query::limit()` and `Cake\\Database\\Query::offset()` methods are vulnerable to SQL injection if passed un-sanitized user request data. This issue has been fixed in 4.2.12, 4.3.11, 4.4.10. Users are advised to upgrade. Users unable to upgrade may mitigate this issue by using CakePHP's Pagination library. Manually validating or casting parameters to these methods will also mitigate the issue.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Database Query::offset() and limit() vulnerable to SQL injection in cakephp","id":"CVE-2023-22727","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"sql_injection","year":"2023"},"n_packages":12,"n_references":3,"next":{"headline":"Silverstripe Framework has missing permission check of canView in GridFieldPrintButton","id":"CVE-2023-22728"},"packages":[{"ecosystem":"Packagist","fixed":["4.2.12"],"introduced":["4.2.0"],"last_affected":[],"package":"cakephp/cakephp","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.2.12"],"introduced":["4.2.0"],"last_affected":[],"package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.3.11"],"introduced":["4.3.0"],"last_affected":[],"package":"cakephp/cakephp","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.3.11"],"introduced":["4.3.0"],"last_affected":[],"package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.4.10"],"introduced":["4.4.0"],"last_affected":[],"package":"cakephp/cakephp","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.4.10"],"introduced":["4.4.0"],"last_affected":[],"package":"cakephp/cakephp","purl":"pkg:composer/cakephp/cakephp","source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.2.12"],"introduced":["4.2.0"],"last_affected":[],"package":"cakephp/database","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.2.12"],"introduced":["4.2.0"],"last_affected":[],"package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.3.11"],"introduced":["4.3.0"],"last_affected":[],"package":"cakephp/database","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.3.11"],"introduced":["4.3.0"],"last_affected":[],"package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.4.10"],"introduced":["4.4.0"],"last_affected":[],"package":"cakephp/database","purl":null,"source":"GHSA-6g8q-qfpv-57wp"},{"ecosystem":"Packagist","fixed":["4.4.10"],"introduced":["4.4.0"],"last_affected":[],"package":"cakephp/database","purl":"pkg:composer/cakephp/database","source":"GHSA-6g8q-qfpv-57wp"}],"prev":{"headline":"Unrestricted file upload leading to privilege escalation in act","id":"CVE-2023-22726"},"products":["cakephp"],"published":"2023-01-17","related":[{"cvss_score":8.8,"headline":"CakePHP allows method override parameters to bypass CSRF checks","id":"CVE-2020-35239","kev_date_added":null,"published":"2021-01-20"},{"cvss_score":8.8,"headline":"CakePHP might allow remote attackers to bypass CSRF protection mechanism via the _method parameter","id":"CVE-2015-8379","kev_date_added":null,"published":"2016-01-26"},{"cvss_score":7.5,"headline":"Unsafe deserialization in SmtpTransport in CakePHP","id":"CVE-2019-11458","kev_date_added":null,"published":"2019-05-08"},{"cvss_score":7.5,"headline":"CakePHP allows remote attackers to spoof their IP","id":"CVE-2016-4793","kev_date_added":null,"published":"2017-01-23"},{"cvss_score":5.4,"headline":"CakePHP PaginatorHelper::limitControl() vulnerable to reflected cross-site-scripting","id":"CVE-2026-23643","kev_date_added":null,"published":"2026-01-16"},{"cvss_score":5.1,"headline":"CakePHP: Open redirect weakness via backslash bypass","id":"CVE-2026-55590","kev_date_added":null,"published":"2026-07-09"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"yes","exploitation":"none","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-03-10","vendors":["cakephp"]},"summary":"Attackers can execute arbitrary SQL commands via unsanitized input in CakePHP's limit and offset methods, risking data exposure or modification.","url":"https://insights.sbomify.com/CVE-2023-22727/"}