Skip to content

Commit 0845ecb

Browse files
committed
docs: add warnings about FILE: URLs on Windows
- --url man page section - libcurl-security.3 gets the full text - CURLOPT_URL.3 Reported-by: Tim Sedlmeyer
1 parent fe8ba51 commit 0845ecb

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

docs/cmdline-opts/url.d

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ setting a default protocol, see --proto-default for details.
1313

1414
This option may be used any number of times. To control where this URL is
1515
written, use the --output or the --remote-name options.
16+
17+
Warning: On Windows, particular file:// accesses can be converted to network
18+
accesses by the operating system. Beware!

docs/libcurl/libcurl-security.3

+27-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.\" * | (__| |_| | _ <| |___
66
.\" * \___|\___/|_| \_\_____|
77
.\" *
8-
.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
8+
.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
99
.\" *
1010
.\" * This software is licensed as described in the file COPYING, which
1111
.\" * you should have received as part of this distribution. The terms
@@ -217,6 +217,32 @@ avoid that, keep control of what URLs to use and/or prevent curl/libcurl from
217217
using the protocol.
218218

219219
By default, libcurl prohibits redirects to file:// URLs.
220+
221+
.SH "Warning: file:// on Windows"
222+
The Windows operating system will automatically, and without any way for
223+
applications to disable it, try to establish a connection to another host over
224+
the network and access it (over SMB or other protocols), if only the correct
225+
file path is accessed.
226+
227+
When first realizing this, the curl team tried to filter out such attempts in
228+
order to protect applications for inadvertent probes of for example internal
229+
networks etc. This resulted in CVE-2019-15601 and the associated security fix.
230+
231+
However, we've since been made aware of the fact that the previous fix was far
232+
from adequate as there are several other ways to accomplish more or less the
233+
same thing: accessing a remote host over the network instead of the local file
234+
system.
235+
236+
The conclusion we have come to is that this is a weakness or feature in the
237+
Windows operating system itself, that we as an application cannot safely
238+
protect users against. It would just be a whack-a-mole race we don't want to
239+
participate in. There are too many ways to do it and there's no knob we can
240+
use to turn off the practice.
241+
242+
If you use curl or libcurl on Windows (any version), disable the use of the
243+
FILE protocol in curl or be prepared that accesses to a range of "magic paths"
244+
will potentially make your system try to access other hosts on your
245+
network. curl cannot protect you against this.
220246
.SH "What if the user can set the URL"
221247
Applications may find it tempting to let users set the URL that it can work
222248
on. That's probably fine, but opens up for mischief and trickery that you as

docs/libcurl/opts/CURLOPT_URL.3

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
.\" * | (__| |_| | _ <| |___
66
.\" * \___|\___/|_| \_\_____|
77
.\" *
8-
.\" * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
8+
.\" * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
99
.\" *
1010
.\" * This software is licensed as described in the file COPYING, which
1111
.\" * you should have received as part of this distribution. The terms
@@ -152,6 +152,10 @@ path.
152152
ftp://user:password@ftp.example.com//readme.txt - This retrieves the readme.txt
153153
from the root directory when logging in as a specified user.
154154

155+
.IP FILE
156+
When a FILE:// URL is accessed on Windows systems, it can be crafted in a way
157+
so that Windows attempts to connect to a (remote) machine when curl wants to
158+
read or write such a path.
155159
.IP SMTP
156160
The path part of a SMTP request specifies the host name to present during
157161
communication with the mail server. If the path is omitted then libcurl will

0 commit comments

Comments
 (0)