Cursor's Auto-Generated .desktop Files Expose Critical Agent Attack Surface

muayyadalsadi · reddit · 2026-08-11

A developer discovered that Cursor automatically created a high-risk .desktop file during a planning task. These files can spoof the UI, attach malicious scripts to trusted file handlers, or auto-start malicious payloads.

The author warns that agents processing files with hidden prompt injection instructions could easily be tricked into generating malicious .desktop files. They recommend that AI agents implement special handling and explicit, case-by-case confirmation for such sensitive files.

Original post →

More from coding & agent

coding & agent channel →