From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rob Browning Newsgroups: gmane.lisp.guile.bugs Subject: bug#18477: Bug#758971: byte-compiled files have wrong permissions Date: Sun, 14 Sep 2014 16:33:47 -0500 Message-ID: <87k355yjic.fsf@trouble.defaultvalue.org> References: <8208031408792652@web8g.yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1410730524 2941 80.91.229.3 (14 Sep 2014 21:35:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 14 Sep 2014 21:35:24 +0000 (UTC) Cc: 758971@bugs.debian.org, 758971-forwarded@bugs.debian.org, Rand Peters To: 18477@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Sep 14 23:35:16 2014 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XTHRz-0002eE-VO for guile-bugs@m.gmane.org; Sun, 14 Sep 2014 23:35:16 +0200 Original-Received: from localhost ([::1]:56313 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHRz-0006Cu-Iv for guile-bugs@m.gmane.org; Sun, 14 Sep 2014 17:35:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34978) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHRs-0006AT-4L for bug-guile@gnu.org; Sun, 14 Sep 2014 17:35:12 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTHRn-0000N4-1c for bug-guile@gnu.org; Sun, 14 Sep 2014 17:35:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:49430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHRm-0000M3-TK for bug-guile@gnu.org; Sun, 14 Sep 2014 17:35:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XTHRm-0004ow-H2 for bug-guile@gnu.org; Sun, 14 Sep 2014 17:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Rob Browning Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Sun, 14 Sep 2014 21:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18477 X-GNU-PR-Package: guile X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.141073044718459 (code B ref -1); Sun, 14 Sep 2014 21:35:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Sep 2014 21:34:07 +0000 Original-Received: from localhost ([127.0.0.1]:40994 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XTHQs-0004ne-8b for submit@debbugs.gnu.org; Sun, 14 Sep 2014 17:34:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:32977) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XTHQp-0004nV-9Z for submit@debbugs.gnu.org; Sun, 14 Sep 2014 17:34:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTHQk-0008BE-39 for submit@debbugs.gnu.org; Sun, 14 Sep 2014 17:34:02 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54217) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHQk-0008BA-12 for submit@debbugs.gnu.org; Sun, 14 Sep 2014 17:33:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHQf-0005zW-EC for bug-guile@gnu.org; Sun, 14 Sep 2014 17:33:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XTHQa-0008AW-UY for bug-guile@gnu.org; Sun, 14 Sep 2014 17:33:53 -0400 Original-Received: from defaultvalue.org ([70.85.129.156]:37509) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XTHQa-0008AO-QJ for bug-guile@gnu.org; Sun, 14 Sep 2014 17:33:48 -0400 Original-Received: from trouble.defaultvalue.org (localhost [127.0.0.1]) (Authenticated sender: rlb@defaultvalue.org) by defaultvalue.org (Postfix) with ESMTPSA id D162C2015C; Sun, 14 Sep 2014 16:33:47 -0500 (CDT) Original-Received: by trouble.defaultvalue.org (Postfix, from userid 1000) id 82BB114E189; Sun, 14 Sep 2014 16:33:47 -0500 (CDT) In-Reply-To: <8208031408792652@web8g.yandex.ru> User-Agent: Notmuch/0.18.1 (http://notmuchmail.org) Emacs/24.3.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7547 Archived-At: [If possible, please preserve the -forwarded address in any replies.] I suspect this should be fixed, if it hasn't been already. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=758971 Thanks Rand Peters writes: > Package: guile-2.0 > Version: 2.0.11+1-1 > Tags: security > > Guile automatically byte-compiles programs when they are run, and > places the byte-compiled file in a subdirectory of > $HOME/.cache/guile/. > > However, the permissions of the byte-compiled file are derived from > umask rather than the permissions of the source file. This means that > sensitive data (e.g. a hard-coded password) contained in a source file > with restrictive permissions will be copied into a byte-compiled file > that may be world-readable. > > Guile should ensure that the permissions of byte-compiled files match > those of the source. > > Example: > > $ touch myscript > > $ chmod 700 myscript # source file readable only to owner > > $ cat >> myscript <<'EOF' > #!/usr/bin/guile \ > -e main -s > !# > > (define secret-password "DEADBEEFDEADBEEF") > > (define (main args) > (display "this program contains an embedded secret") > (newline)) > EOF > > $ ./myscript > ;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0 > ;;; or pass the --no-auto-compile argument to disable. > ;;; compiling /home/rwp/./myscript > ;;; compiled /home/rwp/.cache/guile/ccache/2.0-LE-4-2.0/home/rwp/myscript.go > this program contains an embedded secret > > $ ls -l ~rwp/.cache/guile/ccache/2.0-LE-4-2.0/home/rwp/myscript.go > -rw-r--r-- 1 rwp rwp 456 Jul 1 12:00 /home/[...]/myscript.go > > # ^^ Note that the byte-compiled file is world-readable > > $ strings ~rwp/.cache/guile/ccache/2.0-LE-4-2.0/home/rwp/myscript.go > [...] > DEADBEEFDEADBEEF > secret-password > [...] -- Rob Browning rlb @defaultvalue.org and @debian.org GPG as of 2011-07-10 E6A9 DA3C C9FD 1FF8 C676 D2C4 C0F0 39E9 ED1B 597A GPG as of 2002-11-03 14DD 432F AE39 534D B592 F9A0 25C8 D377 8C7E 73A4