Open sogewasp opened 5 years ago
I found that the vulnerable part is in the file
syntastic/syntax_checkers/xml/xmllint.vim
but I didn't yet get the logic and why it's making the requests (maybe it's a feature !), so I decided to make an issue to discuss if it's necessary to patch or it's a normal behavior.
Syntastic doesn't do any network operation itself. It also doesn't care about the contents of your files. What syntastic does is run third-party linters against your files, parses their output, and shows you the results in a window. That's all it does. If the linter involved in your test is xmllint
my guess would be you're seeing xmllint(1)
fetching DTD(s).
To see the exact command lines constructed by syntastic you can set g:syntastic_debug
to 1, run the relevant checker, run :mes
, and look for makeprg
in the output (cf. :h syntastic-debug
). To prevent xmllint(1)
from making network requetsts you can install the DTDs it wants locally (cf. :h syntastic-xml-xmllint
), or I suppose you can pass the relevant command line options to xmllint(1)
(cf. :h syntastic-config-makeprg
for syntastic's part in the affair). Better yet, you probably shouldn't use syntastic to check unknown files.
Syntastic is not secure. It was never meant to be secure. Several security problems have been found in it, and I'm sure there are many more yet to be discovered. Most of the time the "solution" to these was to tell people they're running checkers X, Y, Z on their own risk. So please use your common sense: syntastic is a damned Vim script. It can't protect itself from normal operation, let alone protect you against malicious third-party code. shrug
Ok, I'll check for the debug symbols as soon as I have some time. Still I find it a dangerous vector of exploitation in certain situations, it could mean that simply opening a file with vim would turn in an information disclosure or worse RCE... Even if syntastic isn't conceived with security in mind and you aren't up to patch it, in my opinion at least a disclaimer should be on the Readme (I didn't see it, but maybe I missed it), giving advice to users.
Even if syntastic isn't conceived with security in mind and you aren't up to patch it
Since you rise this point, here's a short categorization of the kind of security problems syntastic has had so far:
in my opinion at least a disclaimer should be on the Readme (I didn't see it, but maybe I missed it), giving advice to users.
If you find an actual vulnerability I'll try to patch it. Or perhaps add a note about it. Patches are still welcome. :smile:
I just ran into this same (surprising) issue. What about passing (at least) --nonet
to xmllint
by default? It will at least prevent it from reaching out to remote servers when parsing XML documents.
@Matir That would also prevent xmllint
from working in that particular situation, otherwise (presumably) xmllint
wouldn't make network requests.
THATS VERY MALICIOUS ACTION. I DONT WANT RCE BY OPENING A FILE.
Then complain to xmllint
developers?
@machinexa2 You can disable XML/XSLT parsing by customizing parsers for syntastic in your vimrc
:
let g:syntastic_xml_checkers=['']
let g:syntastic_xslt_checkers=['']
Though I disagree with @lcd047 about what the default should be, I respect the choice and acknowledge that it's a tradeoff between security and usability.
Keep in mind that opening a potentially malicious file with vim probably has lots of risk outside of syntastic as well. Look at the history of modelines.
Hello, yesterday I was pentesting a website and I was happy to see some XXE popping out in my Burp. Then I realized that the requests weren't coming from the website but from my own machine! So I investigated and found out that syntastic was making the requests while parsing my XML containing the XXE.
Here's one of the payloads I tested:
And here's the results on Burp:
The requests are made each time syntastic parses the file, so also at the very moment you open it !
I found that the vulnerable part is in the file
syntastic/syntax_checkers/xml/xmllint.vim
but I didn't yet get the logic and why it's making the requests (maybe it's a feature !), so I decided to make an issue to discuss if it's necessary to patch or it's a normal behavior.I am not yet able to exfiltrate data but I'm working on it, and maybe there's other security ninjas with fancy tricks capable of doing it.
Other useful information: