public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Orlando Arias <orlandoarias@gmail.com>
To: binutils@sourceware.org
Subject: Re: Remove dependency on libjansson
Date: Tue, 2 Apr 2024 09:10:18 -0400	[thread overview]
Message-ID: <9088ad35-cc8d-4ad8-8b9b-5979dbb7baa1@gmail.com> (raw)
In-Reply-To: <CACKH++aSqZ9VQw7aGCf9VydRBRA+_9q3YD4DSyb5y8nm6DF-=g@mail.gmail.com>

Greetings,

On 4/2/24 5:40 AM, Rui Ueyama wrote:
> We have discussed various topics already, and I don't think there's a
> single answer because this is all about engineering tradeoffs.
> 
> I'd like to hear from other devs who are following this thread if there are any.

I am not a developer but I am a security researcher. The dependency as 
it is should be left in for a simple reason: you should always sanitize 
your inputs [1]. If the LLVM stack ignores this precept then they are 
doing it wrong. Why? Because of a little something we call in security a 
weird machine [2]. Parsers are complex beasts and can be made very easy 
to misbehave given errors in the grammar handler.

Your proposal of removing the dependecy to libjansson would require 
binutils to implement a brand new JSON parser to sanitize inputs, which, 
as previously mentioned is something you should be doing. This now 
introduces extra burden on the maintainers as well as the possibility of 
introducing parsing bugs in binutils. Binutils is now worse off and 
possibly vulnerable.

As previously mentioned, you want your tooling to catch errors earlier. 
Binutils is something that is not normally run as a superuser. However, 
the tools that end up processing the JSON metadata, such as the core 
dump handler in systemd can be running at high privileges. Do you want 
to risk it and move the weird machine behavior to that target?

Cheers.

[1] https://xkcd.com/327/
[2] https://en.wikipedia.org/wiki/Weird_machine

  reply	other threads:[~2024-04-02 13:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-01  3:31 Rui Ueyama
2024-04-01  7:28 ` Fangrui Song
2024-04-01  9:39   ` Sam James
2024-04-01 10:38     ` Luca Boccassi
2024-04-01 10:44       ` Sam James
2024-04-01 11:44       ` Rui Ueyama
2024-04-01 12:16         ` Luca Boccassi
2024-04-01 13:23           ` Rui Ueyama
2024-04-02  0:54             ` Luca Boccassi
2024-04-02  9:40               ` Rui Ueyama
2024-04-02 13:10                 ` Orlando Arias [this message]
2024-04-03 14:58                   ` Michael Matz
2024-04-03 15:37                     ` Orlando Arias

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=9088ad35-cc8d-4ad8-8b9b-5979dbb7baa1@gmail.com \
    --to=orlandoarias@gmail.com \
    --cc=binutils@sourceware.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.
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).