CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames
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:
// 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:
$file->move(WRITEPATH . 'uploads', $file->getRandomName());
Or sanitize the client filename before passing it to move():
helper('security');
$name = sanitize_filename($file->getClientName());
$file->move(WRITEPATH . 'uploads', $name);
Czego dotyczy
Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.
| Platforma | Paczka | Podatne wersje | Poprawka w wersji |
|---|---|---|---|
| Paczka Composer | codeigniter4/framework | < 4.7.4 | 4.7.4 |
Odnośniki
- https://github.com/codeigniter4/CodeIgniter4/security/advisories/GHSA-hhmc-q9hp-r662
- https://nvd.nist.gov/vuln/detail/CVE-2026-63222
- https://github.com/codeigniter4/CodeIgniter4/commit/20ebcf4694d96d3c97fbc3938e360730e4f54618
- https://github.com/codeigniter4/CodeIgniter4
- https://github.com/codeigniter4/CodeIgniter4/releases/tag/v4.7.4
- Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N- Słabość (CWE)
CWE-22- Platforma
- Composer
- Paczka
codeigniter4/framework- Ujawniono
- 07.08.2026
- Aktualizacja
- 11.10.2026 10:22
Źródła i licencje
OSV / GitHub Advisory Database - GHSA-hhmc-q9hp-r662 - CC BY 4.0
Historia podatności: codeigniter4/framework
Wszystkie opisane podatności tej paczki (Paczka Composer), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.
- Wszystkich wpisów
- 19
- Pierwsza → ostatnia
- 01.2022 08.2026
- Bez poprawki
- 1
- Wykorzystywana w atakach
- 0
Rozkład istotności
- Krytyczna 6
- Wysoka 8
- Średnia 4
- Niska 1
Ujawnienia w latach
- 2022: 9
- 2023: 2
- 2024: 1
- 2025: 2
- 2026: 5
-
CodeIgniter: Path traversal in UploadedFile::move() when using client-provided filenames ten wpis
Dowiedz się, które podatności dotyczą Twojej aplikacji
Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.