{"id":"CVE-2026-63222","aliases":["CVE-2026-63222","GHSA-hhmc-q9hp-r662"],"related":[],"kind":"vulnerability","state":"published","title":"CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames","summary":"CodeIgniter is a PHP full-stack web framework. Prior to 4.7.4, calling UploadedFile::move() without a second argument uses the client-provided filename without sanitization, allowing a remote attacker to use path traversal sequences to write uploaded content outside the intended directory when the application exposes an upload path. This issue is fixed in version 4.7.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"CodeIgniter is a PHP full-stack web framework. Prior to 4.7.4, calling UploadedFile::move() without a second argument uses the client-provided filename without sanitization, allowing a remote attacker to use path traversal sequences to write uploaded content outside the intended directory when the application exposes an upload path. This issue is fixed in version 4.7.4.","source":"cvelist"},{"lang":"en","text":"### Impact\nIn affected versions, calling `UploadedFile::move()` **without a second argument** uses the client-provided filename without sanitization. Depending on the destination path and server configuration, an attacker can supply a filename containing path traversal sequences (e.g. `../../public/shell.php`) to write uploaded content outside the intended upload directory.\n\nThe patch sanitizes this default (no-argument) path.\n\n**Note:** The patch only sanitizes the filename when no second argument is passed. If your application **explicitly** passes a client-provided name as the second argument, you remain responsible for sanitizing it - the patch does not (and cannot) sanitize a caller-supplied filename:\n```php\n// Unsafe - even after upgrading:\n$file->move(WRITEPATH . 'uploads', $file->getName());\n$file->move(WRITEPATH . 'uploads', $file->getClientName());\n```\n\n### Patches\nUpgrade to v4.7.4 or later.\n\n### Workarounds\nIf you cannot upgrade immediately, use a generated filename or sanitize the client filename before passing it to `move()`.\n\nUse a generated filename:\n```php\n$file->move(WRITEPATH . 'uploads', $file->getRandomName());\n```\nOr sanitize the client filename before passing it to `move()`:\n```php\nhelper('security');\n\n$name = sanitize_filename($file->getClientName());\n$file->move(WRITEPATH . 'uploads', $name);\n```","format":"markdown","source":"ghsa"}],"published":"2026-07-31T04:06:19.448Z","modified":"2026-09-08T20:51:43.490Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N","score":7.5,"rating":"HIGH"}],"cwes":["CWE-22"],"affected":[{"ranges":[{"version":"< 4.7.4","status":"affected"}],"vendor":"codeigniter4","product":"CodeIgniter4","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"4.7.4"}],"ecosystem":"Packagist","package":"codeigniter4/framework","purl":"pkg:composer/codeigniter4/framework","source":"ghsa"}],"references":[{"url":"https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-hhmc-q9hp-r662","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/codeigniter4/CodeIgniter4/commit/20ebcf4694d96d3c97fbc3938e360730e4f54618","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/codeigniter4/CodeIgniter4/releases/tag/v4.7.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63222","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/codeigniter4/CodeIgniter4","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2026-07-31T15:57:05.724Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-63222","url":"https://www.cve.org/CVERecord?id=CVE-2026-63222","licence":"CVE Terms of Use","modified":"2026-07-31T15:58:43.539Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hhmc-q9hp-r662","url":"https://github.com/advisories/GHSA-hhmc-q9hp-r662","licence":"CC-BY-4.0","modified":"2026-08-07T18:31:29.671Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-63222","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-63222","licence":"Public domain","modified":"2026-09-08T20:51:43.490Z"}],"updatedAt":"2026-11-25T22:59:30.686Z","epss":{"score":0.0045,"percentile":0.40859,"date":"2026-12-01T12:00:22.000Z"}}