CVE-2025-11065

5.3 MEDIUM

📋 TL;DR

This vulnerability in the go-viper/mapstructure library allows information disclosure through detailed error messages that leak sensitive input values. Attackers can exploit this by submitting malformed data to applications using WeakDecode in security-critical contexts. Any application using affected versions of this Go library is potentially vulnerable.

💻 Affected Systems

Products:
  • github.com/go-viper/mapstructure/v2
Versions: Versions before v2.0.0-beta.1
Operating Systems: All operating systems running Go applications
Default Config Vulnerable: ⚠️ Yes
Notes: Only affects applications using mapstructure.WeakDecode with user-supplied data in security-sensitive contexts.

⚠️ 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

Sensitive configuration data, API keys, or credentials could be exposed through error messages, potentially leading to full system compromise.

🟠

Likely Case

Partial information disclosure of configuration values or user input data through verbose error responses.

🟢

If Mitigated

Limited impact with proper error handling and input validation preventing sensitive data exposure.

🌐 Internet-Facing: MEDIUM - Exploitable via user input but requires specific conditions and malformed data.
🏢 Internal Only: LOW - Internal systems typically have more controlled input sources.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires submitting malformed data to trigger error messages with sensitive information.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: v2.0.0-beta.1 and later

Vendor Advisory: https://github.com/go-viper/mapstructure/security/advisories/GHSA-2464-8j7c-4cjm

Restart Required: Yes

Instructions:

1. Update go.mod to require github.com/go-viper/mapstructure/v2 v2.0.0-beta.1 or later. 2. Run 'go mod tidy'. 3. Rebuild and redeploy your application. 4. Restart affected services.

🔧 Temporary Workarounds

Implement custom error handling

all

Wrap mapstructure.WeakDecode calls with custom error handling that sanitizes error messages before returning to users.

Input validation

all

Validate and sanitize all user input before passing to mapstructure.WeakDecode to prevent malformed data triggering verbose errors.

🧯 If You Can't Patch

  • Implement application-level error handling to sanitize all error messages before returning to users.
  • Disable verbose error reporting in production environments and implement generic error messages.

🔍 How to Verify

Check if Vulnerable:

Check go.mod for github.com/go-viper/mapstructure/v2 version. If version is below v2.0.0-beta.1, the application is vulnerable.

Check Version:

grep 'github.com/go-viper/mapstructure/v2' go.mod

Verify Fix Applied:

Verify go.mod requires github.com/go-viper/mapstructure/v2 v2.0.0-beta.1 or later, and test that malformed input no longer returns sensitive data in error messages.

📡 Detection & Monitoring

Log Indicators:

  • Verbose error messages containing user input or configuration data
  • Multiple failed parsing attempts with malformed data

Network Indicators:

  • HTTP responses containing detailed error messages with potentially sensitive data

SIEM Query:

search error_message="*mapstructure.WeakDecode*" AND (error_message="*password*" OR error_message="*key*" OR error_message="*secret*")

🔗 References

📤 Share & Export