From b331bb1c8c8cc306b91e4d94221969335a7a3e86 Mon Sep 17 00:00:00 2001 From: ed Date: Mon, 27 Jul 2026 18:50:44 +0000 Subject: [PATCH] ftp: fix GHSA-phv8-wgjp-g4p9 (stou) --- copyparty/ftpd.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/copyparty/ftpd.py b/copyparty/ftpd.py index 28f4d127..169c8d43 100644 --- a/copyparty/ftpd.py +++ b/copyparty/ftpd.py @@ -483,6 +483,10 @@ class FtpFs(AbstractedFS): def get_group_by_uid(self, gid: int) -> str: return "root" + def mkstemp(self, *a, **ka): + self.log("mkstemp%r @%s" % (a, self.uname)) + raise FSE("nope") + class FtpHandler(FTPHandler): abstracted_fs = FtpFs @@ -518,6 +522,9 @@ class FtpHandler(FTPHandler): # reduce non-debug logging self.log_cmds_list = [x for x in self.log_cmds_list if x not in ("CWD", "XCWD")] + def ftp_STOU(self, *a) -> None: + self.respond("550 nope", logging.warning) + def ftp_STOR(self, file: str, mode: str = "w") -> Any: # Optional[str] vp = join(self.fs.cwd, file).lstrip("/")