GenAI-Powered Web Attacks Dynamically Generate Malicious JavaScript in Victims’ Browsers

Related

Google Deploys Gemini AI to Monitor Dark Web for Cyber Threats

What happened Google has deployed Gemini AI agents within its...

High-Severity Bug in Chrome’s Google Gemini AI Panel Could Have Enabled Hijacking

What happened Google patched a high-severity vulnerability (tracked as CVE-2026-0628)...

Google Cloud API Key Exposure Could Give Attackers Gemini AI Access and Generate Large Bills

What happened Security researchers at Truffle Security discovered that nearly...

Cybercriminals Use Fake “Gemini” AI Chatbot to Push Fraudulent Crypto Scam

What happened Cybercriminals launched a fraudulent “Google Coin” presale website...

Chrome Extensions Steal 900,000 ChatGPT and DeepSeek Chats

What happened Two Chrome extensions were caught stealing ChatGPT and...

Share

What happened

Hackers can use GenAI to change loaded clean page into malicious within seconds by embedding hidden prompt instructions in otherwise benign webpages, then requesting code from public APIs of AI services such as Google Gemini and DeepSeek. The report described attackers using prompt-engineering techniques to induce AI systems to generate malicious JavaScript at runtime, which then executes directly in the victim’s browser and turns the page into phishing or credential-stealing content. Because the payload is generated and executed only at runtime, the technique leaves little static evidence on the site itself, and each visit can produce polymorphic variations that evade signature-based detection. The activity was attributed to research and proof-of-concept work by Palo Alto Networks Unit 42, which described how trusted AI service domains can make network-based filtering less effective when malicious code is fetched from reputable endpoints.

Who is affected

Organizations with users browsing compromised or weaponized sites are directly affected through credential theft and session compromise risk. Security teams are indirectly affected because runtime-generated, polymorphic scripts can reduce effectiveness of static scanning and signature-based web security controls.

Why CISOs should care

Runtime, AI-generated payloads shift web threat detection toward behavioral controls and browser execution monitoring. If malicious code originates from trusted AI domains, network allowlists and domain reputation controls can become liabilities, increasing the chance of credential theft and enterprise session hijacking.

3 practical actions

  • Enhance browser runtime protection: Deploy or tune controls that detect suspicious in-browser script behavior, credential harvesting, and dynamic DOM manipulation. 
  • Monitor AI API usage from endpoints: Alert on unusual client-side requests to AI service APIs from general browsing contexts and investigate anomalous prompt-like traffic. 
  • Strengthen anti-phishing controls: Use phishing-resistant authentication and conditional access to reduce impact if browser credentials or sessions are compromised.
IMG 0514 2
+ posts

John Kevin Hao is a news and feature writer covering cybersecurity, technology, and business targeted for professional audiences.