CVE-2024-53999: Mobsf Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-5jc6-h9w7-jm3p
CVSS 6.1
CWE-79
Published
Advisory Summary

CVE-2024-53999 is a MODERATE (CVSS 6.1) 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) stored cross-site scripting vulnerability in "diff or compare" functionality. Remediation is available by upgrading affected packages to version 4.2.9.

CVE-2024-53999 at a Glance

CVE Identifier CVE-2024-53999
GHSA Identifier GHSA-5jc6-h9w7-jm3p
Severity MODERATE
CVSS v3.1 Base Score 6.1
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

Security Impact

CVSS: 6.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2024-53999

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.2.9
pip install mobsf>=4.2.9
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-2024-53999, 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.2.9), 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

### Summary The application allows users to upload files with scripts in the filename parameter. As a result, a malicious user can upload a script file to the system. When users in the application use the "Diff or Compare" functionality, they are affected by a Stored Cross-Site Scripting vulnerability. ### Details I found a Stored Cross-Site Scripting vulnerability in the "Diff or Compare" functionality. This issue occurs because the upload functionality allows users to upload files with special characters such as <, >, /, and " in the filename. This vulnerability can be mitigated by restricting file uploads to filenames containing only whitelisted characters, such as A-Z, 0-9, and specific special characters permitted by business requirements, like - or _ . ### PoC _Complete instructions, including specific configuration details, to reproduce the vulnerability._ 1. On MobSF version 4.2.8, I clicked on "Unload & Analyze" button. ![0](https://github.com/user-attachments/assets/489013fe-cf21-4839-bd39-35eebad01a3a) 2. I uploaded zip file as a name `test.zip`. ![1](https://github.com/user-attachments/assets/c26a18ec-c276-43d5-97df-fb189b8d5a6a) 3. I used an intercepting proxy tool while uploading a file and changed the value of the filename parameter from `test.zip` to `<image src onerror=prompt(document.domain)>test.zip`. This means I uploaded a file and set its name to a script value. As a result, the server allowed the file to be uploaded successfully. ![2](https://github.com/user-attachments/assets/90e275a2-58a4-4c0d-9b6a-399ec071cdf2) 4. I accessed /recent_scans/ and found a file named `<image src onerror=prompt(document.domain)>test.zip` in the recent scans. Then, I clicked on the "Differ or Compare" button." ![3](https://github.com/user-attachments/assets/0997a437-5841-49c1-ae94-e0e76173bdb6) 5. I found that the application requires selecting a file to compare, and I selected the file `<image src onerror=prompt(document.domain)>test.zip` ![4](https://github.com/user-attachments/assets/a156f058-732f-4763-8753-b0cef4075d53) 6. I found that the JavaScript in the filename value was executed in the web browser. ![5](https://github.com/user-attachments/assets/b0a9bcbf-af70-4ec6-a22d-6224dfc55639) ### Impact Allowing a malicious user to upload a script in the filename parameter can be used to steal information from other users or administrators when they perform the compare functionality. The script will be stored in the system permanently in this vulnerability.

CVE-2024-53999 Affected Mobsf Versions

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

References

Frequently Asked Questions

What is CVE-2024-53999?
CVE-2024-53999 is a security vulnerability in Mobsf involving Mobile Security Framework (MobSF) Stored Cross-Site Scripting Vulnerability in "Diff or Compare" Functionality 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.2.9 across affected packages: mobsf.
What version fixes CVE-2024-53999?
Upgrading to 4.2.9 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mobsf affected?
Yes, mobsf is affected in releases prior to 4.2.9. Upgrade your dependency to 4.2.9 or later.
What is the CVSS score of CVE-2024-53999?
CVE-2024-53999 has a CVSS v3.1 base score of 6.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2024-53999?
CVE-2024-53999 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-2024-53999?
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-5jc6-h9w7-jm3p",
  "modified" : "2025-06-30T12:51:06Z",
  "published" : "2024-12-03T18:45:22Z",
  "aliases" : [ "CVE-2024-53999" ],
  "summary" : "Mobile Security Framework (MobSF) Stored Cross-Site Scripting Vulnerability in \"Diff or Compare\" Functionality",
  "details" : "### Summary\nThe application allows users to upload files with scripts in the filename parameter. As a result, a malicious user can upload a script file to the system. When users in the application use the \"Diff or Compare\" functionality, they are affected by a Stored Cross-Site Scripting vulnerability.\n\n### Details\nI found a Stored Cross-Site Scripting vulnerability in the \"Diff or Compare\" functionality. This issue occurs because the upload functionality allows users to upload files with special characters such as <, >, /, and \" in the filename. This vulnerability can be mitigated by restricting file uploads to filenames containing only whitelisted characters, such as A-Z, 0-9, and specific special characters permitted by business requirements, like - or _ . \n\n### PoC\n_Complete instructions, including specific configuration details, to reproduce the vulnerability._\n1. On MobSF version 4.2.8, I clicked on \"Unload & Analyze\" button.\n![0](https://github.com/user-attachments/assets/489013fe-cf21-4839-bd39-35eebad01a3a)\n\n2. I uploaded zip file as a name `test.zip`.\n![1](https://github.com/user-attachments/assets/c26a18ec-c276-43d5-97df-fb189b8d5a6a)\n\n3. I used an intercepting proxy tool while uploading a file and changed the value of the filename parameter from `test.zip` to `<image src onerror=prompt(document.domain)>test.zip`. This means I uploaded a file and set its name to a script value. As a result, the server allowed the file to be uploaded successfully.\n![2](https://github.com/user-attachments/assets/90e275a2-58a4-4c0d-9b6a-399ec071cdf2)\n\n4. I accessed /recent_scans/ and found a file named `<image src onerror=prompt(document.domain)>test.zip` in the recent scans. Then, I clicked on the \"Differ or Compare\" button.\"\n![3](https://github.com/user-attachments/assets/0997a437-5841-49c1-ae94-e0e76173bdb6)\n\n5. I found that the application requires selecting a file to compare, and I selected the file `<image src onerror=prompt(document.domain)>test.zip`\n![4](https://github.com/user-attachments/assets/a156f058-732f-4763-8753-b0cef4075d53)\n\n6. I found that the JavaScript in the filename value was executed in the web browser.\n![5](https://github.com/user-attachments/assets/b0a9bcbf-af70-4ec6-a22d-6224dfc55639)\n\n\n### Impact\nAllowing a malicious user to upload a script in the filename parameter can be used to steal information from other users or administrators when they perform the compare functionality. The script will be stored in the system permanently in this vulnerability.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:P/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mobsf"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.9"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-5jc6-h9w7-jm3p"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-53999"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/27d165872847f5ae7417caf09f37edeeba741e1e"
  }, {
    "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" : "2024-12-03T18:45:22Z",
    "nvd_published_at" : "2024-12-03T16:15:24Z"
  }
}