New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG][SECURITY][CVE-2019-11405] Code generator generates projects with insecure repositories #2253
Comments
|
@JLLeitschuh thanks for reporting the issue. I've filed a PR (#2248) to update those URLs to use https instead of http |
|
Hey @wing328 I just found more examples:
openapi-generator/samples/server/petstore/finch/build.sbt Lines 13 to 19 in 0eb385c
What is our public disclosure plan on this? Am I filing for the CVE number or will you? |
|
I've filed #2697 to update the samples. Please file the CVE as I'm not familiar with the procedure. |
|
@wing328 There may be issues with Java 6 not supporting certain TLS algorithms that maven central requires. You may straight up not be able to support Java 6 with HTTPS for JCenter. I don't know. Related scala/sbt-scala-module#41 Also, what version is this officially fixed in for the CVE writeup. |
|
The CVE number has been issued for this vulnerability. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-11405 This is the current description:
I've asked the CVE team to update the description to better reflect how this impacts downstream users. I think the way it's currently stated, it implies that this may have impacted the OpenAPI's releases. Instead, it needs to reflect how this impacts users who are using this project to generate code and may be impacted. |
|
@JLLeitschuh: This is an interesting finding. Thank you for the analysis and the report. The 2 PRs filed to fix this only changes stuff to our samples or templates. This means that prior this version, if you were generating projects with OpenAPI-Generator then you could end up with a pom/gradle/sbt file referencing a For our own binaries, hosted under http://central.maven.org/maven2/org/openapitools/ it seems to me that our poms (and gradle file for the gradle plugin) are using |
Correct, hence the CVE number. This should be resolved now. It's been a pleasure working with @wing328 on this. Here's my publication about this industry-wide vulnerability:
|

CWE-829: Inclusion of Functionality from Untrusted Control Sphere
CWE-494: Download of Code Without Integrity Check
This project is generating starter projects that are resolving dependencies over HTTP instead of HTTPS.
Additionally, the sample associated with this project are vulnerable to this as well. Any of these artifacts could have been MITM to maliciously compromise them and infect the build artifacts that were produced. Additionally, if any of these JARs or other dependencies were compromised, any developers using these could continue to be infected past updating to fix this.
This vulnerability has a CVSS v3.0 Base Score of 8.1/10
https://nvd.nist.gov/vuln-metrics/cvss/v3-calculator?vector=AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
This isn't just theoretical
POC code has existed since 2014 to maliciously compromise a JAR file inflight.
See:
MITM Attacks Increasingly Common
See:
Source Locations
openapi-generator/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache
Lines 11 to 13 in c1afba7
openapi-generator/modules/openapi-generator/src/main/resources/Groovy/build.gradle.mustache
Lines 22 to 23 in c1afba7
openapi-generator/modules/openapi-generator/src/main/resources/kotlin-server/libraries/ktor/build.gradle.mustache
Lines 60 to 61 in 0eb385c
There are definitely more locations that I've listed here. I know that @wing328 has caught many of them here #2248. I just ask that the team take an extra sweep to check for this anywhere else and be aware of it in future PR's.
Public Disclosure
This issue requires public disclosure as it impacts users that have used this project to generate their starter projects.
A project maintainer needs to file for a CVE number to inform the public about this vulnerability.
If a maintainer on this project works for or is associated with a CNA, please have them file it with them:
cve.mitre.org/cve/request_id.html
Otherwise, an open source CVE should be filed for here:
iwantacve.org
The text was updated successfully, but these errors were encountered: