Skip to content

[Security] Fullwidth character markers bypass sanitization #9791

@ekson73

Description

@ekson73

Summary

The replaceMarkers function in src/security/external-content.ts performs pattern matching on the folded string but applies replacements to the original content. This allows fullwidth character markers to bypass sanitization.

Impact

Severity: High (10/10)
Type: Security - Potential prompt injection

Suggested Fix

Perform all slicing and replacement operations on the folded string instead of the original content to ensure full-width character markers are correctly sanitized.

Source

Identified by Qodo AI code review.

Files Affected

  • src/security/external-content.ts (lines 108-148)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecuritySecurity documentation

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions