/

CVE-2026-86540

Severity:

HIGH RISK

(7.8)

OS Command Injection (CWE-78) in knowns Project Config

CVE-2026-86540

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Arbitrary Code Execution

Severity:

HIGH RISK

(7.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

A command injection vulnerability in knowns versions before 0.30.0 allows a malicious project configuration to specify an arbitrary binary path. When the repository is opened, knowns may execute the unvalidated binary twice under the current user's account.

Affected context

The vulnerability occurs when knowns opens a repository containing a crafted .knowns/config.json file. Deployments are at risk when the settings.lsp.languages binary field is read and used to launch language servers without validating that the configured path refers to an approved executable.

Exploit preconditions

  • Attack surface: Repository configuration processing during project opening
  • Required access: Ability to create, modify, or deliver a repository containing a malicious .knowns/config.json
  • Trigger point: Processing of the settings.lsp.languages binary field
  • Execution context: The binary runs with the privileges of the user opening the repository
  • Why exploitation is possible: The binary path is accepted without adequate validation or verification before execution

Why this happens

The underlying bug is an instance of CWE-78, OS Command Injection. The application treats a configuration-controlled binary field as trusted executable input and launches it without enforcing an allowlist, validating the resolved executable, or establishing a trusted path boundary. This insecure pattern allows repository data to influence process execution.

Potential impact

  • An attacker may execute arbitrary code under the affected user's account.
  • A malicious repository could compromise the local development environment.
  • Sensitive files, credentials, or source code could be accessed or modified.
  • The executed process could make network requests or alter local project data.
  • In some environments, the compromise could enable further lateral movement.

General mitigation guidance

Mitigation generally focuses on reducing trust in repository-controlled

executable settings and preventing arbitrary process launch.

Common defensive patterns include:

  • Allowing only approved language-server identifiers or binaries rather than arbitrary paths.
  • Validating executable paths against a controlled, trusted directory and resolving symlinks before use.
  • Separating repository configuration from security-sensitive execution policy.
  • Requiring explicit user consent before launching a binary supplied by project configuration.
  • Running language-server processes with least privilege and restricted filesystem and network access.
  • Avoiding shell interpretation and passing validated arguments through structured process APIs.
  • Treating repository configuration as untrusted during automated or routine project opening.

How teams detect issues like this

Organizations can look for this weakness through:

  • Static analysis rules identifying process-launch APIs whose executable path is derived from JSON or other project files.
  • Code review checks for configuration-controlled binary paths, shell execution, and missing allowlists.
  • Tests that open repositories with unexpected, relative, symlinked, or non-approved executable values.
  • Endpoint monitoring for knowns spawning processes from repository-controlled paths.
  • Policy enforcement requiring explicit approval or sandboxing for tools launched from project configuration.
  • Automated code review tools that flag untrusted input flowing into process execution APIs.

Sources

SourceLink
github.comgithub.com/knowns-dev/knowns/blob/v0.29.1/internal/lsp/detect.go#L128-L157
github.comgithub.com/knowns-dev/knowns/blob/v0.29.1/internal/models/config.go#L205-L216
github.comgithub.com/knowns-dev/knowns/commit/d3989829fb5095666d23d005b2f78a082832a396
github.comgithub.com/knowns-dev/knowns/releases/tag/v0.30.0
github.comgithub.com/knowns-dev/knowns/security/advisories/GHSA-mc52-mwq4-vfx3
vulncheck.comvulncheck.com/advisories/knowns-before-0.30.0-arbitrary-code-execution-via-lsp-binary

Frequently asked

questions

Exploitation can occur through a malicious repository or project configuration,

but the target generally must open the repository with a vulnerable knowns

version.

The attacker needs a way to supply or modify the repository's

.knowns/config.json file. The victim's user account then provides the

execution context.

Do not execute arbitrary paths from project configuration. Use approved

executable identifiers or a strict allowlist, validate resolved paths, and

require consent or isolation for repository-controlled tools.

Treat project files as untrusted input, apply security-focused code review to

process-launch paths, use least-privilege sandboxes, and monitor development

tools for unexpected child-process execution.

Find out what's already
exploitable in your codebase.