{"id":"CVE-2021-37694","aliases":["GHSA-xj6r-2jpm-qvxp"],"url":"https://o3.security/vulnerability/CVE-2021-37694","summary":"Code injection issue for java-spring-cloud-stream-template","details":"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```","published":"2021-08-11T18:15:07.403Z","modified":"2026-07-09T11:24:05.497496Z","cvss":{"score":7.8,"severity":"HIGH","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"},"epss":null,"cisaKev":null,"exploitsKnown":null,"affectedPackages":[{"ecosystem":"npm","name":"@asyncapi/java-spring-cloud-stream-template","fixedVersion":"0.7.0"}],"fix":null,"references":[{"type":"EVIDENCE","url":"https://github.com/asyncapi/java-spring-cloud-stream-template/security/advisories/GHSA-xj6r-2jpm-qvxp"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-37694"},{"type":"PACKAGE","url":"https://github.com/asyncapi/java-spring-cloud-stream-template"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-07-09T11:24:05.497496Z"}}