CVE-2016-1192 - Exposure of Sensitive Information to an Unauthorized Actor

Severity

40%

Complexity

80%

Confidentiality

48%

Directory traversal vulnerability in the logging implementation in Cybozu Garoon 3.7 through 4.2 allows remote authenticated users to read a log file via unspecified vectors.

Directory traversal vulnerability in the logging implementation in Cybozu Garoon 3.7 through 4.2 allows remote authenticated users to read a log file via unspecified vectors.

CVSS 3.0 Base Score 4.3. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:N/A:N).

CVSS 2.0 Base Score 4. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (AV:N/AC:L/Au:S/C:P/I:N/A:N).

Demo Examples

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

The following code checks validity of the supplied username and password and notifies the user of a successful or failed login.


               
}
}
print "Login Successful";
print "Login Failed - incorrect password";
print "Login Failed - unknown username";

In the above code, there are different messages for when an incorrect username is supplied, versus when the username is correct but the password is wrong. This difference enables a potential attacker to understand the state of the login function, and could allow an attacker to discover a valid username by trying different values until the incorrect password message is returned. In essence, this makes it easier for an attacker to obtain half of the necessary authentication credentials.

While this type of information may be helpful to a user, it is also useful to a potential attacker. In the above example, the message for both failed cases should be the same, such as:


               
"Login Failed - incorrect username or password"

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

This code tries to open a database connection, and prints any exceptions that occur.


               
}
openDbConnection();
//print exception message that includes exception message and configuration file location
echo 'Check credentials in config file at: ', $Mysql_config_location, '\n';

If an exception occurs, the printed message exposes the location of the configuration file the script is using. An attacker can use this information to target the configuration file (perhaps exploiting a Path Traversal weakness). If the file can be read, the attacker could gain credentials for accessing the database. The attacker may also be able to replace the file with a malicious one, causing the application to use an arbitrary database.

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

In the example below, the method getUserBankAccount retrieves a bank account object from a database using the supplied username and account number to query the database. If an SQLException is raised when querying the database, an error message is created and output to a log file.


               
}
return userAccount;
}
userAccount = (BankAccount)queryResult.getObject(accountNumber);
Logger.getLogger(BankManager.class.getName()).log(Level.SEVERE, logMessage, ex);

The error message that is created includes information about the database query that may contain sensitive information about the database or query logic. In this case, the error message will expose the table name and column names used in the database. This data could be used to simplify other attacks, such as SQL injection (CWE-89) to directly access the database.

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

This code stores location information about the current user:


               
}...
Log.e("ExampleActivity", "Caught exception: " + e + " While on User:" + User.toString());

When the application encounters an exception it will write the user object to the log. Because the user object contains location information, the user's location is also written to the log.

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

The following is an actual MySQL error statement:


               
Warning: mysql_pconnect(): Access denied for user: 'root@localhost' (Using password: N1nj4) in /usr/local/www/wi-data/includes/database.inc on line 4

The error clearly exposes the database credentials.

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

This code displays some information on a web page.


               
Social Security Number: <%= ssn %></br>Credit Card Number: <%= ccn %>

The code displays a user's credit card and social security numbers, even though they aren't absolutely necessary.

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

The following program changes its behavior based on a debug flag.


               
} %>

The code writes sensitive debug information to the client browser if the "debugEnabled" flag is set to true .

Exposure of Sensitive Information to an Unauthorized Actor

CWE-200

This code uses location to determine the user's current US State location.

First the application must declare that it requires the ACCESS_FINE_LOCATION permission in the application's manifest.xml:


               
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>

During execution, a call to getLastLocation() will return a location based on the application's location permissions. In this case the application has permission for the most accurate location possible:


               
deriveStateFromCoords(userCurrLocation);

While the application needs this information, it does not need to use the ACCESS_FINE_LOCATION permission, as the ACCESS_COARSE_LOCATION permission will be sufficient to identify which US state the user is in.

Demo Examples

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CWE-22

The following code could be for a social networking application in which each user's profile information is stored in a separate file. All files are stored in a single directory.


               
print "</ul>\n";
print "<li>$_</li>\n";

