/

CVE-2021-47936

Severity:

CRITICAL RISK

(9.8)

Authentication and Access Control Failure in OpenCATS

CVE-2021-47936

Deferred

Vulnerability type

Category:

Authentication and Access Control Failure

CWE:

CWE-306

Impact:

Remote Code Execution by Unauthenticated Attackers

Severity:

CRITICAL RISK

(9.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

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.

Sources

SourceLink
github.comgithub.com/opencats/OpenCATS
exploit-db.comexploit-db.com/exploits/50585
opencats.orgopencats.org/
vulncheck.comvulncheck.com/advisories/opencats-remote-code-execution-via-resume-upload

Frequently asked

questions

The issue is broadly exploitable in typical internet-facing deployments because it does not require authentication. Any remote user who can reach the careers/job application endpoint can attempt to upload a malicious file.

No. Based on the described behavior, no valid credentials are required; the attack can be carried out by an unauthenticated user over the public network, as long as they can access the application's upload endpoint.

The safest pattern is to require authentication for sensitive operations like file uploads, move all uploaded files into non-executable directories, and apply strict allowlist-based file-type validation. Additionally, ensure the web server never executes code from directories intended for untrusted content.

Adopt secure design practices that treat upload endpoints as high-risk:

  • Define clear authentication and authorization requirements for every endpoint, especially those that modify server state or write to disk.
  • Enforce non-executable storage for all user-supplied files.
  • Use secure coding guidelines and automated checks to flag file upload handlers lacking authentication, validation, or safe storage configurations.
Find out what's already
exploitable in your codebase.