Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
Sicherheitslücken (CVE)CVE-2024-0244 – A heap buffer overflow in the Canon MF753Cdw printer(23.09.2026 um 21:03 Uhr)
Malware / Trojaner / VirenNew Galago Ransomware Operation Emerges With Links to Panzer Extortion Group(24.09.2026 um 08:06 Uhr)
Sicherheitslücken (CVE)Hackers Exploit Check Point VPN RCE and Management Zero-Day in Attacks(24.09.2026 um 11:41 Uhr)
Sicherheitslücken (CVE)Check Point Fixes a New Actively Exploited Critical Security Flaw(22.09.2026 um 21:31 Uhr)
Sicherheitslücken (CVE)CVE-2026-87902: how close is your WordPress to remote code execution?(23.09.2026 um 09:36 Uhr)
Sicherheitslücken (CVE)ShinyHunters claims FBI breach after alleged PeopleSoft zero-day attack(23.09.2026 um 15:56 Uhr)
Sicherheitslücken (CVE)CVE-2024-0244 – A heap buffer overflow in the Canon MF753Cdw printer(23.09.2026 um 21:03 Uhr)
Malware / Trojaner / VirenNew Galago Ransomware Operation Emerges With Links to Panzer Extortion Group(24.09.2026 um 08:06 Uhr)
Sicherheitslücken (CVE)Hackers Exploit Check Point VPN RCE and Management Zero-Day in Attacks(24.09.2026 um 11:41 Uhr)
Sicherheitslücken (CVE)Check Point Fixes a New Actively Exploited Critical Security Flaw(22.09.2026 um 21:31 Uhr)
Sicherheitslücken (CVE)CVE-2026-87902: how close is your WordPress to remote code execution?(23.09.2026 um 09:36 Uhr)
Sicherheitslücken (CVE)ShinyHunters claims FBI breach after alleged PeopleSoft zero-day attack(23.09.2026 um 15:56 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

When AI Leaks Internal Tags: Debugging a 3-Layer Streaming Architecture Bug

As an SDET testing AI applications, I recently encountered a bizarre issue in the OpenClaw Gateway UI. Instead of normal conversational text, the AI assistant started spitting out raw internal directive tags like [[reply_to:< and…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

As an SDET testing AI applications, I recently encountered a bizarre issue in the OpenClaw Gateway UI. Instead of normal conversational text, the AI assistant started spitting out raw internal directive tags like [[reply_to:< and [[reply directly into the chat interface.



These tags are designed for internal message routing and should be silently stripped by the system before reaching the user. At first glance, it looked like a simple "dumb LLM" problem. But diving deeper, I uncovered a fascinating architectural trap: a perfect storm of three distinct bugs across the backend stream, the UI state logic, and the defense-in-depth strategy.



Here is how I debugged and fixed this cascading failure.






The Investigation: Hunting the Leak






Round 1: The Code Check



My first instinct was to check the stripping logic. The backend used a standard Regex REPLY_TAG_RE to find and remove fully closed tags like [[reply_to:123]]. I wrote a quick test script, and the Regex worked perfectly on complete tags. So why were they leaking?






Round 2: The Smoking Gun in the Session Logs



I bypassed the UI and checked the raw .jsonl session logs containing the LLM's raw output. I found the exact payload for the failing prompt:




{
"role": "assistant",
"content": [{"type": "text", "text": "[[reply_to_current]]\n\n[[reply_to:<id>]]\n\n...(repeats 100 times)...\n\n[[reply_to:<"}],
"stopReason": "length"
}






Two massive clues here:




  1. The stopReason was "length" (truncated by maxTokens), not normal completion.

  2. The model had hallucinated and repeated the system prompt instructions until it ran out of tokens, leaving the final tag incomplete ([[reply_to:<).






Round 3: The Streaming Epiphany



Then it hit me. LLMs don't output text all at once; they stream token by token.

When the model generates [[reply_to:123]], the data flow looks like this:





  1. Hello (No tag -> Safe)


  2. Hello [[re (Regex fails to match -> LEAKED to UI)


  3. Hello [[reply_to: (Regex fails to match -> LEAKED to UI)


  4. Hello [[reply_to:123]] (Regex matches -> Stripped -> Safe)



The backend was broadcasting the "growing," incomplete tags to the frontend because the Regex only looked for fully closed brackets.





The Root Cause: A 3-Layered Trap



This wasn't just a regex failure. It was a combination of three isolated flaws that created an unrecoverable state:




  1. Layer 1: The Streaming Leak (Backend) The stripInlineDirectiveTagsForDisplay() function only removed closed tags. Intermediate fragments during the Server-Sent Events (SSE) stream slipped right through.


  2. Layer 2: The UI State Logic Trap (Frontend)

    Inside the frontend controller, the chat stream state update had a fatal assumption:




   if (!current || next.length >= current.length) {
state.chatStream = next;
}





The UI assumed text only gets longer. So, when the backend leaked Hello [[reply (15 chars), the UI saved it. But when the backend finally received the full tag, stripped it, and sent the clean Hello (6 chars), the UI rejected the update because 6 < 15! The dirty tag became permanently stuck in the UI.





  1. Layer 3: No Defense in Depth (Frontend)
    The frontend completely trusted the backend to strip the tags and had no localized sanitization function for assistant messages.





The Fix



To solve this, I implemented fixes across the stack:



1. Catching Partial Streams (Backend)

I added a PARTIAL_REPLY_TAG_RE regex specifically to target unclosed tags at the very end of the string stream:




const PARTIAL_REPLY_TAG_RE = /\[\[\s*reply(?:_to(?:_current|:\s*[^\]\n]*)?)?\s*$/i;






Now, strings like [[reply are stripped in real-time before broadcasting.



2. Implementing Defense in Depth (Frontend)

I updated the frontend processMessageText() function to independently run the stripping utility, ensuring that even if a dirty payload somehow bypasses the gateway, the UI sanitizes it before rendering.






The SDET Takeaway





  1. Streaming architectures break traditional parsing: When dealing with SSE or WebSockets in AI apps, you must account for intermediate "growing" states. A regex that works on static text will often fail on a stream.


  2. Text length is a dangerous state metric: Never assume an LLM's output string will monotonically increase in length. Formatting, redaction, or tag stripping will shrink the string, breaking next.length >= current.length update logic.


  3. Session Logs are your best friend: When the UI misbehaves, don't guess. Go straight to the raw JSON logs. A stopReason: "length" is a massive red flag.



By applying defense-in-depth, we ensured that this UI bug is gone for good.

SOC Incident Playbook: Vulnerability Remediation & Verification
title: Detect Exploitation - When AI Leaks Internal Tags: Debugging a 3-Layer Streaming Architecture Bug
id: 3ced738b-9d9f-4cd8-8974-fc84bf01342b
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "When AI Leaks Internal Tags: D" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich When AI Leaks Internal Tags: Debugging a.... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten When AI Leaks Internal Tags: Debugging a 3-Layer Streaming Architecture Bug

Thematisch verwandte Begriffe: When, Leaks, Internal, Tags · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97360 | HFS2 version 2.4.0 and earlier contains an unauthenticated arbitrary fil…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick