Hackers Can Use GenAI to Change Loaded Clean Page Into Malicious within Seconds
A recent development in cybersecurity has revealed a significant threat where malicious actors are employing artificial intelligence to manipulate web-based attacks. These attacks convert legitimate-looking webpages into phishing tools in real-time.
A recent development in cybersecurity has revealed a significant threat where malicious actors are employing artificial intelligence to manipulate web-based attacks. These attacks convert legitimate-looking webpages into phishing tools in real-time.
Security experts have identified the use of generative AI systems by cybercriminals to create malicious code that activates dynamically upon visiting seemingly harmless websites. This represents an advanced evolution in web-based threats, complicating detection and prevention efforts.
The attack mechanism involves embedding specific instructions within a benign webpage. Upon visiting, the page requests code from AI services such as Google Gemini or DeepSeek via public APIs. These requests are engineered with concealed prompts that exploit AI systems to generate harmful JavaScript code, bypassing safety protocols.
Once generated, this code is executed within the user's browser, converting the clean webpage into a phishing or credential-stealing tool. As the code is assembled and executed only at runtime, it leaves no static payload.
These attacks convert legitimate-looking webpages into phishing tools in real-time.
Palo Alto Networks researchers have identified this threat through extensive research and proof-of-concept testing. Their Unit 42 team demonstrated the systematic exploitation of this technique to enhance phishing campaigns while bypassing network security defenses.
The method is particularly effective because the malicious code originates from trusted AI service domains, allowing it to circumvent network filtering systems that typically block suspicious traffic.
How This Attack Evades Detection Systems
The polymorphic nature of AI-generated code presents a challenge in detection and blocking. Each visit to a compromised webpage results in a new version of the malicious code with different syntax, though the functionality remains unchanged. This constant variation hinders security tools that rely on recognizing specific code signatures.
Moreover, since the malicious content is transmitted through legitimate AI API domains, network monitoring tools cannot differentiate between regular AI requests and those containing hidden attack instructions. The runtime assembly and execution of the code directly in the browser further complicate detection, as the threat never exists as a static file on disk.
Palo Alto Networks advises deploying runtime behavioral analysis solutions to detect and block malicious activity at the moment of execution within the browser, rather than relying solely on network-level defenses.
Based on reporting by Cyber Security News.
