all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: eric.hanchrow@gmail.com
To: emacs-devel@gnu.org
Cc: Eric Hanchrow <erich@cozi.com>
Subject: [PATCH] python.el(run-python): Explain why we remove the current directory from sys.path
Date: Fri, 13 Mar 2009 12:01:25 -0700	[thread overview]
Message-ID: <1236970885-12281-1-git-send-email-eric.hanchrow@gmail.com> (raw)

From: Eric Hanchrow <erich@cozi.com>

---
 lisp/progmodes/python.el |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 7221d8e..81d073a 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1552,7 +1552,11 @@ buffer for a list of commands.)"
     (with-current-buffer
 	(let* ((cmdlist
 		(append (python-args-to-list cmd)
-			'("-i" "-c" "import sys; sys.path.remove('')")))
+			;; Removing the current directory from
+			;; sys.path prevents an attacker from tricking
+			;; us into running malicious code.  See
+			;; http://article.gmane.org/gmane.emacs.devel/103569
+                        '("-i" "-c" "import sys; sys.path.remove('')")))
 	       (path (getenv "PYTHONPATH"))
 	       (process-environment	; to import emacs.py
 		(cons (concat "PYTHONPATH="
-- 
1.6.2






                 reply	other threads:[~2009-03-13 19:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236970885-12281-1-git-send-email-eric.hanchrow@gmail.com \
    --to=eric.hanchrow@gmail.com \
    --cc=emacs-devel@gnu.org \
    --cc=erich@cozi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.