emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Tom Gillespie <tgbugs@gmail.com>
Cc: Tim Cross <theophilusx@gmail.com>, emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Local variables insecurities - Re: One vs many directories
Date: Thu, 26 Nov 2020 08:06:36 +0300	[thread overview]
Message-ID: <X7833Oj7cjHb8lKW@protected.rcdrun.com> (raw)
In-Reply-To: <CA+G3_PMh_-a+HtkUQTDmvWv1satUqhx=P6mwMrviDcRR7irqtA@mail.gmail.com>

* Tom Gillespie <tgbugs@gmail.com> [2020-11-26 05:07]:
> Hi Jean,
> 
> Some points in summary before a long email.
> 1. Having an accepting default behavior as a user (i.e., saying yes to
>    all prompts) is bad security practice. The only thing that systems
>    can do is prompt as infrequently as possible in hopes that people
>    don't get prompt fatigue. Emacs does this.

I know, and do not speak for one person but for those who will not
know. To ask users who do not know programming using editor for text
editing and to assume that users will know programming terms:
variables, values, applying, safe and ANYTHING else that is written in
eval: is bad security practice.

> 2. If mutt is launching Emacs, you can pass --eval "(setq
>    enable-local-eval nil)" on the command line and all file local
>    variables will be ignored and treated as plain text.

Sure, I know, but human text editors will not know. They are faced
with YES/NO. What has to be improved is the YES/NO dialogue that has
no hyperlinks to its corresponding explanations and asks users things
with wrong assumption that user will understand them.

> 3. If people don't read the manual and don't read the prompt, there
>    isn't much more that Emacs can do while still empowering the
>    user.

Empowering can take place in the dialogue as such has enhancement
space. Do you think it is good idea?

>   In those cases we also can't assume that the community will be of
>   much help either, as we are trying to be here.

Community is of great help. Users are many and just fraction of users
are in this community for example. Only subset of users even while
being in community or reading emails or website will be participating
in such.

> 4. That said, the local variables prompt could be more alarming and
>    provide a quick way to access the manual about local
>    variables. I'll look into a patch for that.

Yes, that is it. To empower user is to give him straight better
reference on what to do.

Following places could become buttons:

The local variables list in new-concept.org
    ^^^^^^^^^^^^^^^
    Button to A below
    
contains values that may not be safe (*).
^^^^^^^^^^^^^^^                 ^^^^
Button to A below               Button to A below

Template:

Do you want to apply it?  You can type
               
y  -- to apply the local variables list.
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	 Button to A below
	 
n  -- to ignore the local variables list.

!  -- to apply the local variables list, and permanently mark these
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	 Button to A
      values (*) as safe (in the future, they will be set automatically.)

  * eval : (let ((pos (org-babel-find-named-block "stages"))) (when
    pos (save-excursion (org-with-point-at pos
    (org-babel-execute-src-block)))))
    ^^^^^^
    Button to A below.

The template how it looks originally:

The local variables list in new-concept.org
contains values that may not be safe (*).

Do you want to apply it?  You can type
y  -- to apply the local variables list.
n  -- to ignore the local variables list.
!  -- to apply the local variables list, and permanently mark these
      values (*) as safe (in the future, they will be set automatically.)

  * eval : (let ((pos (org-babel-find-named-block "stages"))) (when pos (save-excursion (org-with-point-at pos (org-babel-execute-src-block)))))

Button A should follow here:
^^^^^^^^^
File: emacs.info,  Node: Safe File Variables,  Prev: Specifying File Variables,  Up: File Variables

49.2.4.2 Safety of File Variables
.................................


Right now situation is this:

- if user press C-g to abort the file will be loaded, which is good

- user will not be able to access any of the visible buttons by using
  cursor because somebody made cursor invisible in that
  dialogue. Cursor should be made visible that keys can be used to
  access buttons

- There shall be on minibuffer some key like "? TO READ MANUAL" to go
  straight to the manual section above which is warning user much
  better.

- IF THE USER press C-g, or tries to escape it or clicks by using
  keyboard on the button, or even switch to the buffer with keyboard,
  or uses mouse to activate the button, or uses ? to activate to read
  manual, in all those cases the dialogue should be interrupted and
  file loaded. User should not be left facing dialogue if it was clear
  from user's interaction that there was doubt with the meanings of
  the dialoue.

- Adding references on unsafe local variables to TUTORIAL

> Full disclosure. I make use of file local variables every day
> and I have spent quite a while writing orgstrap which relies heavily
> on them, so I am definitely biased.

With such enhancement there is no need to change history of the past,
we just change the future and history for the future.

