Back Techtimes North Korea macOS Malware Targets AI Analyst Tools: Gaslight Embeds 38 Fake Error Messages
A North Korea-linked macOS backdoor disclosed this week by SentinelOne does something no malware in its lineage attempted: it tries to make the AI assistant reviewing it believe the analysis session is broken.
SentinelLABS researcher Phil Stokes published a technical breakdown on June 23, 2026 of a Rust-based macOS implant the firm named macOS.Gaslight, after its defining behavior. Embedded inside the binary is a 3.5 KB block of 38 fabricated "system" messages, formatted to look like internal scaffolding from a large language model (LLM) triage harness, and designed to push any AI-assisted analysis tool into aborting, truncating, or refusing its session before it completes work on the sample.
"It attacks the agent's perception, rather than the sandbox it runs in," Stokes wrote in the report.
Prompt injection is a class of attack that exploits an AI model's inability to reliably separate trusted instructions from untrusted data. In Gaslight, the injection payload occupies a Markdown-fenced block inside the binary, delimited by the same {{DATA}} tokens that a typical LLM triage harness uses to mark boundaries between its own prompt scaffold and the sample content it is analyzing. The 38 messages simulate token expiry, out-of-memory kills, disk exhaustion, and repeated operation failures. They also seed the model's context window with bogus warnings injection vulnerabilities and static-analysis flags — the goal being to make an AI reviewer conclude that something is wrong with its own session state, not with the malware.
That target — the output stage of analysis rather than the sandbox itself — makes Gaslight structurally distinct from decades of conventional anti-analysis tradecraft. Malware has long tried to detect virtual machines, debuggers, and sandbox processes and either go dormant or behave differently in their presence. Gaslight bypassed that problem entirely; it did not care whether it was running inside an analysis environment. It cared what the LLM reading its strings would conclude.
SentinelLABS assessed with high confidence that the technique did not bypass any production AI malware analysis platform in current testing. But as the report noted, earlier North Korean macOS samples used a single injected block for the same purpose. Gaslight stacks 38. The iteration gap between one block and 38 suggests systematic testing of failure conditions against live tools and deliberate refinement of the cascade.
The structural asymmetry between prompt injection payloads and traditional evasion matters for defenders. A polymorphic packer still has to produce valid executable code that works correctly in the target environment; the variation space is constrained by what the CPU will execute. A prompt injection payload needs only to produce text that looks plausible to the model receiving it. Any string that reads as a legitimate error message is a candidate payload element. That variation space is effectively unbounded.
There is also no defender-side equivalent to memory-integrity checking. A security operations center can verify whether a binary's code matches a known-good hash; it cannot verify what an LLM is interpreting from the text it was handed. OWASP has classified prompt injection as the top risk in LLM application security — LLM01 in its 2025 ranking — and its 2026 State of Agentic AI Security report concluded the vulnerability may be structural rather than patchable. Gaslight demonstrates what happens when that structural property is deliberately weaponized inside a binary.
Gaslight is a capable macOS infostealer and remote-access backdoor, with the prompt injection riding on top of an otherwise conventional North Korean macOS implant. The command-and-control channel runs over the Telegram Bot API in a polling loop. All traffic is encrypted with AES-GCM using a fresh nonce per message, and the implant restricts TLS trust to a custom certificate anchor, defeating inspection by enterprise proxy tools. It also reads the host's proxy configuration and routes through it, keeping the channel alive on tightly managed corporate networks.
The interactive shell gives operators six commands — help, id, shell, kill, upload, and stop — providing a persistent foothold on any infected host. A seventh command, "focus," appears in strings within the binary, but its function was not recoverable from the static analysis SentinelOne performed.
Persistence is maintained through a LaunchAgent using the label com.apple.system.services.activity , a naming convention designed to blend in with legitimate Apple system services in the same namespace. The implant also creates a power-management assertion to block system sleep, sustaining its polling loop across extended periods of user inactivity.
The data-collection workload runs through a separate 6.6 KB Base64-encoded Python script embedded in the binary. Once decoded, it harvested browser data from Chrome, Brave, Firefox, and Safari; terminal command histories; installed application listings; a running-process snapshot; system hardware and software profile data; and the raw macOS Keychain database file. Collected material was compressed into a ZIP archive and exfiltrated via Telegram's file-upload mechanism. Because the Python stealer ships bundled with its own standalone CPython 3.10.18 interpreter — drawn from the open-source astral-sh/python-build-standalone project — it executes regardless of whether the target system has Python installed.
SentinelLABS noted that the stealer script contains emoji and structured headers consistent with code generated by an AI assistant, an observation the firm flagged as a layer of irony in malware designed to blind AI tools.
The developers of Gaslight built several layers of forensic resistance into the implant. The Telegram bot token, chat ID, and operator configuration are not hardcoded into the binary; they are supplied at runtime, so static analysis of the sample alone cannot recover live credentials.
The implant goes further: when building Telegram API URLs, it replaces the live bot token with a hardcoded placeholder whenever the URL path segment is the literal string "file." As a result, the live credential never appeared in logs, crash artifacts, or runtime output — denying defenders a key indicator they could use to query the Telegram Bot API directly and recover operator infrastructure.
The bot API's own conflict-detection behavior provides an additional deconfliction layer. If two instances of the same bot token attempt to poll simultaneously, Telegram returns a Conflict response and the second instance terminates. This prevents accidental duplication in deployments where an operator might run the implant more than once on the same target.
The operator configuration schema contains 15 fields, including entries for Linux and GitHub paths that are not exercised in the analyzed sample. SentinelLABS concluded this suggests Gaslight is one component of a broader, cross-platform toolset rather than a standalone macOS-only implant.
Apple's XProtect system flagged the primary Gaslight sample under the rule MACOS_BONZAI_COBUCH; SentinelLABS associates the BONZAI family with North Korean threat activity. A sibling sample was additionally detected by Apple's AIRPIPE rule, which the firm also ties to the same cluster. The binary's identifier string — endpoint-macos-aarch64-5555494492fc075f441637fb9d894913dde3a2ea — and its ad hoc signing are consistent with prior North Korean macOS tooling documented by SentinelLABS.
The broader pattern runs back to at least 2023, when the same cluster deployed RustBucket as a dropper and KandyKorn as a remote access trojan targeting blockchain engineers. ObjCShellz followed as a later-stage payload; Gaslight represents the current generation. The campaigns have consistently targeted cryptocurrency firms, blockchain projects, finance, and technology companies, typically using fake job interviews or bogus software updates to trick users into manually executing malicious files.
The main Gaslight binary carries the SHA-256 hash 6328567511d88fdc2ae0939c5ef17b7a63d2a833881900de018a4f12f4982525 . The sibling sample linked through Apple's XProtect rules carries the hash 77b4fd46994992f0e57302cfe76ed23c0d90101381d2b89fc2ddf5c4536e77ca .
SentinelLABS' guidance is direct: any pipeline that feeds malware content into a language model's context window should treat that content as adversarial input from the moment it arrives. The standard for AI-assisted triage pipelines is the same standard applied to SQL queries accepting untrusted user input — the content must be sanitized and separated from the instruction channel before it reaches the model.
Indicators of compromise for Gaslight include a LaunchAgent labeled com.apple.system.services.activity , outbound Telegram API traffic from macOS endpoints, and runtime downloads of cpython-3.10.18 from the astral-sh/python-build-standalone repository. Security teams running endpoint detection on macOS should verify their current detections cover the BONZAI and AIRPIPE XProtect families.
What is the Gaslight macOS malware?
Gaslight is a macOS backdoor and infostealer written in Rust, disclosed by SentinelLABS on June 23, 2026. It collects browser credentials, Keychain data, and system information, sends commands over the Telegram Bot API, and carries a 3.5 KB prompt injection payload built to derail AI-assisted malware analysis tools. SentinelLABS attributes it with high confidence to North Korean threat actors.
Can Gaslight actually bypass AI security tools?
No — SentinelLABS found the prompt injection technique did not bypass any production AI malware analysis platform in current testing. The significance is in the iteration: earlier North Korean macOS samples used a single injected message block for the same purpose; Gaslight stacks 38. The escalation indicates the operators are testing the technique against real tools and refining it.
How is prompt injection in malware different from sandbox evasion?
Traditional sandbox evasion targets the execution environment — a virtual machine, a debugger, an analysis process. Prompt injection in malware targets the analyst's tooling at the output stage: it attempts to make an AI reviewer conclude the analysis session is broken before the AI has reported anything useful. Critically, prompt injection payloads are constrained only by what text looks plausible to a model, whereas code-based evasion is constrained by what the CPU will execute. That makes the attack surface for prompt injection significantly larger and harder to monitor.
How should security teams protect their LLM-assisted analysis pipelines?
SentinelLABS recommends treating all content inside a malware sample as adversarial input — never as instructions — and ensuring that hostile content cannot reach the model's context window at all. Practically, this means implementing input sanitization and separation between malware content and the instruction channel before the sample reaches any LLM-based tool, similar to how SQL queries sanitize untrusted user input. Security teams should also audit any AI-assisted reverse engineering plugin — including those for Ghidra and Binary Ninja — to confirm they enforce this boundary.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
