psftp and pscp should disable all forwarding (ports, X, agent).
[u/mdw/putty] / scp.c
diff --git a/scp.c b/scp.c
index 7a8cebd..f4c8d79 100644 (file)
--- a/scp.c
+++ b/scp.c
@@ -604,6 +604,15 @@ static void do_cmd(char *host, char *user, char *cmd)
        cfg.port = portnumber;
 
     /*
+     * Disable scary things which shouldn't be enabled for simple
+     * things like SCP and SFTP: agent forwarding, port forwarding,
+     * X forwarding.
+     */
+    cfg.x11_forward = 0;
+    cfg.agentfwd = 0;
+    cfg.portfwd[0] = cfg.portfwd[1] = '\0';
+
+    /*
      * Attempt to start the SFTP subsystem as a first choice,
      * falling back to the provided scp command if that fails.
      */