GitHub Advisoryadvisory · npm
GHSA-xj6r-2jpm-qvxp Code injection issue for java-spring-cloud-stream-template
HIGH
Official page ↗
- Aliases
- CVE-2021-37694
- Ecosystem
- npm
- Packages
- @asyncapi/java-spring-cloud-stream-template
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:H/I:H/A:N
- Weaknesses
- CWE-94
- Reviewed
- 2021-08-24
Affected packages
• npm @asyncapi/java-spring-cloud-stream-template: < 0.7.0 → fixed in 0.7.0
Description
The following was initially reported by @jonaslagoni:
Given the following command:
`ag ./dummy.json @asyncapi/java-spring-cloud-stream-template --force-write --output ./output`
With the following AsyncAPI document:
```json
{
"asyncapi": "2.0.0",
"info": {
"title": "Streetlight",
"version": "1.0.0"
},
"defaultContentType": "json",
"channels": {
"security/audit/channel": {
"description": "Channel for the turn on command which should turn on the streetlight",
"parameters": {
"streetlight_id": {
"description": "The ID of the streetlight",
"schema": {
"type": "string"
}
}
},
"publish": {
"operationId": "test() { System.out.println(\"injected\"); return test(0); }\n public Consumer someothername",
"message": {
"name": "TurnonCommand",
"payload": {
"$ref": "#/components/schemas/CustomClass"
}
}
}
}
},
"components": {
"schemas" : {
"CustomClass": {
"type": "object",
"properties": {
"prop": {
"type": "string"
}
}
}
}
}
}
```
Which changes the following output:
```java
...
@Bean
public Consumer test() {
// Add business logic here.
return null;
}
...
```
To
```java
...
@Bean
public Consumer test() { System.out.println("injected"); return someothername(); }
public Consumer someothername() {
// Add business logic here.
return null;
}
...
```
Related
Alias · CVE (1)
- CVE-2021-37694 @asyncapi/java-spring-cloud-stream-template generates a Spring Cloud Stream (SCSt) microservice. vulnerability
Weakness · CWE (1)
- CWE-94 Improper Control of Generation of Code weakness