when somebody set UIMainWindowPreferencesProvider.singleInstance to true in jd-gui.cfg ,the InterProcessCommunicationUtil class will be called,
let's check it,it opens a listener on fixed port 20156 (If the IP is exposed to the public network or is accessible between intranets, it may be affected when using jd-gui)to deserialize the incoming data and the deserialized data is then passed to the function org.jd.gui.controller.MainController#openFiles for processing
in org.jd.gui.controller.MainController#openFiles, if erros is not empty, it will calls JOptionPane.showMessageDialog
we knowthe jdgui tool is built with swing components,so if we can control the data we can insert some html code
let's test it
Vulnerability Analysis
when somebody set
UIMainWindowPreferencesProvider.singleInstance
to true injd-gui.cfg
,the InterProcessCommunicationUtil class will be called,let's check it,it opens a listener on fixed port 20156 (If the IP is exposed to the public network or is accessible between intranets, it may be affected when using jd-gui)to deserialize the incoming data and the deserialized data is then passed to the function
org.jd.gui.controller.MainController#openFiles
for processingin
org.jd.gui.controller.MainController#openFiles
, if erros is not empty, it will callsJOptionPane.showMessageDialog
we knowthe jdgui tool is built with swing components,so if we can control the data we can insert some html code let's test it
in this case,we found that the inserted html code was not rendered
After reading the code, we found that we need the html tags to be at the top of each line to work,so we can try to insert a line break
String[] strings = {"/\n\n\n\n<html><body><h1 color='red'>Hacked By Y4tacker</h1></body></html>"}; then,html tags are successfully rendered
So since we can render any html tag, it stands to reason that we can work with the src attribute of the img tag to achieve ssrf
Recommendations
in
org.jd.gui.controller.MainController#openFiles
The return value of file.getAbsolutePath() is made harmless by removing the newline(\n) character or removing html tags from the return value