Unauthenticated RCE in CKFinder via Null Byte Injection Vulnerabi
An exposed CKFinder file manager allowed unauthenticated file uploads, and a null byte injection in the filename bypassed the extension filter to upload a ColdFusion webshell. The attacker could then execute arbitrary OS commands on the server.
Published on medium.com
During an authorized penetration test on a corporate web application, I was performing directory enumeration against the target when I came across an exposed CKEditor/CKFinder file manager interface — accessible to anyone, no credentials required. What followed was a straightforward but critical attack chain: upload a…
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the CKFinder interface lacked authentication and used a blocklist-based extension filter that was bypassed by a null byte in the filename, allowing a ColdFusion executable to be stored in a web-accessible directory.
Impact
An unauthenticated attacker could write arbitrary files, bypass extension filtering, execute ColdFusion code, and achieve full OS command execution, leading to reverse shell access and lateral movement.
What the attacker needed
Exposed CKFinder interface; No authentication required; Ability to send crafted HTTP requests
The fix
The report recommends restricting CKFinder access behind authentication, using an extension allowlist, preventing script execution in upload directories, validating MIME type and magic bytes, and upgrading or removing CKFinder 2.x.
How it was found
- Discover the exposed CKFinder interface via directory enumeration.
- Upload a simple HTML file to confirm unrestricted write access.
- Craft a multipart upload request with a null byte in the filename to bypass the extension filter.
- Rename the uploaded file to remove the .html suffix, making it a .cfm file.
- Access the uploaded .cfm file with a command parameter to execute OS commands.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A file manager meant for uploading images was left open to anyone without a password. The upload filter could be tricked by putting a special character in the filename so the server saved a dangerous script file instead of a harmless one. That script let the attacker run commands on the server.
What is File upload?
An upload feature accepts a file that the server or other users' browsers then treat as code or as something trusted.