mirror of
https://github.com/9001/copyparty.git
synced 2026-08-13 13:53:06 -06:00
windows: add DLL-hijacking warning;
famously, windows prefers cwd when resolving a binary to execute, rather than a predefined PATH like linux / unix / every other OS even worse, it also does this for DLLs, and mitigating *that* is infeasible because it depends on variables we dont control print a warning in case someone is unaware of this
This commit is contained in:
parent
c70dc7ac56
commit
bb40804f2d
|
|
@ -3059,6 +3059,8 @@ class AuthSrv(object):
|
||||||
zv, _ = vfs.get("", "*", False, True, err=999)
|
zv, _ = vfs.get("", "*", False, True, err=999)
|
||||||
if self.warn_anonwrite and verbosity > 4 and os.getcwd() == zv.realpath:
|
if self.warn_anonwrite and verbosity > 4 and os.getcwd() == zv.realpath:
|
||||||
t = "anyone can write to the current directory: {}\n"
|
t = "anyone can write to the current directory: {}\n"
|
||||||
|
if ANYWIN:
|
||||||
|
t += "/!\\ NOTE: because you are using Windows, this is extra dangerous (DLL-hijacking)\n"
|
||||||
self.log(t.format(zv.realpath), c=1)
|
self.log(t.format(zv.realpath), c=1)
|
||||||
|
|
||||||
self.warn_anonwrite = False
|
self.warn_anonwrite = False
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue