/

CVE-2026-50872

Severity:

CRITICAL RISK

(9.8)

Code Injection (CWE-94) in Selfoss Loopback Handler

CVE-2026-50872

Deferred

Vulnerability type

Category:

Code Injection

CWE:

CWE-94

Impact:

Remote Code Execution and Data Exposure

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

A code injection flaw in the loopback request handling component of fossar selfoss v2.20-SNAPSHOT allows crafted HTTP requests to be interpreted as executable commands.

When exposed, this behavior can let a remote attacker run arbitrary code on the server and access sensitive data without prior authentication.

Affected context

This vulnerability exists in deployments of fossar selfoss v2.20-SNAPSHOT where the loopback request handling component processes HTTP requests that are not strictly validated or constrained.

It primarily affects environments where the application is reachable over the network and where loopback request logic can be influenced via user-controlled request parameters, headers, or payloads.

The risk increases when the application runs with high system privileges or has access to sensitive configuration, databases, or internal network resources.

Exploit preconditions

  • Attack surface: Public or internal HTTP endpoints handled by the loopback request component.
  • Required access: Ability to send crafted HTTP requests to the vulnerable selfoss instance; no local shell access is required.
  • Trigger point: Specific request paths, parameters, or headers that are passed into the loopback handler and subsequently incorporated into dynamic code or command execution.
  • Why exploitation is possible: User-supplied data is used in a context where it influences executable code or shell commands without sufficient sanitization, escaping, or strict whitelisting, enabling arbitrary command or code injection.

Why this happens

The underlying bug aligns with CWE-94: Improper Control of Generation of Code ('Code Injection').

The loopback handler appears to incorporate request-controlled data into dynamically generated code or command execution paths, likely using string concatenation or template expansion without robust validation or context-aware escaping.

When the application interprets this tainted data as part of executable logic, attackers can craft input that alters the intended behavior, causing the server to execute arbitrary commands or scripts instead of static, predefined actions.

Potential impact

  • Remote execution of arbitrary system commands on the selfoss server.
  • Unauthorized access to sensitive configuration files, API keys, and database credentials.
  • Exfiltration, modification, or deletion of application and user data.
  • Use of the compromised server as a pivot point for lateral movement within the network.
  • Service disruption, including application crashes or deliberate denial-of-service through destructive commands.

General mitigation guidance

Effective mitigation centers on eliminating the ability for user-controlled input to influence executable code or commands.

Recommended design patterns include:

  • Avoiding dynamic code generation entirely for handling loopback or internal requests; rely on static routing and explicit parameter handling.
  • Using strict whitelists for any operations triggered by incoming requests, mapping only pre-approved actions or command arguments.
  • Applying context-aware escaping for any data that must cross from request parameters into system commands or interpreters, preferably using parameterized APIs instead of shell invocation.
  • Segregating high-risk functionality into components running with minimal privileges and limited filesystem/database access.
  • Enforcing a clear trust boundary for "internal" or loopback-style endpoints so that they are not directly accessible or influenced by arbitrary external clients.

How teams detect issues like this

Detection usually combines code-centric and runtime approaches:

  • Static analysis rules that flag dynamic code execution primitives, shell execution functions, or templating constructs that accept unvalidated request data.
  • Manual code review focusing on the loopback request handling path, tracing all user-controllable input into any command execution or dynamic evaluation logic.
  • Security linters or SAST tools configured with custom rules to detect concatenation of HTTP parameters into system command strings or interpreter calls.
  • Runtime monitoring and logging that records unusual command invocations, suspicious parameters, or error traces originating from the loopback handler.
  • Web application firewalls or API gateways configured with signatures to detect known patterns of command injection and anomalous parameters.

Sources

SourceLink
gist.github.comgist.github.com/pyuysig/272bf96c028ed45ad010b7c75937c914

Frequently asked

questions

Yes. An attacker who can reach the affected selfoss HTTP interface and send crafted requests to the loopback handler may exploit the issue remotely.

The attacker generally only needs network access to the vulnerable endpoint; no local account or prior authentication is assumed unless additional controls restrict access.

The most robust fix is to remove dynamic code or command generation from the loopback path and instead use static, parameterized APIs that accept only validated, whitelisted inputs with no direct mapping into executable strings.

Adopt secure coding standards that prohibit untrusted data from reaching interpreters or shell commands, enforce rigorous code review on request-handling logic, and integrate static analysis tools that detect dynamic execution patterns influenced by user input.

Find out what's already
exploitable in your codebase.