> Emacs is a sharp tool. Experts need sharp tools. If someone
> complains about the security of prompts but also admits that they
> always say yes to prompts without reading them, then no one will
> take them seriously when they try to argue that it is the prompt
> that is insecure.

I never say YES by the rule. I have explained sincerely that I did say
YES for number of years as I was thinking those are enhancements that
make things work. And I have used Emacs in that way for long
time. Overall I did not encounter many files with local variables
because I did not read other people's files for long time. Please try
to get the perspective. I was programming myself but in other
languages and never used local variables. If I do not read other
people's files it is hard to encounter Local variables. When it came
about 2016 to start reading other people's files that is where I
rather pressed YES. I did not put attention on each function and those
meanings and did not know meanings of functions.

If you say that it is important to take users seriously, then take
their behavior with the editor seriously and their proneness to
failures as well. Do not expect power users.

> It is like complaining that the forest is dangerous while insisting
> on eating the berries of all the plants and picking up all the
> snakes.

I think that analogy of Tom with the racing car is better.

To make your analogy better it would be like you have the forest with
excellent mushrooms and you invite general public to the forest. Then
you face public with some of potentially poisonous mushrooms and you
start asking them if they wish to accept Amanita muscaria mushroom as
it could be possibly unsafe. But people came to see those potentially
good mushrooms and did not hear of posionous mushrooms, damn, let me
say YES, I am here and I feel safe!

> Degrading usability because some users are irresponsible just
> reinforces the irresponsible behavior and everyone loses.

Usability is already degraded. You can enhance it. It is not nice
calling users irresponsible just because they did not read the manual
and fully understand it. In addition to Emacs Manual by asking users
to decide if variables are safe or not, Emacs is in the same time
asking users to know meanings of ALL possible functions and variables
that are located in such files. That is one big chunk of assumptions
and conditions that user should become responsible by such viewpoint.

In that case it would be best to lock the Emacs of using it unless ALL
users can pass the test to know everything written in the Emacs manual
and Emacs Lisp manual as well.

> Furthermore, Emacs does try to account for users who don't read the
> manual and has sane and safe defaults. Namely it does not blindly
> execute code but prompts the user and lets them know that something is
> going on. Further, when it prompts the user it does not provide a
> default action, it forces them to answer so that they must attend to
> what they are doing. This provides the user with an opportunity to
> become aware of a feature of Emacs that is new to them.

While that purpose is good and that is same purpose that I am
supporting our opinions differ.

Do you see how you said: "This provides the user with an opportunity
to become aware of a feature of Emacs that is new to them." -- this is
what is my wish too. I just think that one cannot become aware of a
feature that is new to them.

> The only other option is to never execute local variables until a
> user reads the manual and changes their config.

That is optional only in historical terms or if we make time machine
to go back and make more future prone defaults.

> With regard to the local variables prompt. Maybe the right thing to do
> in this case would be to add a "?" option so that users can open the
> manual?

Button and ?

? was or is at most cases shown to user, but on the dialogue speaking
of safety is not shown. 

> That seems like it would help. That said, the second line of
> the prompt reads "contains variables that may not be safe (*)" which
> should be alarming. I guess it could be changed to "THIS FILE COULD
> PWN YOU. Please review potentially unsafe variables marked with an
> asterisk (*)."

You could include that for advanced users. The point of discussion is
that millions are not advanced users and using terminology such as
variable, value, apply, safe is out of the context for the user who is
not advanced. Using "pwn" would be hard to understand.

When word is out of the context such cannot be understood.

I gave one reference from Stack-something where users do not
understand "safe" and then other one came with the comment also not
understanding "safe".

Safe in the context of the dialogue and relation to computing means
safe to user's data, privacy and safe computing. One has to know
that majority of computer users are not aware of security problems in
computing and that they put things on risk.

Users who are not programmers or just know how to edit files,
translate, make reports, they need not know what is programming and
computer terminology. If that would be so than there would be no
computing dictionaries, the manual and Emacs Lisp manual just to name
few examples.

I have my staff members who are using Emacs. They do not know it. One
is in Tanzania, one is in Kampala, Uganda. They will know how to edit
Org file and how to send me portion of it, but they did not learn
nothing about computing.

For them the word "safe" is never in the context of computing! Because
if one does not know the context around the word meaning is lost. For
them "safe" means free from danger or the risk of harm. That is in the
personal context, did anybody tell them there is something in the
computing context? References from Stack- show example that people
understand it so. When saying "safe" one has to say "safe to your
data" and if there are no references to context then there shall be
references to manual as example.

I am not sure if "bold" is right way to warn users if it does not work
well on console. Underlined, different colored, links are showing
better in console and if somebody does not use colors I think
underlined will show better.

So if you can do something about that to enhance references to
meanings of what dialogue is telling to user, that would be great.

