/

CVE-2026-95140

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in kkFileView FileController

CVE-2026-95140

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File and Directory Write

Severity:

HIGH RISK

(7.5)

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

A directory traversal vulnerability in kkFileView allows unauthenticated attackers to escape the intended fileDir storage root by supplying crafted path values.

Through affected file-management endpoints, an attacker may create arbitrary directories and write files to locations accessible to the application process.

A directory traversal vulnerability in kkFileView allows unauthenticated attackers to escape the intended fileDir storage root by supplying crafted path values.

Through affected file-management endpoints, an attacker may create arbitrary directories and write files to locations accessible to the application process.

Affected context

The vulnerability occurs in kkFileView versions 5.0.0 through 5.0.2 when the FileController handles the path parameter for the fileUpload, createFolder, or existsFile endpoints. Risk is present when request-supplied paths are concatenated with the configured upload base directory without canonicalization, confinement checks, or equivalent validation.

The vulnerability occurs in kkFileView versions 5.0.0 through 5.0.2 when the FileController handles the path parameter for the fileUpload, createFolder, or existsFile endpoints. Risk is present when request-supplied paths are concatenated with the configured upload base directory without canonicalization, confinement checks, or equivalent validation.

Exploit preconditions

  • Attack surface: HTTP file-management endpoints exposed by the kkFileView application
  • Required access: No authentication may be required when these endpoints are reachable
  • Trigger point: Processing a crafted path parameter in a multipart upload or folder/file operation request
  • Why exploitation is possible: User-controlled path content is joined with the upload base path without sufficient validation, allowing resolution outside the intended fileDir root
  • Attack surface: HTTP file-management endpoints exposed by the kkFileView application
  • Required access: No authentication may be required when these endpoints are reachable
  • Trigger point: Processing a crafted path parameter in a multipart upload or folder/file operation request
  • Why exploitation is possible: User-controlled path content is joined with the upload base path without sufficient validation, allowing resolution outside the intended fileDir root

Why this happens

The underlying bug is improper neutralization of path traversal sequences in externally supplied file paths.

FileController uses a request-controlled path value when constructing filesystem locations, but does not adequately normalize the resulting path and verify that it remains within the permitted storage directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

The underlying bug is improper neutralization of path traversal sequences in externally supplied file paths.

FileController uses a request-controlled path value when constructing filesystem locations, but does not adequately normalize the resulting path and verify that it remains within the permitted storage directory. This behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, commonly known as path traversal.

Potential impact

  • An attacker may create directories outside the intended upload root.
  • An attacker may write or overwrite files accessible to the application process.
  • Application configuration or operational data may be modified.
  • The service may experience integrity loss, disruption, or follow-on compromise depending on filesystem permissions.
  • An attacker may create directories outside the intended upload root.
  • An attacker may write or overwrite files accessible to the application process.
  • Application configuration or operational data may be modified.
  • The service may experience integrity loss, disruption, or follow-on compromise depending on filesystem permissions.

General mitigation guidance

Mitigation generally focuses on enforcing a strict filesystem confinement boundary for every path-handling operation.

Common defensive patterns include:

  • Resolve candidate paths against a trusted base directory and verify the canonical result remains within that directory.
  • Reject absolute paths, traversal components, ambiguous encodings, and unexpected separators before filesystem access.
  • Use server-generated filenames and identifiers rather than accepting client-controlled destination paths.
  • Apply the same validation consistently to upload, folder creation, and existence-check operations.
  • Run the application with the least filesystem privileges needed and keep sensitive directories outside its writable scope.
  • Prefer isolated, access-controlled storage locations for user-provided files.

Mitigation generally focuses on enforcing a strict filesystem confinement boundary for every path-handling operation.

Common defensive patterns include:

  • Resolve candidate paths against a trusted base directory and verify the canonical result remains within that directory.
  • Reject absolute paths, traversal components, ambiguous encodings, and unexpected separators before filesystem access.
  • Use server-generated filenames and identifiers rather than accepting client-controlled destination paths.
  • Apply the same validation consistently to upload, folder creation, and existence-check operations.
  • Run the application with the least filesystem privileges needed and keep sensitive directories outside its writable scope.
  • Prefer isolated, access-controlled storage locations for user-provided files.

How teams detect issues like this

Detection approaches may include:

  • Static analysis for string concatenation or path joining that combines request parameters with filesystem roots without canonicalization and containment checks.
  • Code review searches for controller methods that pass user-controlled path values directly to file creation, upload, or directory APIs.
  • Dynamic testing with traversal variants, encoded separators, absolute paths, and nested path forms in authorized test environments.
  • Web application firewall or API policy rules that flag suspicious path components and unexpected destination paths.
  • File-integrity monitoring for writes outside the designated upload directory.

Detection approaches may include:

  • Static analysis for string concatenation or path joining that combines request parameters with filesystem roots without canonicalization and containment checks.
  • Code review searches for controller methods that pass user-controlled path values directly to file creation, upload, or directory APIs.
  • Dynamic testing with traversal variants, encoded separators, absolute paths, and nested path forms in authorized test environments.
  • Web application firewall or API policy rules that flag suspicious path components and unexpected destination paths.
  • File-integrity monitoring for writes outside the designated upload directory.

Sources

SourceLink
github.comgithub.com/sg-summer/cve/issues/4

Frequently asked

questions

Yes, when the affected endpoints are reachable over the network and do not require authentication. The practical impact depends on application configuration and operating-system permissions.

No authenticated account may be necessary. The attacker needs network access to an exposed endpoint and the ability to submit a request containing a crafted path value.

Constrain every resolved filesystem path to a trusted base directory using canonicalization and an explicit containment check, while rejecting unsafe path formats.

Avoid client-controlled destination paths, use generated storage names, apply centralized path-validation utilities, test traversal variants, and run services with minimal filesystem privileges.

Yes, when the affected endpoints are reachable over the network and do not require authentication. The practical impact depends on application configuration and operating-system permissions.

No authenticated account may be necessary. The attacker needs network access to an exposed endpoint and the ability to submit a request containing a crafted path value.

Constrain every resolved filesystem path to a trusted base directory using canonicalization and an explicit containment check, while rejecting unsafe path formats.

Avoid client-controlled destination paths, use generated storage names, apply centralized path-validation utilities, test traversal variants, and run services with minimal filesystem privileges.

Find out what's already
exploitable in your codebase.