ghsa-5jc6-h9w7-jm3p
Vulnerability from github
6.2 (Medium) - 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
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.
-
I uploaded zip file as a name
test.zip
. -
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. -
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." -
I found that the application requires selecting a file to compare, and I selected the file
<image src onerror=prompt(document.domain)>test.zip
-
I found that the JavaScript in the filename value was executed in the web browser.
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.
{ "affected": [ { "package": { "ecosystem": "PyPI", "name": "mobsf" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "4.2.9" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-53999" ], "database_specific": { "cwe_ids": [ "CWE-79" ], "github_reviewed": true, "github_reviewed_at": "2024-12-03T18:45:22Z", "nvd_published_at": "2024-12-03T16:15:24Z", "severity": "MODERATE" }, "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 \u003c, \u003e, /, 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 \u0026 Analyze\" button.\n\n\n2. I uploaded zip file as a name `test.zip`.\n\n\n3. I used an intercepting proxy tool while uploading a file and changed the value of the filename parameter from `test.zip` to `\u003cimage src onerror=prompt(document.domain)\u003etest.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\n\n4. I accessed /recent_scans/ and found a file named `\u003cimage src onerror=prompt(document.domain)\u003etest.zip` in the recent scans. Then, I clicked on the \"Differ or Compare\" button.\"\n\n\n5. I found that the application requires selecting a file to compare, and I selected the file `\u003cimage src onerror=prompt(document.domain)\u003etest.zip`\n\n\n6. I found that the JavaScript in the filename value was executed in the web browser.\n\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.\n\n\n", "id": "GHSA-5jc6-h9w7-jm3p", "modified": "2024-12-03T18:45:22Z", "published": "2024-12-03T18:45:22Z", "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" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N", "type": "CVSS_V3" }, { "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", "type": "CVSS_V4" } ], "summary": "Mobile Security Framework (MobSF) Stored Cross-Site Scripting Vulnerability in \"Diff or Compare\" Functionality" }
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.