/

CVE-2026-61645

Severity:

CRITICAL RISK

(9.1)

Unrestricted File Upload (CWE-434) in Docat Upload API

CVE-2026-61645

Deferred

Vulnerability type

Category:

Unrestricted File Upload

CWE:

CWE-434

Impact:

Arbitrary File Write, Cross-Site Scripting, or Remote Code Execution

Severity:

CRITICAL RISK

(9.1)

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

Docat's Upload API may accept files without adequately validating their paths or types, allowing an attacker to place unauthorized content on the documentation server. If the attacker can reach the upload functionality and the server permits writing to sensitive or web-accessible locations, the issue could enable configuration tampering, cross-site scripting, or remote code execution depending on deployment conditions.

Docat's Upload API may accept files without adequately validating their paths or types, allowing an attacker to place unauthorized content on the documentation server. If the attacker can reach the upload functionality and the server permits writing to sensitive or web-accessible locations, the issue could enable configuration tampering, cross-site scripting, or remote code execution depending on deployment conditions.

Affected context

The vulnerability occurs in Docat deployments that expose the Upload API without enforcing strong filename, path, and content-type controls. Risk is higher when uploaded files can reach configuration locations, executable paths, or directories served directly to users. The verified remediation addresses filename-based path traversal in version 1.6.0, while the security of unrestricted file types and deployment-dependent content execution requires separate evaluation.

The vulnerability occurs in Docat deployments that expose the Upload API without enforcing strong filename, path, and content-type controls. Risk is higher when uploaded files can reach configuration locations, executable paths, or directories served directly to users. The verified remediation addresses filename-based path traversal in version 1.6.0, while the security of unrestricted file types and deployment-dependent content execution requires separate evaluation.

Exploit preconditions

  • Attack surface: Docat's Upload API
  • Required access: Ability to submit an upload request; authentication requirements depend on deployment configuration
  • Trigger point: Server-side handling and storage of an uploaded file
  • Why exploitation is possible: Insufficient validation may allow attacker-controlled filenames, paths, or file types to be written to locations with security significance
  • Deployment dependency: Impact depends on filesystem permissions, web-server behavior, exposed upload directories, and whether stored content is interpreted or served to users
  • Attack surface: Docat's Upload API
  • Required access: Ability to submit an upload request; authentication requirements depend on deployment configuration
  • Trigger point: Server-side handling and storage of an uploaded file
  • Why exploitation is possible: Insufficient validation may allow attacker-controlled filenames, paths, or file types to be written to locations with security significance
  • Deployment dependency: Impact depends on filesystem permissions, web-server behavior, exposed upload directories, and whether stored content is interpreted or served to users

Why this happens

The underlying flaw is an unrestricted file upload pattern in which user-controlled upload metadata and content are accepted without sufficiently constraining destination paths and permitted file types. This behavior maps to CWE-434: Unrestricted Upload of File with Dangerous Type. When storage boundaries, canonicalized paths, and content policies are missing or incomplete, uploaded data may overwrite sensitive files, become executable, or be delivered as active browser content.

The underlying flaw is an unrestricted file upload pattern in which user-controlled upload metadata and content are accepted without sufficiently constraining destination paths and permitted file types. This behavior maps to CWE-434: Unrestricted Upload of File with Dangerous Type. When storage boundaries, canonicalized paths, and content policies are missing or incomplete, uploaded data may overwrite sensitive files, become executable, or be delivered as active browser content.

Potential impact

  • An attacker may overwrite sensitive configuration files
  • The server may store malicious files in web-accessible locations
  • Users could be exposed to stored cross-site scripting
  • Session cookies or other browser-accessible data could be targeted
  • Uploaded content could enable remote code execution in deployments that interpret or execute it
  • Documentation integrity and availability could be affected
  • An attacker may overwrite sensitive configuration files
  • The server may store malicious files in web-accessible locations
  • Users could be exposed to stored cross-site scripting
  • Session cookies or other browser-accessible data could be targeted
  • Uploaded content could enable remote code execution in deployments that interpret or execute it
  • Documentation integrity and availability could be affected

