Summary
OpenCATS 0.9.4 contains a flaw where the resume upload endpoint accepts file uploads without proper authentication or enforcement of safe file types, allowing malicious PHP files to be stored on the server.
An unauthenticated attacker can upload a PHP payload as a resume and then invoke it via HTTP POST to execute arbitrary system commands on the server.
Affected context
This vulnerability appears in OpenCATS 0.9.4 deployments where the public careers or job application endpoint is exposed to the internet and accepts file attachments as part of application submissions.
The issue is present when the upload handler allows server-executable file types (such as PHP scripts) to be written into a web-accessible directory without requiring a valid, authenticated session and without robust file-type restrictions.
Typical environments include LAMP-style hosting where PHP files in the upload directory are executable by the web server.
Exploit preconditions
- Attack surface: Public careers/job application upload endpoint.
- Required access: No prior authentication; attacker only needs network access to the OpenCATS application.
- Trigger point: Submitting a job application with a "resume" file that is actually a PHP script, followed by direct HTTP requests to the uploaded file.
- Why exploitation is possible:
- The upload endpoint does not enforce authentication (CWE-306).
- Uploaded files are placed into a directory that the web server can execute as PHP.
- Insufficient validation of file type, extension, or content allows PHP payloads to be accepted.
Why this happens
The core issue is a missing or inadequate authentication and authorization boundary around a sensitive operation: uploading files that end up executable on the server.
According to CWE-306 (Missing Authentication for Critical Function), critical functionality exposed without proper authentication allows anyone to perform actions that should be restricted.
In this case, the file upload handler is treated like a public contact form but writes untrusted content into a web-exposed directory that is configured to execute scripts.
Combined with weak validation of file extensions or MIME types, this pattern allows arbitrary PHP code to be placed and then invoked, creating a direct path to remote code execution.
Potential impact
- Remote execution of arbitrary system commands on the OpenCATS server.
- Full compromise of the underlying web server account and hosted application data.
- Theft or tampering of candidate resumes, job postings, and internal recruitment data.
- Installation of web shells and backdoors for persistent access.
- Use of the compromised server as a pivot point to attack internal networks.
- Defacement of the careers portal or distribution of malicious content to visitors.
General mitigation guidance
Effective mitigation typically combines stronger access control with safer file-handling patterns:
- Treat file upload endpoints as security-sensitive and require proper authentication and, where relevant, role checks before allowing uploads.
- Restrict upload directories so they cannot execute server-side code (e.g., configure the web server to treat upload paths as non-executable static content only).
- Enforce strict allowlists for file extensions and MIME types (e.g., PDFs, certain image formats), and reject any potentially executable type.
- Normalize and sanitize file names, avoiding direct use of user-supplied paths or extensions.
- Apply least-privilege principles to the web server user, limiting filesystem and OS-level capabilities in case of compromise.
- Introduce application-level validation of uploaded content (e.g., checking that "resume" uploads match expected document formats).
How teams detect issues like this
Detection approaches can span both code-level and operational monitoring layers:
- Static analysis and code review:
- Look for file upload handlers accessible without session checks, tokens, or permission verification.
- Flag any logic where uploaded files are stored under web root or in directories configured for script execution.
- Identify insufficient file extension and MIME-type validation for uploads, especially when PHP or other executable types are not explicitly denied.
- Configuration and policy checks:
- Analyze web server configuration to ensure upload directories are non-executable.
- Apply security policies that forbid deployment patterns where untrusted content is written into script-executable paths.
- Runtime and log monitoring:
- Monitor web server logs for direct access to uploaded files, unusual POST requests to files in upload directories, or unexpected HTTP 200 responses for "resume" paths.
- Use intrusion detection or web application firewalls to alert on suspicious upload patterns or known web shell signatures.
- Automated code review tools and SAST platforms can help flag missing authentication checks and unsafe upload logic as part of CI pipelines.

