GHSA-r77c-qv68-j3pp is a medium-severity (CVSS 6.1) Cross-site Scripting (XSS) vulnerability in mobiledetect/mobiledetectlib. 1 public exploit or proof-of-concept reference is indexed, so weaponization risk is real. A fix is available for mobiledetect/mobiledetectlib — see the affected versions and patch details below.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
mobiledetect/mobiledetectlibReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Packagist packages — download data is not available via public APIs for these ecosystems.
Description
A vulnerability, which was classified as problematic, has been found in MobileDetect 2.8.31. This issue affects the function initLayoutType of the file examples/session_example.php of the component Example. The manipulation of the argument $_SERVER['PHP_SELF'] leads to cross site scripting. The attack may be initiated remotely. The exploit has been disclosed to the public and may be used. Upgrading to version 2.8.32 is able to address this issue. The identifier of the patch is 31818a441b095bdc4838602dbb17b8377d1e5cce. It is recommended to upgrade the affected component. The identifier VDB-220061 was assigned to this vulnerability.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🐘Packagist | mobiledetect/mobiledetectlib | all versions | 2.8.32composer require mobiledetect/mobiledetectlib:^2.8.32 |
Affected Products
mobiledetectmobiledetectResearch use only. For defensive security, authorized penetration testing, and academic research only. Never execute exploit code against systems without explicit written authorization.
MobileDetect 2.8.31 - Cross-Site Scripting (XSS)
by CodeSecLab · Dec 3, 2025
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for mobiledetect/mobiledetectlib, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update mobiledetect/mobiledetectlib to 2.8.32 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-r77c-qv68-j3pp is resolved across your whole dependency graph.
Workarounds
Escape or sanitise the affected output on the server side rather than relying on client-side filtering, and add a Content-Security-Policy that blocks inline script execution so injected markup cannot run even if it reaches the page.
Frequently Asked Questions
Is GHSA-r77c-qv68-j3pp in your dependencies?
Find it across Packagist, including transitive dependencies.