General mitigation guidance

Mitigation generally focuses on treating every upload as untrusted content and enforcing strict storage boundaries.

Common defensive patterns include:

  • Allowing only an explicit, minimal set of file types and formats
  • Validating content using trusted file signatures rather than filename extensions alone
  • Canonicalizing paths and generating server-side storage names
  • Keeping uploads outside executable and sensitive configuration directories
  • Serving uploaded content from an isolated origin with restrictive response headers
  • Applying least-privilege filesystem permissions to the Docat process
  • Limiting upload size, rate, and destination scope
  • Preventing uploaded HTML, script, and other active content from being rendered in trusted application contexts
  • Treating the filename-traversal remediation as separate from file-type and content-handling controls

Mitigation generally focuses on treating every upload as untrusted content and enforcing strict storage boundaries.

Common defensive patterns include:

  • Allowing only an explicit, minimal set of file types and formats
  • Validating content using trusted file signatures rather than filename extensions alone
  • Canonicalizing paths and generating server-side storage names
  • Keeping uploads outside executable and sensitive configuration directories
  • Serving uploaded content from an isolated origin with restrictive response headers
  • Applying least-privilege filesystem permissions to the Docat process
  • Limiting upload size, rate, and destination scope
  • Preventing uploaded HTML, script, and other active content from being rendered in trusted application contexts
  • Treating the filename-traversal remediation as separate from file-type and content-handling controls

How teams detect issues like this

Detection approaches can include:

  • Static analysis rules for user-controlled paths passed to file-write or move operations
  • Code review checks for missing allowlists, content validation, and canonicalization
  • Tests that verify uploads cannot escape an isolated directory or overwrite protected files
  • Runtime monitoring for unexpected files, configuration changes, and uploads of executable or active-content formats
  • Web-application policies that restrict upload methods, destinations, and response content types
  • Automated security scanning and review tools that identify unrestricted upload patterns

Detection approaches can include:

  • Static analysis rules for user-controlled paths passed to file-write or move operations
  • Code review checks for missing allowlists, content validation, and canonicalization
  • Tests that verify uploads cannot escape an isolated directory or overwrite protected files
  • Runtime monitoring for unexpected files, configuration changes, and uploads of executable or active-content formats
  • Web-application policies that restrict upload methods, destinations, and response content types
  • Automated security scanning and review tools that identify unrestricted upload patterns

Sources

SourceLink
github.comgithub.com/docat-org/docat/commit/85fc40e8348c6328f488395d03c779517a0913fd
github.comgithub.com/docat-org/docat/releases/tag/1.6.0
github.comgithub.com/docat-org/docat/security/advisories/GHSA-jcxj-j5qf-8crw

Frequently asked

questions

It can be remotely exploitable when the Upload API is network-accessible and an attacker can submit uploads. The practical impact depends on authentication, authorization, and deployment configuration.

Not necessarily. Authentication requirements are determined by how the Upload API is exposed and protected, but any account or role permitted to upload may be relevant.

Store uploads in an isolated, non-executable location using server-generated names, enforce a narrow content allowlist, validate file contents, and prevent access to sensitive paths.

Combine positive validation, path canonicalization, least-privilege filesystem permissions, isolated content serving, upload monitoring, and tests for overwrite, traversal, and active-content risks.

It can be remotely exploitable when the Upload API is network-accessible and an attacker can submit uploads. The practical impact depends on authentication, authorization, and deployment configuration.

Not necessarily. Authentication requirements are determined by how the Upload API is exposed and protected, but any account or role permitted to upload may be relevant.

Store uploads in an isolated, non-executable location using server-generated names, enforce a narrow content allowlist, validate file contents, and prevent access to sensitive paths.

Combine positive validation, path canonicalization, least-privilege filesystem permissions, isolated content serving, upload monitoring, and tests for overwrite, traversal, and active-content risks.

Find out what's already
exploitable in your codebase.