CVE-2025-31116: 
Python vulnerability analysis and mitigation

Overview

Mobile Security Framework (MobSF), a pen-testing, malware analysis and security assessment framework capable of performing static and dynamic analysis, was found to contain a Server-Side Request Forgery (SSRF) vulnerability in versions 4.3.1 and earlier. The vulnerability exists in the mitigation for CVE-2024-29190 where the valid_host() function uses socket.gethostbyname(), making it vulnerable to SSRF abuse using DNS rebinding technique (GitHub Advisory).

Technical details

The vulnerability stems from the use of socket.gethostbyname() in the valid_host() function's SSRF protection mechanism. The function performs a single DNS lookup to verify that the IP address is not in an excluded subnet range. However, this protection can be bypassed through DNS rebinding attacks, where an initial DNS resolution points to an allowed IP (like 1.1.1.1), but subsequent resolutions point to restricted IPs (like 127.0.0.1). The vulnerability has been assigned a CVSS v3.1 base score of 4.4 (Medium) with vector string CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:C/C:L/I:N/A:L (GitHub Advisory).

Impact

The vulnerability allows attackers to perform Server-Side Request Forgery (SSRF) attacks, potentially enabling unauthorized access to internal resources and services. This could lead to data exposure, internal system reconnaissance, and potential service disruption (GitHub Advisory).

Exploitability

The vulnerability requires high attack complexity and high privileges to exploit, but no user interaction is needed. A proof of concept exists demonstrating how an attacker can bypass the SSRF protection using DNS rebinding techniques. The attack involves generating a random URL that initially resolves to an allowed IP address (e.g., 1.1.1.1) and then switches to a restricted IP address (e.g., 127.0.0.1) after the initial resolution (GitHub Advisory).

Mitigation and workarounds

The vulnerability has been patched in version 4.3.2 of MobSF. The fix involves avoiding the use of socket.gethostbyname() since it issues DNS queries that can be manipulated. Users are advised to upgrade to version 4.3.2 or later to receive the security fix (GitHub Advisory).

Additional resources


Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hhqh-8jpj-27rfCRITICAL9.8
  • Python logoPython
  • lmcache
NoYesNov 23, 2026
CVE-2026-130164HIGH7.8
  • Python logoPython
  • hermes-agent
NoYesNov 23, 2026
GHSA-v8x2-8vhg-5vc3MEDIUM5.8
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-gfqr-fp2c-h495MEDIUM5.4
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-jg4p-wprm-8hphMEDIUM5.3
  • Python logoPython
  • lmcache
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management