{"answers":{"affected":"2 open source packages ship an affected version, including phpservermon/phpservermon. It affects 1 product.","exploited":"It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-4240 exists.","fix":"Upgrade phpservermon/phpservermon to 3.6.0 or later.","what":"CVE-2021-4240 is a low-severity vulnerability in unspecified phpservermon, published on 15 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim."},"fix_prompt":"Check this codebase for CVE-2021-4240 and fix it if it is affected.\n\nWhat it is: CVE-2021-4240 is a low-severity vulnerability in unspecified phpservermon, published on 15 Nov 2022. It can only be exploited from the same machine or local network, with no action from the victim.\nExploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2021-4240 exists.\n\nAffected packages and fixed versions:\n- phpservermon/phpservermon (Packagist): affected all versions; fixed in 3.6.0\n- phpservermon/phpservermon (Packagist): affected all versions; fixed in 3.6.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2021-4240/ (Markdown: https://insights.sbomify.com/CVE-2021-4240/index.md)","id":"CVE-2021-4240","markdown":"https://insights.sbomify.com/CVE-2021-4240/index.md","name":"CVE-2021-4240","record":{"aliases":["GHSA-97w9-gcc7-vr8g"],"analysis":{"component_type":"web_application","fix_type":"patch","impacts":["account_takeover"],"network_reachable":"adjacent_or_local","non_default_config":false,"product_category":"phpservermon","requires_auth":"low_privilege","summary":"Predictable password reset tokens in phpservermon allow attackers to hijack user accounts.","user_interaction":"not_required","vuln_class":"weak_cryptography"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"VulDB","cpe":[{"product":"php_server_monitor","vendor":"phpservermonitor"}],"cvss":{"score":2.6,"severity":"low","source":"cna","vector":"CVSS:3.1/AV:A/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N","version":"3.1"},"cwes":[{"id":"CWE-330","name":"Use of Insufficiently Random Values"},{"id":"CWE-331","name":"Insufficient Entropy"}],"description":"A vulnerability, which was classified as problematic, was found in phpservermon. This affects the function generatePasswordResetToken of the file src/psm/Service/User.php. The manipulation leads to use of predictable algorithm in random number generator. The exploit has been disclosed to the public and may be used. The name of the patch is 3daa804d5f56c55b3ae13bfac368bb84ec632193. It is recommended to apply a patch to fix this issue. The identifier VDB-213717 was assigned to this vulnerability.","ecosystems":["Packagist"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"weaponised"},"has_fix":true,"headline":"phpservermon User.php generatePasswordResetToken predictable algorithm in random number generator","id":"CVE-2021-4240","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"weak_cryptography","year":"2021"},"n_packages":2,"n_references":3,"next":{"headline":"phpservermon User.php setUserLoggedIn predictable algorithm in random number generator","id":"CVE-2021-4241"},"packages":[{"ecosystem":"Packagist","fixed":["3.6.0"],"introduced":["0"],"last_affected":[],"package":"phpservermon/phpservermon","purl":null,"source":"GHSA-97w9-gcc7-vr8g"},{"ecosystem":"Packagist","fixed":["3.6.0"],"introduced":["0"],"last_affected":[],"package":"phpservermon/phpservermon","purl":"pkg:composer/phpservermon/phpservermon","source":"GHSA-97w9-gcc7-vr8g"}],"prev":{"headline":"Weak encryption and denial of service in github.com/flynn/noise","id":"CVE-2021-4239"},"products":["phpservermon"],"published":"2022-11-15","related":[{"cvss_score":6.5,"headline":"CSRF in PHP Server Monitor before 3.3.2","id":"CVE-2018-18921","kev_date_added":null,"published":"2018-12-18"},{"cvss_score":6.3,"headline":"CRLF Injection in phpservermon/phpservermon","id":"CVE-2021-4097","kev_date_added":null,"published":"2021-12-11"},{"cvss_score":2.6,"headline":"phpservermon User.php setUserLoggedIn predictable algorithm in random number generator","id":"CVE-2021-4241","kev_date_added":null,"published":"2022-11-15"}],"sources":[{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"poc","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-04-15","vendors":["unspecified"]},"summary":"Predictable password reset tokens in phpservermon allow attackers to hijack user accounts.","url":"https://insights.sbomify.com/CVE-2021-4240/"}