I was checking to see what was holding a particular JPG file open... `lsof -V | grep "filename"`. Hm, I thought, that's odd. TextEdit? TextEdit is open with a couple little note files. So I ran `lsof | grep "TextEdit" > wtf.txt` and got thousands of open files, of all filetypes, currently opened by TextEdit. It was an in-progress list that was systematically and alphabetically running through my entire directory structure.
I quit TextEdit, ran lsof again just to make sure there wasn't some other app called "TextEdit" doing it, and the list was blank. Since reopening it, I can't reproduce it.
After quite a bit of searching I can't find any other reports resembling this.
Anyone have any thoughts on it?
This is Monterey 12.6 so in theory not vulnerable to CVE-2019-8761[0]. Also did a search for anything on my drive with "<!DOCTYPE HTML>" inside a .txt file, and found none.
File descriptors were all 'txt' (regardless of filetype), type of files were all 'REG' regular.
[0]https://www.securemac.com/news/textedit-flaw-could-have-let-hackers-create-malicious-txt-files
If it's malicious, one possibility is that a malicious payload is masquerading as TextEdit using Dylib hijacking [0]. You can scan for this by using Dylib Hijack Scanner [1], a tool developed by Patrick Wardle, who was the researcher to first publicize the Dylib hijacking technique.
Also be sure to take a look at the other products from Patrick's site, some of which will help you monitor for and diagnose this kind of potentially malicious behavior.
[0] https://twitter.com/patrickwardle/status/1648865533041967105
[1] https://objective-see.org/products/dhs.html