Privilege escalation in Polr
Description
Polr is an open source URL shortener. in Polr before version 2.3.0, a vulnerability in the setup process allows attackers to gain admin access to site instances, even if they do not possess an existing account. This vulnerability exists regardless of users' settings. If an attacker crafts a request with specific cookie headers to the /setup/finish endpoint, they may be able to obtain admin privileges on the instance. This is caused by a loose comparison (==) in SetupController that is susceptible to attack. The project has been patched to ensure that a strict comparison (===) is used to verify the setup key, and that /setup/finish verifies that no users table exists before performing any migrations or provisioning any new accounts. This is fixed in version 2.3.0. Users can patch this vulnerability without upgrading by adding abort(404) to the very first line of finishSetup in SetupController.php.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Polr before 2.3.0 uses a loose comparison (==) on the setup key, allowing attackers with a crafted cookie to gain admin access.
Vulnerability
Polr, an open source URL shortener, before version 2.3.0, contains a vulnerability in the finishSetup method of SetupController.php that uses a loose comparison (==) when validating the setup authentication key from the environment variable TMP_SETUP_AUTH_KEY against the value supplied in a cookie setup_arguments [2]. This allows an attacker to bypass authentication if they can craft a request with specific cookie headers to the /setup/finish endpoint [2]. The vulnerability exists regardless of user settings and does not require an existing account [2].
Exploitation
An attacker must be able to send HTTP requests to the target Polr instance and have knowledge of the setup endpoint [1][2]. The attacker crafts a request to /setup/finish with a cookie named setup_arguments containing a JSON object that includes a setup_auth_key field. Due to the loose comparison (==), if the attacker can guess or manipulate the value to match the environment variable (e.g., by exploiting PHP type juggling, such as using a numeric string or a value that equals true), the check may pass, granting admin privileges [1][2]. After the fix, a strict comparison (===) is used, and the endpoint also checks that the users table does not already exist before proceeding [1].
Impact
Successful exploitation allows the attacker to gain admin access to the Polr instance without possessing an existing account [2]. This leads to full compromise of the URL shortener, including the ability to manage users, links, and settings [2].
Mitigation
The vulnerability is fixed in Polr version 2.3.0 [1][2]. Users should upgrade to this version or apply the workaround by adding abort(404); as the very first line of the finishSetup function in SetupController.php if upgrading is not immediately possible [2]. The patch involves changing the loose comparison (==) to a strict comparison (===) and verifying that the users table does not exist before running migrations [1].
AI Insight generated on May 27, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
2Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
4News mentions
0No linked articles in our index yet.