CVE-2025-46335: Mobsf Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-mwfg-948f-2cc5
CWE-79
Published
Advisory Summary

CVE-2025-46335 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Mobsf libraries in the PyPI ecosystem. The issue involves mobile security framework (mobsf) allows stored cross site scripting (xss) via malicious svg icon upload. Remediation is available by upgrading affected packages to version 4.3.3.

CVE-2025-46335 at a Glance

CVE Identifier CVE-2025-46335
GHSA Identifier GHSA-mwfg-948f-2cc5
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Mobsf
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix CVE-2025-46335

To remediate this vulnerability, upgrade all affected Mobsf dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

mobsf fixed: 4.3.3
pip install mobsf>=4.3.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show mobsf

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2025-46335, inspect your installed packages using pip:

pip show mobsf

Analyze the terminal output to locate any version of Mobsf in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.3), your application is affected.

Note: The pip show mobsf command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Mobsf, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

**Vulnerable MobSF Versions:** <= v4.3.2 **CVSS V4.0 Score:** 8.6 (CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N) **Details:** A Stored Cross-Site Scripting (XSS) vulnerability has been identified in MobSF versions ≤ 4.3.2. The vulnerability arises from improper sanitization of user-supplied SVG files during the Android APK analysis workflow. When an Android Studio project contains a malicious SVG file as an app icon (e.g path, /app/src/main/res/mipmap-hdpi/ic_launcher.svg), and the project is zipped and uploaded to MobSF, the tool processes and extracts the contents without validating or sanitizing the SVG. Upcon ZIP extraction this icon file is saved by MobSF to: user/.MobSF/downloads/<filename>.svg This file becomes publicly accessible via the web interface at: http://127.0.0.1:8081/download/filename.svg If the SVG contains embedded JavaScript (e.g., an XSS payload), accessing this URL via a browser leads to the execution of the script in the context of the MobSF user session, resulting in stored XSS. **Proof Of Concept:** 1. Create a malicious SVG file (ic_launcher.svg) with an embedded XSS payload. ![01](https://github.com/user-attachments/assets/9a89dec2-0671-490d-aba6-f38470bd84ee) 2. Place the file in the Android Studio project directory: /app/src/main/res/mipmap-hdpi/ic_launcher.svg ![02](https://github.com/user-attachments/assets/fc66f659-9f90-4be8-92c3-c5f26e1e11de) 3. Zip the project directory and upload it to MobSF. ![03](https://github.com/user-attachments/assets/a8465037-3b7a-42b7-89cf-5102c27917e7) 4. After the scan, navigate to the "Recent Scans" page in the MobSF web interface and click on the scan entry and open the icon file in a new browser tab. ![04](https://github.com/user-attachments/assets/5355e4d3-89a2-403a-a1a7-f60389fdbb8d) 5. The XSS payload is executed, confirming the vulnerability. ![05](https://github.com/user-attachments/assets/bc1e3493-1ffc-4598-b122-85459a406748)

CVE-2025-46335 Affected Mobsf Versions

1 component(s)
Fixed Versions:
4.3.3
Product / Package Ecosystem Affected Versions Fixed Version
mobsf
PyPI
< 4.3.3
4.3.3

References

Frequently Asked Questions

What is CVE-2025-46335?
CVE-2025-46335 is a security vulnerability in Mobsf involving Mobile Security Framework (MobSF) Allows Stored Cross Site Scripting (XSS) via malicious SVG Icon Upload under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Mobsf versions are affected?
Affected versions include releases prior to 4.3.3 across affected packages: mobsf.
What version fixes CVE-2025-46335?
Upgrading to 4.3.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mobsf affected?
Yes, mobsf is affected in releases prior to 4.3.3. Upgrade your dependency to 4.3.3 or later.
What CWE is associated with CVE-2025-46335?
CVE-2025-46335 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for CVE-2025-46335?
Run the dependency tree command: 'pip show mobsf'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-mwfg-948f-2cc5",
  "modified" : "2025-05-05T22:06:28Z",
  "published" : "2025-05-05T14:55:59Z",
  "aliases" : [ "CVE-2025-46335" ],
  "summary" : "Mobile Security Framework (MobSF) Allows Stored Cross Site Scripting (XSS) via malicious SVG Icon Upload",
  "details" : "**Vulnerable MobSF Versions:**  <= v4.3.2\n\n**CVSS V4.0 Score:** 8.6 (CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:H/VI:H/VA:L/SC:N/SI:N/SA:N)\n\n**Details:**\nA Stored Cross-Site Scripting (XSS) vulnerability has been identified in MobSF versions ≤ 4.3.2. The vulnerability arises from improper sanitization of user-supplied SVG files during the Android APK analysis workflow.\n\nWhen an Android Studio project contains a malicious SVG file as an app icon (e.g path, /app/src/main/res/mipmap-hdpi/ic_launcher.svg), and the project is zipped and uploaded to MobSF, the tool processes and extracts the contents without validating or sanitizing the SVG. \n\nUpcon ZIP extraction this icon file is saved by MobSF to: user/.MobSF/downloads/<filename>.svg\n\nThis file becomes publicly accessible via the web interface at:\n\nhttp://127.0.0.1:8081/download/filename.svg\n\nIf the SVG contains embedded JavaScript (e.g., an XSS payload), accessing this URL via a browser leads to the execution of the script in the context of the MobSF user session, resulting in stored XSS.\n\n**Proof Of Concept:**\n\n1. Create a malicious SVG file (ic_launcher.svg) with an embedded XSS payload.\n\n![01](https://github.com/user-attachments/assets/9a89dec2-0671-490d-aba6-f38470bd84ee)\n\n2. Place the file in the Android Studio project directory: /app/src/main/res/mipmap-hdpi/ic_launcher.svg\n\n![02](https://github.com/user-attachments/assets/fc66f659-9f90-4be8-92c3-c5f26e1e11de)\n\n3. Zip the project directory and upload it to MobSF.\n\n![03](https://github.com/user-attachments/assets/a8465037-3b7a-42b7-89cf-5102c27917e7)\n\n4. After the scan, navigate to the \"Recent Scans\" page in the MobSF web interface and click on the scan entry and open the icon file in a new browser tab.\n\n![04](https://github.com/user-attachments/assets/5355e4d3-89a2-403a-a1a7-f60389fdbb8d)\n\n5. The XSS payload is executed, confirming the vulnerability.\n\n![05](https://github.com/user-attachments/assets/bc1e3493-1ffc-4598-b122-85459a406748)",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:H/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mobsf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.3"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 4.3.2"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-mwfg-948f-2cc5"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-46335"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/6987a946485a795f4fd38cebdb4860b368a1995d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/MobSF/Mobile-Security-Framework-MobSF"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-05-05T14:55:59Z",
    "nvd_published_at" : "2025-05-05T19:15:56Z"
  }
}