CVE-2025-30153

7.5 HIGH

📋 TL;DR

This vulnerability in kin-openapi allows attackers to upload specially crafted ZIP files (like ZIP bombs) through multipart/form-data requests, causing servers to exhaust all available memory. It affects Go applications using kin-openapi versions before 0.131.0 for OpenAPI validation. The vulnerability occurs because the ZipFileBodyDecoder is automatically registered despite documentation suggesting otherwise.

💻 Affected Systems

Products:
  • kin-openapi
Versions: All versions prior to 0.131.0
Operating Systems: All platforms running Go applications
Default Config Vulnerable: ⚠️ Yes
Notes: Vulnerable when using multipart/form-data schemas in OpenAPI specifications for request validation.

⚠️ Manual Verification Required

This CVE does not have specific version information in our database, so automatic vulnerability detection cannot determine if your system is affected.

Why? The CVE database entry doesn't specify which versions are vulnerable (no version ranges provided by the vendor/NVD).

🔒 Custom verification scripts are available for registered users. Sign up free to download automated test scripts.

Recommended Actions:
  1. Review the CVE details at NVD
  2. Check vendor security advisories for your specific version
  3. Test if the vulnerability is exploitable in your environment
  4. Consider updating to the latest version as a precaution

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete denial of service through memory exhaustion, potentially crashing the server and affecting all hosted services.

🟠

Likely Case

Service disruption through resource exhaustion, leading to downtime and degraded performance for legitimate users.

🟢

If Mitigated

Minimal impact with proper input validation and resource limits in place.

🌐 Internet-Facing: HIGH - Public endpoints accepting file uploads are directly exploitable.
🏢 Internal Only: MEDIUM - Internal services could still be targeted by authenticated users or through other attack vectors.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: MEDIUM

Exploitation requires ability to upload files to vulnerable endpoints, but no authentication bypass is needed beyond what the API normally allows.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 0.131.0

Vendor Advisory: https://github.com/getkin/kin-openapi/security/advisories/GHSA-wq9g-9vfc-cfq9

Restart Required: No

Instructions:

1. Update kin-openapi dependency to version 0.131.0 or later. 2. Run 'go get github.com/getkin/kin-openapi@v0.131.0'. 3. Rebuild and redeploy your application.

🔧 Temporary Workarounds

Disable automatic ZIP file decoding

all

Manually configure request validation to avoid using the vulnerable ZipFileBodyDecoder

Configure custom body decoders in your OpenAPI validation setup to exclude ZIP file handling

Implement file upload restrictions

all

Add server-side limits on file size and content types before validation

Set max file size limits in your HTTP server configuration
Validate file types before passing to kin-openapi

🧯 If You Can't Patch

  • Implement strict file size limits at the web server or load balancer level
  • Deploy WAF rules to block or inspect ZIP file uploads to vulnerable endpoints

🔍 How to Verify

Check if Vulnerable:

Check your go.mod or go.sum for kin-openapi versions below 0.131.0

Check Version:

grep 'kin-openapi' go.mod || grep 'kin-openapi' go.sum

Verify Fix Applied:

Confirm kin-openapi version is 0.131.0 or higher in your dependencies

📡 Detection & Monitoring

Log Indicators:

  • Unusually large memory consumption spikes
  • Failed file upload attempts with ZIP files
  • Process crashes or restarts during file uploads

Network Indicators:

  • Large ZIP file uploads to API endpoints
  • Multiple rapid file upload requests

SIEM Query:

source="application_logs" AND (message="memory allocation failed" OR message="out of memory") AND process="your_go_app"

🔗 References

📤 Share & Export