<div dir="ltr"><div>Hi security team,</div><div><br></div>There's some code in ProcessBuilder.java to avoid leaking data in case ProcessBuilder.start fails.<div>It appears to have an obvious bug, with an obvious fix.</div>
<div><br></div><div><a href="http://cr.openjdk.java.net/~martin/webrevs/openjdk8/ProcessBuilder-checkRead/">http://cr.openjdk.java.net/~martin/webrevs/openjdk8/ProcessBuilder-checkRead/</a><br></div><div><br></div><div>checkRead is spec'ed to throw SecurityException, not <span style="color:rgb(0,0,0);white-space:pre-wrap">AccessControlException. If checkRead does throw SecurityException, then start will throw the wrong exception.</span></div>
<div><span style="color:rgb(0,0,0);white-space:pre-wrap"><br></span></div><div><span style="color:rgb(0,0,0);white-space:pre-wrap">Untested.</span></div><div><pre style="color:rgb(0,0,0);word-wrap:break-word;white-space:pre-wrap">
@@ -1033,9 +1033,9 @@
// Can not disclose the fail reason for read-protected files.
try {
security.checkRead(prog);
- } catch (AccessControlException ace) {
+ } catch (SecurityException e) {
exceptionInfo = "";
- cause = ace;
+ cause = e;
}
}
// It's much easier for us to create a high-quality error</pre></div></div>