/

CVE-2026-95183

Severity:

HIGH RISK

(8.8)

Prompt Injection (CWE-94) in DeepSeek Harness dsh Feature

CVE-2026-95183

Deferred

Vulnerability type

Category:

Prompt Injection

CWE:

CWE-94

Impact:

AI instruction manipulation, unauthorized actions, and potential data disclosure

Severity:

HIGH RISK

(8.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 prompt injection vulnerability in DeepSeek Harness (dsh) affects its context-compaction feature when it processes crafted external content. An attacker may influence the resulting context so that the system follows attacker-controlled instructions, potentially causing unauthorized actions, data exposure, or other unsafe behavior when the content is trusted by an AI workflow.

A prompt injection vulnerability in DeepSeek Harness (dsh) affects its context-compaction feature when it processes crafted external content. An attacker may influence the resulting context so that the system follows attacker-controlled instructions, potentially causing unauthorized actions, data exposure, or other unsafe behavior when the content is trusted by an AI workflow.

Affected context

The issue occurs in deployments that use DeepSeek Harness context compaction and incorporate external or otherwise untrusted content into the compacted context. Risk depends on whether that content is processed as trusted instructions and whether the resulting context is provided to an agent or workflow with meaningful permissions.

The issue occurs in deployments that use DeepSeek Harness context compaction and incorporate external or otherwise untrusted content into the compacted context. Risk depends on whether that content is processed as trusted instructions and whether the resulting context is provided to an agent or workflow with meaningful permissions.

Exploit preconditions

  • Attack surface: External content processed by the context-compaction feature
  • Required access: Ability to supply, publish, or influence content that the harness ingests
  • Trigger point: Context compaction and subsequent use of the generated context
  • Why exploitation is possible: Crafted content can be interpreted as instructions rather than untrusted data, allowing attacker-controlled directives to influence downstream model or agent behavior
  • Attack surface: External content processed by the context-compaction feature
  • Required access: Ability to supply, publish, or influence content that the harness ingests
  • Trigger point: Context compaction and subsequent use of the generated context
  • Why exploitation is possible: Crafted content can be interpreted as instructions rather than untrusted data, allowing attacker-controlled directives to influence downstream model or agent behavior

Why this happens

The underlying bug is an insufficient separation between external data and instructions during context compaction.

Crafted content can survive or be transformed by the compaction process in a way that gives it undue influence over subsequent model instructions. This behavior maps to CWE-94: Improper Control of Generation of Code, as attacker-controlled content can affect executable or instruction-like behavior in an automated processing pipeline.

The underlying bug is an insufficient separation between external data and instructions during context compaction.

Crafted content can survive or be transformed by the compaction process in a way that gives it undue influence over subsequent model instructions. This behavior maps to CWE-94: Improper Control of Generation of Code, as attacker-controlled content can affect executable or instruction-like behavior in an automated processing pipeline.

Potential impact

  • An attacker may influence model responses or agent decisions
  • Sensitive information could be disclosed through manipulated workflows
  • Automated actions could be triggered without appropriate authorization
  • Data-processing results may be altered or corrupted
  • Downstream systems could be affected if the agent has privileged integrations
  • An attacker may influence model responses or agent decisions
  • Sensitive information could be disclosed through manipulated workflows
  • Automated actions could be triggered without appropriate authorization
  • Data-processing results may be altered or corrupted
  • Downstream systems could be affected if the agent has privileged integrations

General mitigation guidance

Mitigation generally focuses on treating all external content as untrusted data and preserving a strong boundary between data and instructions.

Common defensive patterns include:

  • Isolating external content from system instructions and control metadata
  • Applying structured, context-aware sanitization and validation before compaction
  • Using explicit trust labels and provenance tracking for ingested content
  • Requiring confirmation or policy checks before consequential actions
  • Limiting agent permissions and integration scopes according to least privilege
  • Preventing compacted context from silently changing security policy or authorization decisions

These controls reduce the chance that manipulated content will control downstream behavior.

Mitigation generally focuses on treating all external content as untrusted data and preserving a strong boundary between data and instructions.

Common defensive patterns include:

  • Isolating external content from system instructions and control metadata
  • Applying structured, context-aware sanitization and validation before compaction
  • Using explicit trust labels and provenance tracking for ingested content
  • Requiring confirmation or policy checks before consequential actions
  • Limiting agent permissions and integration scopes according to least privilege
  • Preventing compacted context from silently changing security policy or authorization decisions

These controls reduce the chance that manipulated content will control downstream behavior.

How teams detect issues like this

Organizations can identify prompt injection risks through:

  • Static and semantic analysis of context-compaction and prompt-construction code
  • Code review checks for untrusted content inserted into instruction-bearing fields
  • Tests using adversarial external content and instruction-confusion cases
  • Monitoring for unexpected tool calls, policy overrides, or sensitive-data access after content ingestion
  • Policy enforcement requiring provenance, trust classification, and authorization checks for model-generated actions

Automated security review tools may help flag dangerous data-to-instruction flows, but behavioral testing remains important.

Organizations can identify prompt injection risks through:

  • Static and semantic analysis of context-compaction and prompt-construction code
  • Code review checks for untrusted content inserted into instruction-bearing fields
  • Tests using adversarial external content and instruction-confusion cases
  • Monitoring for unexpected tool calls, policy overrides, or sensitive-data access after content ingestion
  • Policy enforcement requiring provenance, trust classification, and authorization checks for model-generated actions

Automated security review tools may help flag dangerous data-to-instruction flows, but behavioral testing remains important.

Sources

SourceLink
deepseek.comdeepseek.com
gist.github.comgist.github.com/lkloliver/c54c0cc91e1ec4f16b538e0d8a1411b6

Frequently asked

questions

It can be exploitable through a remote or indirect content-supply path when an attacker can cause crafted external content to be processed by context compaction. Direct exploitation depends on how the deployment accepts and retrieves content.

Not necessarily. The required access depends on whether unauthenticated users or external sources can submit content that enters the compaction workflow. In other deployments, authenticated access or control of an integrated content source may be required.

Keep external content separate from trusted instructions, validate and label it before processing, and require authorization checks before any consequential action influenced by model output.

Use adversarial testing, provenance tracking, least-privilege integrations, explicit trust boundaries, and monitoring for instruction overrides or unexpected agent behavior.

It can be exploitable through a remote or indirect content-supply path when an attacker can cause crafted external content to be processed by context compaction. Direct exploitation depends on how the deployment accepts and retrieves content.

Not necessarily. The required access depends on whether unauthenticated users or external sources can submit content that enters the compaction workflow. In other deployments, authenticated access or control of an integrated content source may be required.

Keep external content separate from trusted instructions, validate and label it before processing, and require authorization checks before any consequential action influenced by model output.

Use adversarial testing, provenance tracking, least-privilege integrations, explicit trust boundaries, and monitoring for instruction overrides or unexpected agent behavior.

Find out what's already
exploitable in your codebase.