all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* eval and security
@ 2016-10-24 12:20 Andreas Röhler
  2016-10-24 12:31 ` tomas
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Röhler @ 2016-10-24 12:20 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

remember a saying like "avoid calls like (eval 'my-symbol) in lisp-code" 
as related to security issues.

Is there some reading to learn more? Maybe I'm mistaking something?

Thanks,

Andreas




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eval and security
  2016-10-24 12:20 eval and security Andreas Röhler
@ 2016-10-24 12:31 ` tomas
  2016-10-24 17:40   ` Andreas Röhler
  2016-10-24 18:50   ` Philipp Stephani
  0 siblings, 2 replies; 5+ messages in thread
From: tomas @ 2016-10-24 12:31 UTC (permalink / raw)
  To: help-gnu-emacs

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Oct 24, 2016 at 02:20:44PM +0200, Andreas Röhler wrote:
> Hi,
> 
> remember a saying like "avoid calls like (eval 'my-symbol) in
> lisp-code" as related to security issues.
> 
> Is there some reading to learn more? Maybe I'm mistaking something?

Perhaps because a randomly downloaded package can redefine 'my-symbol
to be something evil?

In any case, if you indirect your code through user-overridable
stuff (e.g. hooks), the least you can do is to use a defvar
marking the thing as "risky": then Emacs will do its best to
avoid changing it when the user doesn't expect it.

There's a chapter "Security Considerations" in the Emacs Lisp
manual[1].

regards

[1] https://www.gnu.org/software/emacs/manual/html_node/elisp/Security-Considerations.html
- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlgN/zcACgkQBcgs9XrR2kalLwCfYv6yRyRAECNQ9zCepzgdZJqb
9gMAn2nR87fNoh5nzMqF+bGVi6FncgXc
=QPBI
-----END PGP SIGNATURE-----



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eval and security
  2016-10-24 12:31 ` tomas
@ 2016-10-24 17:40   ` Andreas Röhler
  2016-10-24 18:50   ` Philipp Stephani
  1 sibling, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2016-10-24 17:40 UTC (permalink / raw)
  To: help-gnu-emacs



On 24.10.2016 14:31, tomas@tuxteam.de wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, Oct 24, 2016 at 02:20:44PM +0200, Andreas Röhler wrote:
>> Hi,
>>
>> remember a saying like "avoid calls like (eval 'my-symbol) in
>> lisp-code" as related to security issues.
>>
>> Is there some reading to learn more? Maybe I'm mistaking something?
> Perhaps because a randomly downloaded package can redefine 'my-symbol
> to be something evil?

Yes, that would be the problem. However, the way Emacs works, any symbol 
might be replaced by such a package, right?




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eval and security
  2016-10-24 12:31 ` tomas
  2016-10-24 17:40   ` Andreas Röhler
@ 2016-10-24 18:50   ` Philipp Stephani
  2016-10-25  7:34     ` Andreas Röhler
  1 sibling, 1 reply; 5+ messages in thread
From: Philipp Stephani @ 2016-10-24 18:50 UTC (permalink / raw)
  To: tomas, help-gnu-emacs

<tomas@tuxteam.de> schrieb am Mo., 24. Okt. 2016 um 14:32 Uhr:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Mon, Oct 24, 2016 at 02:20:44PM +0200, Andreas Röhler wrote:
> > Hi,
> >
> > remember a saying like "avoid calls like (eval 'my-symbol) in
> > lisp-code" as related to security issues.
> >
> > Is there some reading to learn more? Maybe I'm mistaking something?
>
> Perhaps because a randomly downloaded package can redefine 'my-symbol
> to be something evil?
>

Randomly downloaded packages can just say
(eval-when-compile (shell-command "rm -rf /"))
No need to override symbols to do something evil.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: eval and security
  2016-10-24 18:50   ` Philipp Stephani
@ 2016-10-25  7:34     ` Andreas Röhler
  0 siblings, 0 replies; 5+ messages in thread
From: Andreas Röhler @ 2016-10-25  7:34 UTC (permalink / raw)
  To: help-gnu-emacs



On 24.10.2016 20:50, Philipp Stephani wrote:
> <tomas@tuxteam.de> schrieb am Mo., 24. Okt. 2016 um 14:32 Uhr:
>
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> On Mon, Oct 24, 2016 at 02:20:44PM +0200, Andreas Röhler wrote:
>>> Hi,
>>>
>>> remember a saying like "avoid calls like (eval 'my-symbol) in
>>> lisp-code" as related to security issues.
>>>
>>> Is there some reading to learn more? Maybe I'm mistaking something?
>> Perhaps because a randomly downloaded package can redefine 'my-symbol
>> to be something evil?
>>
> Randomly downloaded packages can just say
> (eval-when-compile (shell-command "rm -rf /"))
> No need to override symbols to do something evil.

For the moment taking `symbol-value' as less powerful and sufficient at 
the use-cases - later calls to `looking-at' etc.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-10-25  7:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-24 12:20 eval and security Andreas Röhler
2016-10-24 12:31 ` tomas
2016-10-24 17:40   ` Andreas Röhler
2016-10-24 18:50   ` Philipp Stephani
2016-10-25  7:34     ` Andreas Röhler

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.