CVE-2026-63222: CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames

Published Jul 31, 2026
·
Updated

Impact In 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.

The patch sanitizes this default (no-argument) path.

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: php // Unsafe - even after upgrading: $file->move(WRITEPATH . 'uploads', $file->getName()); $file->move(WRITEPATH . 'uploads', $file->getClientName());

Patches Upgrade to v4.7.4 or later.

Workarounds If you cannot upgrade immediately, use a generated filename or sanitize the client filename before passing it to move().

Use a generated filename: php $file->move(WRITEPATH . 'uploads', $file->getRandomName()); Or sanitize the client filename before passing it to move(): php helper('security');

$name = sanitizefilename($file->getClientName()); $file->move(WRITEPATH . 'uploads', $name);

Other sources

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.

— MITRE

CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames

— Packagist

Affected Software

3 affected componentsFixes available
CodeIgniter Codeigniter<4.7.4
composer/codeigniter4/framework<4.7.4
4.7.4
composer/codeigniter4/framework<4.7.4
4.7.4

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/codeigniter4/framework to a version that resolves this vulnerability.

    Fixed in 4.7.4
  2. Upgrade

    Upgrade CodeIgniter UploadedFile to a version that resolves this vulnerability.

    Fixed in 4.7.4
  3. Configuration

    If calling UploadedFile::move(), do not pass a client-provided filename as the second argument unless you sanitize it first; alternatively, use a generated filename (not a client-provided one) or, after upgrading to 4.7.4, rely on the patched behavior when calling move() without a second argument.

    UploadedFile::move() usage Second argument (destination filename) = Use a generated filename or call without a second argument only when you rely on patched sanitization

Event History

Jul 31, 2026
CVE Published
via MITRE·04:06 AM
Data Sourced
via MITRE·04:06 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·06:16 AM
DescriptionSeverityWeakness
Aug 7, 2026
Advisory Published
via GitHub·06:23 PM
Data Sourced
via GitHub·06:23 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via Packagist·06:23 PM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2026-63222?

CVE-2026-63222 has a high severity rating of 7.5.

2

How do I fix CVE-2026-63222?

To fix CVE-2026-63222, upgrade CodeIgniter to version 4.7.4 or later.

3

What type of vulnerability is CVE-2026-63222?

CVE-2026-63222 is a path traversal vulnerability in CodeIgniter.

4

What can attackers achieve by exploiting CVE-2026-63222?

Exploiting CVE-2026-63222 allows remote attackers to write uploaded content outside the intended directory.

5

Which method in CodeIgniter is affected by CVE-2026-63222?

The vulnerability in CVE-2026-63222 affects the UploadedFile::move() method when using client-provided filenames.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203