xAI Grok Agent source code audit: persistent context hijacking and supply chain attack analysis caused by local configuration loading
A static source code audit of xAI's open-source component xai-grok-agent found that the system performs unisolated direct string concatenation (CWE-1427) when loading local configuration files such as AGENTS.md, and appends mandatory execution instructions after concatenation. Attackers can achieve persistent context hijacking (OWASP ASI06) of developers' local AI agents through supply chain poisoning (malicious open-source repositories). The article discloses the complete attack chain from file reading to prompt concatenation.
A static source code audit of xAI's open-source component xai-grok-agent found that the system performs unisolated direct string concatenation (CWE-1427) when loading local configuration files such as AGENTS.md, and appends mandatory execution instructions after concatenation. Attackers can achieve persistent context hijacking (OWASP ASI06) of developers' local AI agents through supply chain poisoning (malicious open-source repositories). The article discloses the complete attack chain from file reading to prompt concatenation.