Menu

#1595 Sensitive information may be leaked in displaySqlResults of org.hsqldb.cmdline.SqlFile

version 2.5.x
closed-rejected
None
5
2021-03-07
2020-10-21
Xiaoqin Fu
No

In org.hsqldb.cmdline.SqlFile,
public String streamToString(InputStream is, final String cs)
throws IOException {
while (bytesread < ba.length &&
(retval = is.read(
ba, bytesread, ba.length - bytesread)) > 0) {
bytesread += retval;
}
}
......
private void displaySqlResults(Statement statement,
ResultSet r, final int[] incCols, final String filterString,
final boolean updateStatus) throws SQLException, SqlToolError {
......
if (excludeSysSchemas && interactive)
stdprintln(SqltoolRB.vendor_nosup_sysschemas.getString());
......
for (int i = 0; i < headerArray.length; i++) {
dsvSafe(headerArray[i]);
pwDsv.print(headerArray[i]);

        if (i < headerArray.length - 1)
            pwDsv.print(dsvColDelim);
    }
    pwDsv.print(dsvRowDelim);
    ......  
    for (int j = 0; j < fArray.length; j++) {
        if (pwDsv == null) dsvSafe(fArray[j]);
        pwDsv.print((fArray[j] == null)
                    ? (autonulls[j] ? "" : nullRepToken)
                    : fArray[j]);

        if (j < fArray.length - 1) pwDsv.print(dsvColDelim);
    }

    pwDsv.print(dsvRowDelim);

The sensitive information (for headerArray and dsvColDelim) may be leaked.
We may be able to add control on them.

Discussion

  • Xiaoqin Fu

    Xiaoqin Fu - 2020-12-21

    Should I open a PR for it?

     
  • Fred Toussi

    Fred Toussi - 2021-03-07
    • status: open --> closed-rejected
    • assigned_to: Fred Toussi
     
  • Fred Toussi

    Fred Toussi - 2021-03-07

    This ticked is not clear.

     

Log in to post a comment.

MongoDB Logo MongoDB