{"answers":{"affected":"2 open source packages ship an affected version, including generator-jhipster. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24815 exists.","fix":"Upgrade generator-jhipster to 7.8.1 or later.","what":"CVE-2022-24815 is a high-severity SQL injection vulnerability in generator-jhipster, published on 11 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2022-24815 and fix it if it is affected.\n\nWhat it is: CVE-2022-24815 is a high-severity SQL injection vulnerability in generator-jhipster, published on 11 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2022-24815 exists.\n\nAffected packages and fixed versions:\n- generator-jhipster (npm): affected from 7.0.0; fixed in 7.8.1\n- generator-jhipster (npm): affected from 7.0.0; fixed in 7.8.1\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-2022-24815/ (Markdown: https://insights.sbomify.com/CVE-2022-24815/index.md)","id":"CVE-2022-24815","markdown":"https://insights.sbomify.com/CVE-2022-24815/index.md","name":"CVE-2022-24815","record":{"aliases":["GHSA-qjmq-8hjr-qcv6"],"analysis":{"component_type":"developer_tool","fix_type":"upgrade","impacts":["data_read","data_modify"],"network_reachable":"yes","non_default_config":true,"product_category":"JHipster code generator","requires_auth":"none","summary":"Attackers can execute arbitrary SQL commands in JHipster-generated reactive applications using Spring WebFlux and R2DBC due to unsanitized criteria inputs.","user_interaction":"not_required","vuln_class":"sql_injection"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"GitHub_M","cpe":[{"product":"generator-jhipster","vendor":"jhipster"}],"cvss":{"score":8.1,"severity":"high","source":"cna","vector":"CVSS:3.1/AV:N/AC:H/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":"JHipster is a development platform to quickly generate, develop, \u0026 deploy modern web applications \u0026 microservice architectures. SQL Injection vulnerability in entities for applications generated with the option \"reactive with Spring WebFlux\" enabled and an SQL database using r2dbc. Applications created without \"reactive with Spring WebFlux\" and applications with NoSQL databases are not affected. Users who have generated a microservice Gateway using the affected version may be impacted as Gateways are reactive by default. Currently, SQL injection is possible in the findAllBy(Pageable pageable, Criteria criteria) method of an entity repository class generated in these applications as the where clause using Criteria for queries are not sanitized and user input is passed on as it is by the criteria. This issue has been patched in v7.8.1. Users unable to upgrade should be careful when combining criterias and conditions as the root of the issue lies in the `EntityManager.java` class when creating the where clause via `Conditions.just(criteria.toString())`. `just` accepts the literal string provided. Criteria's `toString` method returns a plain string and this combination is vulnerable to sql injection as the string is not sanitized and will contain whatever used passed as input using any plain SQL.","ecosystems":["npm"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"SQL Injection when creating an application with Reactive SQL backend","id":"CVE-2022-24815","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"npm","product":null,"products":[],"type":"sql_injection","year":"2022"},"n_packages":2,"n_references":3,"next":{"headline":"OSGeo GeoServer JAI-EXT Code Injection","id":"CVE-2022-24816"},"packages":[{"ecosystem":"npm","fixed":["7.8.1"],"introduced":["7.0.0"],"last_affected":[],"package":"generator-jhipster","purl":null,"source":"GHSA-qjmq-8hjr-qcv6"},{"ecosystem":"npm","fixed":["7.8.1"],"introduced":["7.0.0"],"last_affected":[],"package":"generator-jhipster","purl":"pkg:npm/generator-jhipster","source":"GHSA-qjmq-8hjr-qcv6"}],"prev":{"headline":"Cross-site Scripting in Directus","id":"CVE-2022-24814"},"products":["generator-jhipster"],"published":"2022-04-11","related":[],"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":"no","exploitation":"poc","technical_impact":"total"},"state":"PUBLISHED","updated":"2025-04-22","vendors":["jhipster"]},"summary":"Attackers can execute arbitrary SQL commands in JHipster-generated reactive applications using Spring WebFlux and R2DBC due to unsanitized criteria inputs.","url":"https://insights.sbomify.com/CVE-2022-24815/"}