Live data from Hacker News

Towards trust in Emacs

eshelyaron.com

11–20 of 36 posts

Re: Towards trust in Emacs

#11
> ... the problem with security measures that cause too much friction is that users tend to disable them in order to get on with their work. To fulfill its security purposes, a good trust system needs to stay out of your way.

I wish this was understood clearly by more security engineers, but, alas...

Re: Towards trust in Emacs

#12

The one problem I have with the trusted files thing is that I have no way to trust non-file-visiting buffers. Why is *scratch* untrusted!? *scratch* should always be trusted, without me having to configure anything, ideally. Though a setting to automatically trust non-file-visiting buffers would be nice. I just ended up stopping using the scratch buffer because of that issue.

Right, the fact that the initial scratch buffer is untrusted is a bug AFAICT. I'm considering adding a workaround to this issue in trust-manager, although ideally it should (also) be solved upstream.

Re: Towards trust in Emacs

#13
"Up to version 30, it didn’t differentiate between trusted and untrusted files, and in effect treated all files as trusted."

Age verification aaaaaand Trusted Computing now! \o/

(Just kidding - have to point at the question of what trust is exactly. Because I can not accept the "trusted files" claim; I don't think anyone can ever trust anything, unless there is some really objective criterium that is unchangeable. But if something is unchangeable, can it be useful for anything? Yes, you can ensure that a calculator would correctly put a given input into the correct output, or a function to do so, but in real calculation this is not the only factor to be guaranteed, not even in quantum computing. What if you manage to influence the calculation process via light/laser information or any other means? I can't accept the term "trusted" here, because it implies one could and should trust something; that is a similar problem to the term AI - I never could accept that "AI" has anything to do with real intelligence with the given hardware, it is just a simulation of intelligence; pattern matching and recognition only makes it more likely to produce useful results, but that does not imply intelligence at all. It lack true understanding - that is why it has to sniff for data, to improve the mapping of generated output. One can see this on many AI-centric videos on youtube, the AI is often hallucinating and creating videos that are not possible, e. g. suddenly a leg appearing in motion that is twisted in the opposite direction. That shows that the AI does not understand what it is doing. Any human could realise that this is physically just not possible. I see this on cheaper AI videos even more, e. g. chuck norris videos where chuck would kick everyone yet the motions are totally wrong and detached from the "real" scene.)

Re: Towards trust in Emacs

#15

The one problem I have with the trusted files thing is that I have no way to trust non-file-visiting buffers. Why is *scratch* untrusted!? *scratch* should always be trusted, without me having to configure anything, ideally. Though a setting to automatically trust non-file-visiting buffers would be nice. I just ended up stopping using the scratch buffer because of that issue.

Shouldn't something like this fix the problem, at least for scratch buffers:

(add-hook 'lisp-interaction-mode-hook (lambda () (setq-local trusted-content :all)))

Re: Towards trust in Emacs

#16
post #15

The one problem I have with the trusted files thing is that I have no way to trust non-file-visiting buffers. Why is *scratch* untrusted!? *scratch* should always be trusted, without me having to configure anything, ideally. Though a setting to automatically trust non-file-visiting buffers would be nice. I just ended up stopping using the scratch buffer because of that issue.

Shouldn't something like this fix the problem, at least for scratch buffers: (add-hook 'lisp-interaction-mode-hook (lambda () (setq-local trusted-content :all)))

Pretty sure that's unsafe, don't do that.

Only the scratch buffer is to be exempted, not every buffer that gets this mode.

Re: Towards trust in Emacs

#17
post #15

Earlier quoted context omitted.

Shouldn't something like this fix the problem, at least for scratch buffers: (add-hook 'lisp-interaction-mode-hook (lambda () (setq-local trusted-content :all)))

Pretty sure that's unsafe, don't do that. Only the scratch buffer is to be exempted, not every buffer that gets this mode.

Agree. This is probably better:

    (with-current-buffer "*scratch*"
  (setq-local trusted-content :all))

Re: Towards trust in Emacs

#18
post #15

Earlier quoted context omitted.

Shouldn't something like this fix the problem, at least for scratch buffers: (add-hook 'lisp-interaction-mode-hook (lambda () (setq-local trusted-content :all)))

Pretty sure that's unsafe, don't do that. Only the scratch buffer is to be exempted, not every buffer that gets this mode.

Do note that I only configure this for `lisp-interaction-mode', which in practice really only gets used for the *scratch* buffer. But there are a few other instances in core that also use it, and if that concerns you, you can extend the above snippet with a check like

    (when (equal (buffer-name) "*scratch*") ...)

Re: Towards trust in Emacs

#19

Earlier quoted context omitted.

Pretty sure that's unsafe, don't do that. Only the scratch buffer is to be exempted, not every buffer that gets this mode.

Agree. This is probably better: (with-current-buffer "*scratch*" (setq-local trusted-content :all))

In practice this should also work. Do keep in mind if you just add this to your init.el then this will not persist if you re-create the scratch buffer.

If we are already experimenting with different ideas, this should also work (and gives a hint of how you want to fix the issue upstream):

    (define-advice get-scratch-buffer-create (:filter-return (buf) trusted)
      (with-current-buffer buf
        (setq-local trusted-content :all))
      buf)

Re: Towards trust in Emacs

#20
I would say the trust model of all editors is broken. You cannot really blanket trust any project at all with agents and the amount of supplychain attacks, not even your own. Editors must move to a capabilty based sandbox where you dont just grant trust but grant concrete capabilities like in a browser sandbox.
Post reply on HN