purebred-mua / purebred

A terminal based mail user agent based on notmuch
GNU Affero General Public License v3.0
139 stars 19 forks source link

taint untrusted data #269

Open frasertweedale opened 5 years ago

frasertweedale commented 5 years ago

Purebred handles several kinds of untrusted data:

We should use types to demarcate these untrusted data and force (or at least "strongly encourage") the programmer to sanitise the data properly before handling it. This is especially relevant when:

The specific deliverables are grouped by the kinds of data we want to taint:

frasertweedale commented 5 years ago

@romanofski POC commit: https://github.com/purebred-mua/purebred/commit/7e2b74cbaa421967c92abb79b8bfe1baab4dc39e. LMK what you think. It doesn't have to be a big bang, we can do it progressively.

romanofski commented 5 years ago

Yep I like this very much. So the deal is basically that we use Tainted to express the fact that the data could be malicious or "dirty" and needs to be "cleaned" before displaying. (I think that's exactly what you wrote in the description, but I wanted to express it with my words in order to have it understood).

frasertweedale commented 5 years ago

Cool, so I'll push forward with this on the subprocess side and make that the first deliverable. Afterwards I'll turn focus to taint on mail bodies / parts.

romanofski commented 3 years ago

Btw @frasertweedale was wondering whether is might use the plugin system too or should we just apply what we already have?

frasertweedale commented 3 years ago

No, this is built-in behaviour.

It is a good question whether data from plugins should be trusted or not. In general, because the user explicitly enables the plugin, there is no need to taint data from plugins. But perhaps there will be a use case.