Update module github.com/getkin/kin-openapi to v0.131.0 [SECURITY] #236
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
v0.123.0
->v0.131.0
GitHub Vulnerability Alerts
CVE-2025-30153
Summary
When validating a request with a multipart/form-data schema, if the OpenAPI schema allows it, an attacker can upload a crafted ZIP file (e.g., a ZIP bomb), causing the server to consume all available system memory.
Details
The root cause comes from the ZipFileBodyDecoder, which is registered automatically by the module (contrary to what the documentation says.
PoC
To reproduce the vulnerability, you can use the following OpenAPI schema:
And this code to validate the request (nothing fancy, it basically only calls the
openapi3filter.ValidateRequest
function`):We also need to create a zip bomb. This command will create a 4.7GB file and compress it to to 4.7MB zip archive:
Run the PoC provided, and upload the zip bomb with
curl localhost:8080/ -F file="@​/tmp/bomb.zip;type=application/zip" -v
.Observe the memory consumption of the test server during and after the upload (it jumped to a bit over 22GB in my testing, with only a 4.7MB input file, you can reduce the size of the generated file to not kill your test machine when reproducing.)
Impact
An attacker can trigger an out-of-memory (OOM) condition, leading to server crashes or degraded performance.
It seems to only be exploitable if the OpenAPI schema allows for multipart upload.
Remediation
I see at least 2 potential fixes/improvements:
ZipFileBodyDecoder
to enforce a maximum size of the decompressed archive and bailout as soon as it's reached (probably with a small default value and allow the users to configure it through the input options ?)Release Notes
getkin/kin-openapi (github.com/getkin/kin-openapi)
v0.131.0
Compare Source
What's Changed
Full Changelog: getkin/kin-openapi@v0.130.0...v0.131.0
v0.130.0
Compare Source
What's Changed
New Contributors
Full Changelog: getkin/kin-openapi@v0.129.0...v0.130.0
v0.129.0
Compare Source
What's Changed
x-www-form-urlencoded
with arbitrary nested allOf by @mikhalytch in https://github.com/getkin/kin-openapi/pull/1046New Contributors
Full Changelog: getkin/kin-openapi@v0.128.0...v0.129.0
v0.128.0
Compare Source
What's Changed
New Contributors
Full Changelog: getkin/kin-openapi@v0.127.0...v0.128.0
v0.127.0
Compare Source
What's Changed
ComponentRef
for usage inRefNameResolver
by @fenollp in https://github.com/getkin/kin-openapi/pull/998New Contributors
Full Changelog: getkin/kin-openapi@v0.126.0...v0.127.0
v0.126.0
Compare Source
What's Changed
ReferencesComponentInRootDocument(doc *T, ref componentRef) (string, bool)
by @percivalalb in https://github.com/getkin/kin-openapi/pull/945New Contributors
Full Changelog: getkin/kin-openapi@v0.125.0...v0.126.0
v0.125.0
Compare Source
What's Changed
(*urlValuesDecoder) DecodeObject(..)
by @MateusFrFreitas in https://github.com/getkin/kin-openapi/pull/947YAMLEq
function by @percivalalb in https://github.com/getkin/kin-openapi/pull/954New Contributors
Full Changelog: getkin/kin-openapi@v0.124.0...v0.125.0
v0.124.0
Compare Source
What's Changed
x-www-form-urlencoded
decoder for oneOf, anyOf, and allOf by @imtaketa in https://github.com/getkin/kin-openapi/pull/903Unwrap()
method to SecurityRequirementsError by @nickajacks1 in https://github.com/getkin/kin-openapi/pull/905type
field by @brandonbloom in https://github.com/getkin/kin-openapi/pull/912\u
literals by @thiagownt in https://github.com/getkin/kin-openapi/pull/918New Contributors
Full Changelog: getkin/kin-openapi@v0.123.0...v0.124.0
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.