all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Marshall, Simon" <Simon.Marshall@misys.com>
To: "Chong Yidong" <cyd@stupidchicken.com>, "Eli Zaretskii" <eliz@gnu.org>
Cc: Simon Marshall <simon@gnu.org>, mwelinder@gmail.com, emacs-devel@gnu.org
Subject: RE: [mwelinder@gmail.com: Emacs security bug]
Date: Mon, 12 May 2008 11:10:50 +0100	[thread overview]
Message-ID: <6EE216E1AA959543A555C60FF34FB7670418B0A2@maileube01.misys.global.ad> (raw)
In-Reply-To: 87mymy6wnq.fsf@stupidchicken.com

> > - --> Observe that code from foo.c.flc is run.  Not good.
> > (This is with Emacs 21.3.1; XEmacs is also affected, although step 1
needs to
> > be adjusted.)
> >
> > Suggestions:
> >
> > a. Remove "." from fast-lock-cache-directories.  Littering little
> > files everywhere is not a good idea anyway.
> >
> > b. Don't use load to handle the .flc file.  Instead read it into a
> > buffer and read one s-expression at a time and verify that it is
sane
> > before evaluating it.
> 
> Simon, could you take a look at this (you're listed as the author of
> fast-lock.el)?

OK, it seems fast-lock writes a single (fast-lock-cache-data ...) form
into the .flc file, and fast-lock loads the .flc file.  Is there a way
to restrict the forms evaluated during a load, rather than parsing the
.flc file?  Or a better way?

Also note that fast-lock-cache-data calls font-lock-compile-keywords
(when setting font-lock-keywords amongst others) which can ultimately
eval a keyword.  That would also be a security hole, right?  (I assume
that isn't a security issue in general because font-lock-keywords is a
risky local variable, but I think that is a security issue here.)
Someone could put their nasty form in the top-level call of
fast-lock-cache-data, for font-lock-compile-keyword to eval, rather than
at the top-level of the .flc file itself.  I don't see how that could be
fixed with the current design of font-lock.el.

I know this is a bit cheeky of me, but fast-lock.el is so old that even
its successor, lazy-lock.el, is in lisp/obsolete.  It was last updated
for functional purposes in 1996.  

Probably the most reasonable fix, in the circumstances, is to make
fast-lock-cache-directories a risky local variable and remove "." from
its default value?

Simon.


 "Misys" is the trade name for Misys plc (registered in England and Wales). Registration Number: 01360027. Registered office: Burleigh House, Chapel Oak, Salford Priors, Evesham WR11 8SP. For a list of Misys group operating companies please go to http://www.misys.com/html/about_us/group_operating_companies/. This email and any attachments have been scanned for known viruses using multiple scanners. 
 
We believe that this email and any attachments are virus free, however the recipient must take full responsibility for virus checking. This email message is intended for the named recipient only. It may be privileged and/or confidential. If you are not the named recipient of this email please notify us immediately and do not copy it or use it for any purpose, nor disclose its contents to any other person. This email does not constitute the commencement of legal relations between you and Misys plc. Please refer to the executed contract between you and the relevant member of the Misys group for the identity of the contracting party with which you are dealing. 




  parent reply	other threads:[~2008-05-12 10:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-09 21:44 [mwelinder@gmail.com: Emacs security bug] Eli Zaretskii
2008-05-09 23:19 ` Chong Yidong
2008-05-10  7:40   ` Eli Zaretskii
2008-05-10  8:28     ` Christian Faulhammer
2008-05-10 14:50 ` Chong Yidong
2008-05-10 15:16   ` Eli Zaretskii
2008-05-12 10:10   ` Marshall, Simon [this message]
2008-05-12 14:31     ` Stefan Monnier
2008-05-12 16:37       ` Marshall, Simon
2008-05-12 17:30         ` Stefan Monnier
2008-05-12 20:14         ` Ulrich Mueller
2008-05-12 20:37           ` Ulrich Mueller
2008-05-13  9:00             ` Marshall, Simon
2008-05-14 14:41               ` Ulrich Mueller
2008-05-14 14:52                 ` Marshall, Simon
2008-05-12 20:45           ` Stefan Monnier
2008-05-12 14:36     ` Florian Weimer
2008-05-12 16:21       ` Marshall, Simon

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=6EE216E1AA959543A555C60FF34FB7670418B0A2@maileube01.misys.global.ad \
    --to=simon.marshall@misys.com \
    --cc=cyd@stupidchicken.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mwelinder@gmail.com \
    --cc=simon@gnu.org \
    /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.