Summary
OpenCATS contains an unrestricted file upload issue in its Import module that can preserve an uploaded filename and place the file in a web-accessible temporary directory. An authenticated user with Import privileges may be able to upload server-side code, and if the directory permits PHP execution, request the staged file to execute code with web-server privileges.
OpenCATS contains an unrestricted file upload issue in its Import module that can preserve an uploaded filename and place the file in a web-accessible temporary directory. An authenticated user with Import privileges may be able to upload server-side code, and if the directory permits PHP execution, request the staged file to execute code with web-server privileges.
Affected context
The issue occurs in OpenCATS deployments where the Import module accepts the affected data type, preserves an uploaded file's original name, and stores the file in a temporary directory that is reachable through the web server. Exploitation also depends on an import error or similar processing condition leaving the uploaded file on disk and on server-side script execution being enabled for that directory.
The issue occurs in OpenCATS deployments where the Import module accepts the affected data type, preserves an uploaded file's original name, and stores the file in a temporary directory that is reachable through the web server. Exploitation also depends on an import error or similar processing condition leaving the uploaded file on disk and on server-side script execution being enabled for that directory.
Exploit preconditions
- Attack surface: The OpenCATS Import module and its file-upload handling
- Required access: An authenticated account with Import privileges
- Trigger point: Upload processing for the affected import data type,
followed by access to the staged file through the web server
- Environmental requirement: The temporary directory must be
web-accessible and configured to execute PHP files
- Why exploitation is possible: The application may retain an
attacker-controlled executable filename and fail to remove the file after
an import error
- Attack surface: The OpenCATS Import module and its file-upload handling
- Required access: An authenticated account with Import privileges
- Trigger point: Upload processing for the affected import data type,
followed by access to the staged file through the web server
- Environmental requirement: The temporary directory must be
web-accessible and configured to execute PHP files
- Why exploitation is possible: The application may retain an
attacker-controlled executable filename and fail to remove the file after
an import error
Why this happens
The vulnerability results from insufficient restrictions on uploaded file names, file types, storage locations, and post-processing cleanup. Preserving an untrusted original name while storing the file in a web-accessible directory can allow an uploaded server-side script to be interpreted by the web server. This behavior maps to CWE-434, Unrestricted Upload of File with Dangerous Type, because the application does not reliably constrain uploaded content to safe, non-executable files and locations.
The vulnerability results from insufficient restrictions on uploaded file names, file types, storage locations, and post-processing cleanup. Preserving an untrusted original name while storing the file in a web-accessible directory can allow an uploaded server-side script to be interpreted by the web server. This behavior maps to CWE-434, Unrestricted Upload of File with Dangerous Type, because the application does not reliably constrain uploaded content to safe, non-executable files and locations.
Potential impact
- An attacker may execute arbitrary PHP code with web-server process privileges.
- Recruiting and applicant data could be disclosed, altered, or deleted.
- The application runtime could be modified or persistently compromised.
- The underlying host may be exposed to further unauthorized activity.
- Credentials, configuration data, or connected systems could be affected.
- An attacker may execute arbitrary PHP code with web-server process privileges.
- Recruiting and applicant data could be disclosed, altered, or deleted.
- The application runtime could be modified or persistently compromised.
- The underlying host may be exposed to further unauthorized activity.
- Credentials, configuration data, or connected systems could be affected.
General mitigation guidance
Mitigation generally focuses on making uploads non-executable by design and
reducing trust in client-supplied metadata.
Common defensive patterns include:
- Allowing only explicitly required file formats and validating content by
signature rather than relying on extensions or MIME types.
- Replacing original filenames with generated, non-executable identifiers.
- Storing uploaded files outside the web document root or in isolated object
storage.
- Disabling script execution in all upload and temporary directories.
- Removing temporary files reliably on both successful and failed imports.
- Applying size, ownership, permission, and retention limits to uploaded files.
- Running the application with least-privilege accounts and restricting
filesystem and database permissions.
- Separating upload processing from the primary web-serving process where
practical.
Mitigation generally focuses on making uploads non-executable by design and
reducing trust in client-supplied metadata.
Common defensive patterns include:
- Allowing only explicitly required file formats and validating content by
signature rather than relying on extensions or MIME types.
- Replacing original filenames with generated, non-executable identifiers.
- Storing uploaded files outside the web document root or in isolated object
storage.
- Disabling script execution in all upload and temporary directories.
- Removing temporary files reliably on both successful and failed imports.
- Applying size, ownership, permission, and retention limits to uploaded files.
- Running the application with least-privilege accounts and restricting
filesystem and database permissions.
- Separating upload processing from the primary web-serving process where
practical.
How teams detect issues like this
Detection approaches can include:
- Static analysis rules for file moves that preserve user-controlled names or
write uploads beneath web-accessible paths.
- Code review checks for extension-only validation, unrestricted MIME handling,
and cleanup paths that omit exceptions or import failures.
- Web-server and application configuration reviews confirming that temporary
and upload directories cannot execute scripts.
- Monitoring for unusual upload activity, unexpected executable extensions,
failed imports followed by direct file requests, and new files in temporary
directories.
- Policy enforcement in CI/CD pipelines requiring centralized, approved upload
handling and non-executable storage.
- Automated security review tools may help identify dangerous upload flows but
should be supplemented with deployment-configuration checks.
Detection approaches can include:
- Static analysis rules for file moves that preserve user-controlled names or
write uploads beneath web-accessible paths.
- Code review checks for extension-only validation, unrestricted MIME handling,
and cleanup paths that omit exceptions or import failures.
- Web-server and application configuration reviews confirming that temporary
and upload directories cannot execute scripts.
- Monitoring for unusual upload activity, unexpected executable extensions,
failed imports followed by direct file requests, and new files in temporary
directories.
- Policy enforcement in CI/CD pipelines requiring centralized, approved upload
handling and non-executable storage.
- Automated security review tools may help identify dangerous upload flows but
should be supplemented with deployment-configuration checks.

