{"answers":{"affected":"2 open source packages ship an affected version, including spomky-labs/otphp.","exploited":"There is no known exploitation of GHSA-2jx3-65f3-xr8r in the wild and no public exploit code.","fix":"Upgrade spomky-labs/otphp to 11.4.3 or later.","what":"GHSA-2jx3-65f3-xr8r is a vulnerability in spomky-labs/otphp, published on 18 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for GHSA-2jx3-65f3-xr8r and fix it if it is affected.\n\nWhat it is: GHSA-2jx3-65f3-xr8r is a vulnerability in spomky-labs/otphp, published on 18 Jun 2026. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of GHSA-2jx3-65f3-xr8r in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- spomky-labs/otphp (Packagist): affected all versions; fixed in 11.4.3\n- spomky-labs/otphp (Packagist): affected all versions; fixed in 11.4.3\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/GHSA-2jx3-65f3-xr8r/ (Markdown: https://insights.sbomify.com/GHSA-2jx3-65f3-xr8r/index.md)","id":"GHSA-2jx3-65f3-xr8r","markdown":"https://insights.sbomify.com/GHSA-2jx3-65f3-xr8r/index.md","name":"GHSA-2jx3-65f3-xr8r","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["denial_of_service","other"],"network_reachable":"yes","non_default_config":false,"product_category":"PHP OTP library","requires_auth":"none","summary":"Attackers can corrupt OTP state or cause uncaught errors by supplying malicious provisioning URIs to the Factory class in the spomky-labs/otphp library.","user_interaction":"required","vuln_class":"other"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"## Summary\n\n`OTPHP\\Factory::loadFromProvisioningUri()` parses an attacker-supplied `otpauth://` URI and forwards **every** query key to `OTP::setParameter($key, $value)`. `setParameter()` resolves the name with `property_exists($this, $parameter)` and performs a dynamic write `$this-\u003e{$parameter} = $value` (`src/OTP.php:196-197`). Because the query keys are entirely controlled by whoever produced the URI, a URI can target the internal properties of the OTP object that are not meant to be set from a URI: `parameters`, `issuer`, `label`, `issuer_included_as_parameter`, and (on TOTP) the readonly `clock`. This is an instance of object property mass-assignment (CWE-915).\n\n## Impact\n\nThe `Factory` is documented as the entry point for third-party provisioning URIs (e.g. QR codes from Microsoft 365 / Google Authenticator). An application that loads such a URI is exposed to:\n\n- **State corruption.** A URI such as `otpauth://totp/Alice?secret=JBSWY3DPEHPK3PXP\u0026parameters[foo]=bar` overwrites the whole internal `$parameters` array that `createFromSecret()` primed (`period`, `algorithm`, `digits`, `epoch`). The resulting object is silently unusable: `getProvisioningUri()`, `getDigits()`, `at()`, `verify()` then throw `ParameterNotFoundException`.\n- **Uncaught TypeError escaping the documented exception type.** A URI such as `otpauth://totp/Alice?secret=JBSWY3DPEHPK3PXP\u0026issuer_included_as_parameter=notabool` assigns a string to a typed `bool` property and raises a `TypeError`. The `try/catch` in `loadFromProvisioningUri()` only wraps `Url::fromString()`; `createOTP()` and `populateOTP()` run outside it, so the `TypeError` (and `Error` on the readonly `clock`) escapes past the documented `InvalidProvisioningUriException`, breaking callers that catch only the documented type.\n- **Label/issuer validation bypass.** `parameters[label]=hijacked` stores a label into the parameters array without running the `label` validation callback (keyed on `label`, not `parameters`). `getLabel()` and `getParameter('label')` then disagree — a confused-deputy risk.\n\n## Affected component\n\n- `src/OTP.php:187-201` — `setParameter()` dynamic property write\n- `src/Factory.php:50-55` — `populateParameters()` forwarding all query keys\n\n## Proof of concept\n\n```php\nuse OTPHP\\Factory;\n\n// State corruption\n$otp = Factory::loadFromProvisioningUri(\n    'otpauth://totp/Alice?secret=JBSWY3DPEHPK3PXP\u0026parameters[foo]=bar',\n    $clock\n);\n$otp-\u003egetProvisioningUri(); // ParameterNotFoundException: Parameter \"period\" does not exist\n\n// Uncaught TypeError\nFactory::loadFromProvisioningUri(\n    'otpauth://totp/Alice?secret=JBSWY3DPEHPK3PXP\u0026issuer_included_as_parameter=notabool',\n    $clock\n); // TypeError escapes InvalidProvisioningUriException\n```\n\n## Remediation\n\nRestrict the keys accepted from a provisioning URI to a known allow-list of public OTP parameters, and never let a URI key resolve to an internal object property via `property_exists`. Route all URI-sourced values through the validated parameter map only.","ecosystems":["Packagist"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"`OTPHP\\Factory::loadFromProvisioningUri()` parses an attacker-supplied `otpauth://` URI and forwards **every** query key to `OTP:","id":"GHSA-2jx3-65f3-xr8r","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"Packagist","product":null,"products":[],"type":"other","year":"2026"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"Packagist","fixed":["11.4.3"],"introduced":["0"],"last_affected":[],"package":"spomky-labs/otphp","purl":null,"source":"GHSA-2jx3-65f3-xr8r"},{"ecosystem":"Packagist","fixed":["11.4.3"],"introduced":["0"],"last_affected":[],"package":"spomky-labs/otphp","purl":"pkg:composer/spomky-labs/otphp","source":"GHSA-2jx3-65f3-xr8r"}],"products":null,"published":"2026-06-18","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"Attackers can corrupt OTP state or cause uncaught errors by supplying malicious provisioning URIs to the Factory class in the spomky-labs/otphp library.","url":"https://insights.sbomify.com/GHSA-2jx3-65f3-xr8r/"}