Then I diffed it online and discovered a wall of obfuscated code hidden after hundreds of empty spaces, like someone wanted you to stop scrolling before you ever saw it.
Clever. Hide the malicious code off the right of the viewport with a long string of spaces.
I’m surprised it worked. The default config in Vim and Neovim is to wrap long lines. I don’t even know the setting to turn that off, never needed to. This exploit will only work in certain editors. Even the online diff tool he used (GitHub?) nust have wrapped the text for him so he could see it.
I’m guessing Visual Studio Code doesn’t wrap long lines. That would make a large attack surface for this.
This is a huge reason why (for well over a decade) people have said "don't just copy and paste something from the web".