Jean


  reply	other threads:[~2020-11-26  5:09 UTC|newest]

Thread overview: 151+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-21  0:33 One vs many directories Texas Cyberthal
2020-11-21  5:13 ` Ihor Radchenko
2020-11-21  7:56   ` Jean Louis
2020-11-21  8:31     ` Texas Cyberthal
2020-11-21  9:29       ` Marvin ‘quintus’ Gülker
2020-11-21 10:21       ` Jean Louis
2020-11-21 15:00         ` Texas Cyberthal
2020-11-21 16:08           ` Jean Louis
2020-11-21 15:03     ` Dr. Arne Babenhauserheide
2020-11-21 15:45       ` Texas Cyberthal
2020-11-21 17:12         ` Jean Louis
2020-11-21 18:01           ` Texas Cyberthal
2020-11-21 18:57             ` Jean Louis
2020-11-22  6:36           ` Ihor Radchenko
2020-11-22  7:20             ` Jean Louis
2020-11-22  8:32               ` Ihor Radchenko
2020-11-22  8:56                 ` Jean Louis
2020-11-21 22:36         ` Dr. Arne Babenhauserheide
     [not found]           ` <CAMUm491Psp0u5JKyGROP6M=UfAcvOLTtOKAD1rOearV+KxgYdQ@mail.gmail.com>
     [not found]             ` <87r1olfvh4.fsf@web.de>
2020-11-23  9:50               ` Texas Cyberthal
2020-11-23 13:17                 ` Jean Louis
2020-11-23 14:16                   ` Ihor Radchenko
2020-11-23 18:08                     ` Is Org really so simple? Jean Louis
2020-11-23 20:41                       ` Tom Gillespie
2020-11-24  5:06                         ` Jean Louis
2020-11-26  3:08                       ` Ihor Radchenko
2020-11-26  8:57                         ` Jean Louis
2020-11-29  7:20                           ` Ihor Radchenko
2020-11-29 16:22                             ` Jean Louis
2020-11-26 18:07                         ` Dr. Arne Babenhauserheide
2020-11-26 23:09                       ` David Rogers
2020-11-27  0:43                         ` Tim Cross
2020-11-27  2:56                         ` Jean Louis
2020-11-23 16:07                   ` One vs many directories Texas Cyberthal
2020-11-23 19:20                     ` Jean Louis
2020-11-24  7:55                       ` Ihor Radchenko
2020-11-28 16:16                         ` Jean Louis
2020-11-28 16:33                           ` Christopher Dimech
2020-11-25  6:57                       ` Texas Cyberthal
2020-11-25  9:51                         ` Jean Louis
2020-11-25 10:39                           ` Texas Cyberthal
2020-11-25 11:02                             ` Jean Louis
2020-11-26 16:04                               ` Texas Cyberthal
2020-11-26 17:31                                 ` Jean Louis
2020-11-27  9:00                                   ` Texas Cyberthal
2020-11-27 10:45                                     ` Jean Louis
2020-11-28  8:18                                       ` Texas Cyberthal
2020-11-28 10:09                                         ` Jean Louis
2020-11-29  6:18                                           ` Texas Cyberthal
2020-11-29  6:53                                             ` Jean Louis
2020-11-30  7:35                                               ` Texas Cyberthal
2020-11-30  7:50                                                 ` Ihor Radchenko
2020-11-30 10:25                                                   ` Texas Cyberthal
2020-11-30 10:57                                                 ` Jean Louis
2020-11-30 12:27                                                   ` Ihor Radchenko
2020-11-30 12:28                                                   ` Ihor Radchenko
2020-11-30 19:00                                                     ` Jean Louis
2020-12-02  2:56                                                       ` Ihor Radchenko
2020-12-02  6:14                                                         ` Jean Louis
2020-12-02  7:23                                                           ` Ihor Radchenko
2020-11-21 16:55       ` Jean Louis
2020-11-21 22:48         ` Dr. Arne Babenhauserheide
2020-11-22  0:48           ` Jean Louis
2020-11-22  2:47             ` briangpowell
2020-11-22 17:55               ` Jean Louis
2020-11-21  6:12 ` Palak Mathur
2020-11-21  9:04   ` Jean Louis
2020-11-21  6:36 ` Jean Louis
2020-11-21  7:17   ` Texas Cyberthal
2020-11-21  9:53     ` Jean Louis
2020-11-21 10:15       ` Tim Cross
2020-11-21 11:18         ` Jean Louis
2020-11-21 14:44       ` Texas Cyberthal
2020-11-21 15:45         ` Jean Louis
2020-11-23  5:40     ` Ihor Radchenko
2020-11-24  9:00       ` Jean Louis
2020-11-24  9:45         ` Eric S Fraga
2020-11-24  9:51           ` Jean Louis
2020-11-24 11:42             ` Eric S Fraga
2020-11-24 13:13               ` Diego Zamboni
2020-11-24 13:49                 ` Jean Louis
2020-11-24 17:02                 ` Jean Louis
2020-11-24 18:50                   ` Dr. Arne Babenhauserheide
2020-11-24 18:58                     ` Jean Louis
2020-11-25  6:39                       ` Tim Cross
2020-11-25 12:38                         ` Local variables insecurities - " Jean Louis
2020-11-25 13:05                           ` Eric S Fraga
2020-11-25 13:13                             ` Jean Louis
2020-11-25 13:58                               ` Eric S Fraga
2020-11-25 14:07                                 ` Jean Louis
2020-11-25 20:54                                   ` Tim Cross
2020-11-25 22:09                                     ` Jean Louis
2020-11-26  2:06                                       ` Tom Gillespie
2020-11-26  5:06                                         ` Jean Louis [this message]
2020-11-26  5:31                                         ` Jean Louis
2020-11-26  6:18                                           ` Tom Gillespie
2020-11-26  9:10                                             ` Jean Louis
2020-11-26 11:44                                           ` Detlef Steuer
2020-11-26 12:06                                             ` Jean Louis
2020-11-26  5:34                                         ` Greg Minshall
2020-11-26  5:49                                           ` Jean Louis
2020-11-26  8:39                             ` Christian Moe
2020-11-25  8:10                       ` Dr. Arne Babenhauserheide
2020-11-25  8:36                         ` Local variables liberties Jean Louis
2020-11-24 20:11                     ` One vs many directories Tom Gillespie
2020-11-24 20:39                       ` Tim Cross
2020-11-25  4:54                         ` Jean Louis
2020-11-25  5:54                           ` Tim Cross
2020-11-25  7:01                             ` Local variables issue - " Jean Louis
2020-11-25  5:06                         ` Jean Louis
2020-11-25  7:00                           ` Tim Cross
2020-11-25  8:23                             ` Security issues in Emacs packages Jean Louis
2020-11-25  9:07                               ` tomas
2020-11-25  9:26                                 ` Jean Louis
2020-11-25 10:41                                   ` tomas
2020-11-25 22:46                               ` Tim Cross
2020-11-25 23:07                                 ` Jean Louis
2020-11-25 23:39                                   ` Tim Cross
2020-11-26  5:24                                     ` Jean Louis
2020-11-26  6:46                                       ` Tim Cross
2020-11-26  5:29                                 ` Greg Minshall
2020-11-26  5:53                                   ` Jean Louis
2020-11-26  6:35                                   ` Tim Cross
2020-11-26 12:27                                     ` Greg Minshall
2020-11-26 22:20                                       ` Tim Cross
2020-11-27  2:19                                         ` Jean Louis
2020-11-27  4:42                                         ` Greg Minshall
2020-11-25  4:44                       ` One vs many directories Jean Louis
2020-11-25 10:19           ` org-sbe to automate some source block executions Jean Louis
2020-11-25 11:39             ` Ihor Radchenko
2020-11-25 15:06               ` Jean Louis
2020-11-25 11:46           ` One vs many directories Jean Louis
2020-11-25 13:07             ` Eric S Fraga
2020-11-25 13:14               ` Jean Louis
2020-11-25 13:12             ` Ihor Radchenko
2020-11-25 13:32               ` Jean Louis
2020-11-24 18:47         ` Dr. Arne Babenhauserheide
2020-11-24 18:54           ` Jean Louis
2020-11-25  8:14             ` Dr. Arne Babenhauserheide
2020-11-25  8:46               ` Jean Louis
2020-11-25 11:46                 ` Ihor Radchenko
2020-11-26 12:47                   ` Jean Louis
2020-11-26 13:27                     ` Ihor Radchenko
2020-12-02 10:12                       ` Jean Louis
2020-12-02  9:49                   ` Jean Louis
2020-11-26  3:47           ` Ihor Radchenko
2020-11-26  3:32         ` Ihor Radchenko
2020-11-26 11:58           ` Jean Louis
2020-11-29  7:56             ` Ihor Radchenko
2020-11-29 17:57               ` Jean Louis
2020-11-21 13:41 ` Jonathan McHugh
2020-11-21 14:04   ` Jean Louis

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=X7833Oj7cjHb8lKW@protected.rcdrun.com \
    --to=bugs@gnu.support \
    --cc=emacs-orgmode@gnu.org \
    --cc=tgbugs@gmail.com \
    --cc=theophilusx@gmail.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).