top | item 44502622

(no title)

dwrodri | 7 months ago

[flagged]

discuss

order

jerf|7 months ago

As the article says: "I find this particularly interesting because this isn't fundamentally a problem of the software being written in C. These are logic errors that are possible in nearly all languages, the common factor being this is a vulnerability in the interprocess communication of the components (either between git and external processes, or within the components of git itself). It is possible to draw a parallel with CRLF injection as seen in HTTP (or even SMTP smuggling)."

You can write this in any language. None of them will stop you. I'm on the cutting edge of "stop using C", but this isn't C's fault.

gpm|7 months ago

You can, but in languages like python/java/go/rust/... you wouldn't, because you wouldn't write serialization/de-serialization code by hand but call out to a battle hardened library.

This vulnerability is the fault of the C ecosystem where there is no reasonable project level package manager so everyone writes everything from scratch. It's exacerbated by the combination of a lack of generics (rust/java's solution), introspection (java/python's solution), and poor preprocessor in C (go's solution) so it wouldn't even be easy to make a ergonomic general purpose parser.

alexvitkov|7 months ago

We keep getting RCEs in C because tons of useful programs are written in C. If someone writes a useful program in Rust, we'll get RCEs in Rust.

umanwizard|7 months ago

There are a lot of useful programs written in Rust nowadays. This comment might have made more sense like 5 years ago.

dietr1ch|7 months ago

It's not that only C programs are useful. It's that subtle mistakes on C result in more catastrophic vulnerabilities.

Make a mistake in application code in a language like, say Java, and you'll end up with an exception.

asplake|7 months ago

The article refutes that somewhat:

> I find this particularly interesting because this isn't fundamentally a problem of the software being written in C. These are logic errors that are possible in nearly all languages, the common factor being this is a vulnerability in the interprocess communication of the components (either between git and external processes, or within the components of git itself).

mrkeen|7 months ago

C programmers don't see C problems. They see logic errors that are possible in any language.

dietr1ch|7 months ago

Running with scissors isn't a problem. The problem is stabbing yourself with them. Isn't it obvious?

bpt3|7 months ago

As mentioned in the article, this is a logic error that has nothing to do with C strings.

eptcyka|7 months ago

Whilst true, there’s a swathe of modern tooling that will aide in marshalling data for IPC. Would you not agree that if protobuf, json or yaml were used, it’d be far less likely for this bug have slipped in?

smileson2|7 months ago

If only it were just the c code that was causing people to be owned lol

tuetuopay|7 months ago

Using other languages would likely fix the issue but as a side-effect. Most people would expect a C-vs-Rust comparison so I’ll take Go as an example.

Nobody would write the configuration parsing code by hand, and just use whatever TOML library available at hand for Go. No INI shenanigans, and people would just use any available stricter format (strings must be quoted in TOML).

So yeah, Rust and Go and Python and Java and Node and Ruby and whatnot would not have the bug just by virtue of having a package manager. The actual language is irrelevant.

However, whatever the language, the same hand implementation would have had the exact same bug.