<div dir="ltr"><div dir="ltr">Hi,<br><div><br></div><div>The long-standing FTP fallback feature supported by the 'file:' URL scheme handler seems dubious to me:</div><div><br></div><div>1: It does not follow the principle of least surprise. At least for me, it's a reasonable expectation that a file: URL should only interact with files using only the file system. The current behavior may have made sense in the early days of the JDK, today it seems a bit of an oddity.</div><div><br></div><div>2: It makes it harder to reason about security implications when a file: URL can be used to open a network connection to remote hosts.</div><div><br></div><div>3: Using the 'ftp:' scheme explicitly seems a better option if anyone really wants to connect using FTP.</div><div><br></div><div>4: While RFC 8089 [1] does define non-local file URLs, it has little to say about their operations other than explicitly not "defining or forbidding" them. The security consideration section mentions that "attempting to perform local operations on a non-local URI, can result in security problems."</div><div><br></div><div>May I suggest that we introduce a system property for this feature, initially enabled by default? Users concerned by this feature may then use this property to disable it. At a later point, we may consider switching the default to false, in which case the same property may be used to re-enable the feature.</div><div><br></div><div>The feature seems undocumented, but given Hyrum's law, we can probably expect there is code out there relying on it, however rare FTP has become these days.</div><div><br></div><div>Cheers,</div><div>Eirik</div><div><br></div><div>[1] <a href="https://www.rfc-editor.org/rfc/rfc8089.html">https://www.rfc-editor.org/rfc/rfc8089.html</a></div><div><br></div></div>
</div>