While the programmer intends to access files such as "/users/cwe/profiles/alice" or "/users/cwe/profiles/bob", there is no verification of the incoming user parameter. An attacker could provide a string such as:


               
../../../etc/passwd

The program would generate a profile pathname like this:


               
/users/cwe/profiles/../../../etc/passwd

When the file is opened, the operating system resolves the "../" during path canonicalization and actually accesses this file:


               
/etc/passwd

As a result, the attacker could read the entire text of the password file.

Notice how this code also contains an error message information leak (CWE-209) if the user parameter does not produce a file that exists: the full pathname is provided. Because of the lack of output encoding of the file that is retrieved, there might also be a cross-site scripting problem (CWE-79) if profile contains any HTML, but other code would need to be examined.

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CWE-22

In the example below, the path to a dictionary file is read from a system property and used to initialize a File object.


               
File dictionaryFile = new File(filename);

However, the path is not validated or modified to prevent it from containing relative or absolute path sequences before creating the File object. This allows anyone who can control the system property to determine what file is used. Ideally, the path should be resolved relative to some kind of application or user home directory.

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CWE-22

The following code takes untrusted input and uses a regular expression to filter "../" from the input. It then appends this result to the /home/user/ directory and attempts to read the file in the final resulting path.


               
ReadAndSendFile($filename);

Since the regular expression does not have the /g global match modifier, it only removes the first instance of "../" it comes across. So an input value such as:


               
../../../etc/passwd

will have the first "../" stripped, resulting in:


               
../../etc/passwd

This value is then concatenated with the /home/user/ directory:


               
/home/user/../../etc/passwd

which causes the /etc/passwd file to be retrieved once the operating system has resolved the ../ sequences in the pathname. This leads to relative path traversal (CWE-23).

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CWE-22

The following code attempts to validate a given input path by checking it against a whitelist and once validated delete the given file. In this specific case, the path is considered valid if it starts with the string "/safe_dir/".


               
}
f.delete()

An attacker could provide an input such as this:


               
/safe_dir/../important.dat

The software assumes that the path is valid because it starts with the "/safe_path/" sequence, but the "../" sequence will cause the program to delete the important.dat file in the parent directory

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

CWE-22

The following code demonstrates the unrestricted upload of a file with a Java servlet and a path traversal vulnerability. The HTML code is the same as in the previous example with the action attribute of the form sending the upload file request to the Java servlet instead of the PHP code.


               
</form>
<input type="submit" name="submit" value="Submit"/>

When submitted the Java servlet's doPost method will receive the request, extract the name of the file from the Http request header, read the file contents from the request and output the file to the local upload directory.


               
}
{...}// the starting position of the boundary header// verify that content type is multipart form data
// output the file to the local upload directory
bw.close();
}
bw.flush();
// output successful upload response HTML page
// output unsuccessful upload response HTML page
...

This code does not check the filename that is provided in the header, so an attacker can use "../" sequences to write to files outside of the intended directory. Depending on the executing environment, the attacker may be able to specify arbitrary files to write to, leading to a wide variety of consequences, from code execution, XSS (CWE-79), or system crash.

Also, this code does not perform a check on the type of the file being uploaded. This could allow an attacker to upload any executable file or other file with malicious code (CWE-434).

Overview

Type

Cybozu Garoon

First reported 8 years ago

2016-06-19 20:59:00

Last updated 8 years ago

2016-06-21 18:12:00

Affected Software

Cybozu Garoon 3.7.0

3.7.0

Cybozu Garoon 3.7.1

3.7.1

Cybozu Garoon 3.7.2

3.7.2

Cybozu Garoon 3.7.3

3.7.3

Cybozu Garoon 3.7.4

3.7.4

Cybozu Garoon 3.7.5

3.7.5

Cybozu Garoon 4.0.0

4.0.0

Cybozu Garoon 4.0.1

4.0.1

Cybozu Garoon 4.0.2

4.0.2

Cybozu Garoon 4.0.3

4.0.3

Cybozu Garoon 4.2.0

4.2.0

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.