I find the following statement highly misleading, and possibly misinformed about Rust:
out of the 81 vulnerabilities we have confirmed in curl so far during 2026, 14 were the result of mistakes that most likely would have been avoided had we used a memory-safe language such as rust. That’s 17.3%.
A Rust implementation of curl would thus still have had 67 of those vulnerabilities.
It seems to imply that the only benefit of Rust is preventing pure-memory-safety bugs (buffer overflows, use-after-free), which completely ignores the main benefits of the language:
rich type system: e.g. expressing state machines with exhaustive pattern matching, modeling generic APIs with traits,
But the most misleading part is taking AI slop rewrites of Curl as the benchmark. A good benchmark should be an established HTTP library in Rust, such as reqwest -- which according to the RustSec Advisory Database didn't ever have any reported vulnerability. Of course that's misleading too as this doesn't include transitive dependencies such as rustls (5 low/medium vulnerabilities this year). And there may be an issue of under-reporting of vulnerabilities and/or staffing of the RustSec project. But I'd say the comparison is at best inconclusive (I cannot tell if reqwest had more or less relevant vulnerabilities than Curl this year).
What I'd really like to see is a deep dive comparison of a sample of these vulnerabilities: take 10-20 Curl vulnerabilities from this year, and for each one have a fair assessment of whether it would be prevented by the Rust compiler, avoided by idiomatic Rust (i.e. going beyond what the compiler outright rejects), and whether similar bugs have slipped through actual libraries like reqwest.
Of course, one could also argue that reqwest isn't as feature complete as Curl (I haven't checked -- my anecdotal evidence is that reqwest has been sufficient for my side projects). But that would be a very different story as it would become a choice/tradeoff between more features vs. less attack surface.
A good benchmark should be an established HTTP library in Rust, such as reqwest -- which according to the RustSec Advisory Database didn't ever have any reported vulnerability. Of course that's misleading too as this doesn't include transitive dependencies such as rustls
I think that's misleading too :p It's sensible to put something like rustls out of scope, but reqwest has much more substantial dependencies. http had two high/critical vulns. hyper - a related HTTP library from the same author as reqwest - had several more. For HTTP/2, it seems to use h2, which had some low severity vulns too. QUIC is supported via quinn, which apparently has a high severity soundness bug.
Apparently, because that's the one bug I decided to take a look at. It seems to have been making some unjustified assumptions about the layout of some structs - it doesn't seem like it ever approached being exploitable, yet it was slapped with Attack Complexity: Low, Confidentiality Impact: High, CVSS 7.5. This makes me doubt the accuracy of the other severities.
But, back to the point - since Rust developers seem to split their software up into much tinier pieces than C developers, I don't think it makes sense to just look at the advisories for a single crate.
...but I'm also not sure how interesting a better comparison would be. I think it's fairly obvious that, on the long term, a HTTP library written in a memory safe language with a solid type system will be more robust than one written in C.
Projects "rejecting" Rust probably don't do so because they aren't convinced of the benefits of better languages, but because they don't like the tradeoffs made by Rust et al (see: sibling threads). Comparing vulnerability counts won't change their opinion.
reqwest seems like it's "just" an HTTP library. Which is great if that's what you want, of course. I definitely get that for a lot of people that's why they use curl or libcurl in the first place, so definitely a reasonable starting point! (i'm not sure i've personally used curl in anger for anything other than HTTP; at work we also use curl for FTP, TFTP, and possibly SCP/SFTP although I can't be sure of those last two).
curl supports around 25 different url schemas according to the man page. So another check might also be useful to look at which url schemes those vulnerabilities affected. From a quick check there were definitely ones against SSH, IMAP, SMB, LDAPS etc. Maybe 15%-20% of them?
From a quick check curl etc also supports a wider range of HTTP related features around auth and proxy handling. It also looks like curl is much more tolerant of bad HTTP server designs, where the server responses are not strictly HTTP compliant, whereas reqwest seems to be pretty strict in terms of compliance. It'd be lovely (and probably a better outcome) if everything was compliant, but in reality that's just not things are , particularly in embedded stacks which aren't going to get overhauled.
I'm not an expert in either, this was just a quick check. But yeah, looks like the attack surface on curl is huge compared to reqwest.
I've not done anything with Rust yet, but it's something that's on my list of things to investigate rewriting parts of our C stack at work.
People seem to forget that rust isn't as portable as C, and until it gets quite a bit further, every request to rewrite something is a request to desupport many platforms.
The same rewrite-everything-in-rust people are almost invariably OK with saying that only the important platforms and processor architectures matter, and haven't got a clue and/or simply don't care about the impact this would have on actual, running hardware out in the real world. Out of sight, out of mind. "It doesn't affect me."
And, as we're seeing with the sudo rust rewrite and the coreutils rewrite, along with other corporate inspired pushes such as moving to x86-64 v2, 3 or 4, the people who have nothing to lose are fine with the rest of the world losing those things, even if it means problems for everyone.
I wish the rewrite-everything-in-rust people would actually take the time to understand the effects of what they're pushing for.
As a rewrite-in-anything-better-than-C guy I agree the platform support for Rust is obviously below C, but instead of saying "it doesn't affect me" I would rather pour more resources into expanding platform support, in an effort to rewrite the world away from C.
I know I’m repeating myself but: out of the 81 vulnerabilities we have confirmed in curl so far during 2026, 14 were the result of mistakes that most likely would have been avoided had we used a memory-safe language such as rust. That’s 17.3%.
A Rust implementation of curl would thus still have had 67 of those vulnerabilities.
I am of the opinion that if it could be caught statically then it must be caught statically. Saying "we only blew our foot off 14 times" isn't comforting for critical infrastructure.
When the topic is portability, it really depends on who's pushing for the rewrite. As with X11 to Wayland, sometimes it's the developers feeling at their limits with the old tech.
You porting a compiler or compatibility layer of some sort doesn't opt every C developer whose project suddenly became compatible into an obligation to support a platform they never intended to support and possibly never heard of.
But the point being, it goes from "possible to be portable with meticulous effort" to "impossible to be portable at all without becoming a compiler developer." (and not just any compiler developer, but working on the most massive and complex compilers in existence)
And true, few people do actually bother to write portable code. But I very meticulously do, even for projects that don't need it; and the SQLite devs do; and Curl did/does; and so do many other projects.
As an anecdote, I've run into one or two Rust compiler bugs rendering the language unusable for things as simple as embedded ARM32 targets. Targets that, while GCC is preferred, Clang still works for, so it has to be some frontend Rust issue rather than LLVM. So not even that far off the beaten path (i.e. "modern desktops and smartphones"), still in architectures nominally supported, and Rust already becomes largely unusable.
I've run into quite a number of Rust compiler bugs rendering the language unusable for things as simple as embedded ARM32 targets.
Could you share links to the bug reports? I would be intrigued to see what the problems were, and on which specific platform, because ARM32 support runs the gamut from tier 2 to tier 3. It could be a bug on the rustc side, but it could also be a bug on the llvm side that gets excercised by rustc but not clang (one could argue the bug exists in the combination of rustc+llvm+your platform).
Admittedly I never actually filed bug reports (and "quite a number" is an exaggeration, it was one or two) because I just couldn't be assed to figure out a minimum reproduction when I was just messing around with using Rust alongside C for the project. It was for a GBA homebrew game (ARMv4T), had to do with interwork between ARM32 and Thumb (not Thumb-2) code; in mixed assembly, C, and Rust sources. I think it was either general ABI issues (something related to veneers maybe?), or things being consistently linked wrong or something, I can't quite remember. (I've run into (easier-to-reproduce) miscompiles in GCC's Ada/GNAT with this setup/target too XD, just an odd target and I guess I tend to push languages pretty hard). I'll see if I can dig up the sources that caused it, it could've been incidentally fixed by now.
The C standard doesn't promise you any ABI. It's an under-documented fragile mess, so in practice it requires testing and tweaking every combination until it seems to work. Rust has already found cases where even gcc and clang disagree.
It was not following the explicit wording of AAPCS, § 5.3 and § 5.6 if my memory about it being interworking/veneers is correct. And per your second paragraph, AAPCS § 7 and AAELF which gives a concrete C→machine ABI for anything that would've been relevant to my issues (I for sure manually verified the assembly from C and Rust when I noticed issues, and I know my own assembly followed AAPCS)
You're broadly correct, there is ambiguity with things like threading and more complex OS/hosted stuff, and for portable code there's no ABI you could rely on (your statement about "C code isn't portable, just ported" is exactly how I'd put it. See also: the Faultlore post about "C isn't a programming language anymore").
But for a single embedded target in explicitly non-portable code there's usually a concrete ABI you can trust for at least most of ISO C stuff. Which is good because freestanding environments usually need a lot of assembly that you need to be able to reliably call and interact with lol
That's all true, but it doesn't change the fact that, unless you're paying them to do it, you don't get to veto developer decisions to migrate to a language that they believe will reduce the cognitive burden of supporting the platforms they intend to support.
So it's not entitled to demand people rewrite their mature programs from scratch in Rust like a subset of the community has been doing to projects for years?
When the topic is portability, it really depends on who's pushing for the rewrite.
That's the whole point I was making. Of course it's entitled when random Joes push for it... but it's also entitled when random Joes push for developers to not make a decision that would cut against goals they never set.
You don't get to hijack their roadmap by opting yourself into compatibility.
Oh yeah, okay. I agree with that, I just think it should be the project's decision. e.g. SQLite where they highly prioritize stability and portability above all else (and have fantastic testing that catches any of the issues Rust would've solved easier), vs. Linux where they are more concerned with driver bugs that affect the larger kernel and security issues at this point.
Although from a rewrite perspective (rather than "new code in <>, leave the old C code" or such) I think it has been kinda demonstrated over and over that it's not a particularly good idea lol; but that's just my opinion/advice and projects should be able to do what they want.
Although from a rewrite perspective (rather than "new code in <>, leave the old C code" or such) I think it has been kinda demonstrated over and over that it's not a particularly good idea lol;
Seems like it worked out pretty well for Fish, though
librsvg too, but that's where the nuance comes in.
Part of the reason it's possible at all with Rust is that it's got good C<->Rust interop which makes incremental porting tractable (i.e. The downsides of rewriting are more mitigated the more incremental you can make it) and I'd say the tipping point is when continued development in C is more difficult than an incremental rewrite into Rust.
It's another form of "at some point, you may find that technical debt has grown too big and is impeding your ability to develop the codebase"... just with the technical debt being centred around the relationship between C, how the developer uses it, how the project's scale has grown, etc.
Although from a rewrite perspective (rather than "new code in <>, leave the old C code" or such) I think it has been kinda demonstrated over and over that it's not a particularly good idea lol; but that's just my opinion/advice and projects should be able to do what they want.
Of course it depends on who is pushing for a rewrite. I stated that my issue is with the rewrite-everything-in-rust crowd, who, generally, like to parrot what they've read or heard because it makes them feel smarter, not too unlike the people who like to tell everyone else that self-hosting email can't be done properly.
You porting a compiler or compatibility layer of some sort doesn't opt every C developer whose project suddenly became compatible into an obligation to support a platform they never intended to support and possibly never heard of.
Rust has substantially caught up in platform support. There's Rust for Haiku, QNX. There's Rust for 68k and AVR. It can target BPF and NVPTX. Thanks to Rust's GCC backend, people even got Rust running on Dreamcast. People managed to build Rust for Windows XP and even 95. The platforms that are left out now are really really niche bottom of the barrel.
Push to x86 with AVX is not Rust's fault. Rust can build for OG Athlon and i686.
Rust requires a supported platform to have 2 maintainers and ability to run tests in CI, so the platforms that are unsupported don't meet the bar - they're so niche that they can't find more than one person willing to do the work or find a still-working hardware that could be used in CI.
There's this great slide Daniel includes in his talks every now and then that shows just how many operating systems curl supports. I wonder how many of these are supported by Rust.
I don't think any rewrite of curl in Rust will survive mainly because Rust already has a Rust-native HTTP ecosystem and doesn't need yet another HTTP library (and also has most of the other protocols covered). curl is a great achievement for C, and C needs it. Rust doesn't.
it would be interesting to see, rather than a "rewrite of curl", instead a feature compatible piece of software which is instead built upon the HTTP libraries we already have in rust. I.e. same CLI surface but completely separate implementation
gendx | 2 hours ago
I find the following statement highly misleading, and possibly misinformed about Rust:
It seems to imply that the only benefit of Rust is preventing pure-memory-safety bugs (buffer overflows, use-after-free), which completely ignores the main benefits of the language:
But the most misleading part is taking AI slop rewrites of Curl as the benchmark. A good benchmark should be an established HTTP library in Rust, such as
reqwest-- which according to the RustSec Advisory Database didn't ever have any reported vulnerability. Of course that's misleading too as this doesn't include transitive dependencies such asrustls(5 low/medium vulnerabilities this year). And there may be an issue of under-reporting of vulnerabilities and/or staffing of the RustSec project. But I'd say the comparison is at best inconclusive (I cannot tell ifreqwesthad more or less relevant vulnerabilities than Curl this year).What I'd really like to see is a deep dive comparison of a sample of these vulnerabilities: take 10-20 Curl vulnerabilities from this year, and for each one have a fair assessment of whether it would be prevented by the Rust compiler, avoided by idiomatic Rust (i.e. going beyond what the compiler outright rejects), and whether similar bugs have slipped through actual libraries like
reqwest.Of course, one could also argue that
reqwestisn't as feature complete as Curl (I haven't checked -- my anecdotal evidence is thatreqwesthas been sufficient for my side projects). But that would be a very different story as it would become a choice/tradeoff between more features vs. less attack surface.dzwdz | an hour ago
I think that's misleading too :p It's sensible to put something like rustls out of scope, but reqwest has much more substantial dependencies. http had two high/critical vulns. hyper - a related HTTP library from the same author as reqwest - had several more. For HTTP/2, it seems to use h2, which had some low severity vulns too. QUIC is supported via quinn, which apparently has a high severity soundness bug.
Apparently, because that's the one bug I decided to take a look at. It seems to have been making some unjustified assumptions about the layout of some structs - it doesn't seem like it ever approached being exploitable, yet it was slapped with Attack Complexity: Low, Confidentiality Impact: High, CVSS 7.5. This makes me doubt the accuracy of the other severities.
But, back to the point - since Rust developers seem to split their software up into much tinier pieces than C developers, I don't think it makes sense to just look at the advisories for a single crate.
...but I'm also not sure how interesting a better comparison would be. I think it's fairly obvious that, on the long term, a HTTP library written in a memory safe language with a solid type system will be more robust than one written in C.
Projects "rejecting" Rust probably don't do so because they aren't convinced of the benefits of better languages, but because they don't like the tradeoffs made by Rust et al (see: sibling threads). Comparing vulnerability counts won't change their opinion.
5d22b | an hour ago
Back when I paid attention to the RustSec issue tracker, they often regretted CVSS as a poor metric with little practical usefulness.
cuchulain | an hour ago
It's definitely not as featureful.
reqwest seems like it's "just" an HTTP library. Which is great if that's what you want, of course. I definitely get that for a lot of people that's why they use curl or libcurl in the first place, so definitely a reasonable starting point! (i'm not sure i've personally used curl in anger for anything other than HTTP; at work we also use curl for FTP, TFTP, and possibly SCP/SFTP although I can't be sure of those last two).
curl supports around 25 different url schemas according to the man page. So another check might also be useful to look at which url schemes those vulnerabilities affected. From a quick check there were definitely ones against SSH, IMAP, SMB, LDAPS etc. Maybe 15%-20% of them?
From a quick check curl etc also supports a wider range of HTTP related features around auth and proxy handling. It also looks like curl is much more tolerant of bad HTTP server designs, where the server responses are not strictly HTTP compliant, whereas reqwest seems to be pretty strict in terms of compliance. It'd be lovely (and probably a better outcome) if everything was compliant, but in reality that's just not things are , particularly in embedded stacks which aren't going to get overhauled.
I'm not an expert in either, this was just a quick check. But yeah, looks like the attack surface on curl is huge compared to reqwest.
I've not done anything with Rust yet, but it's something that's on my list of things to investigate rewriting parts of our C stack at work.
johnklos | 3 hours ago
People seem to forget that rust isn't as portable as C, and until it gets quite a bit further, every request to rewrite something is a request to desupport many platforms.
The same rewrite-everything-in-rust people are almost invariably OK with saying that only the important platforms and processor architectures matter, and haven't got a clue and/or simply don't care about the impact this would have on actual, running hardware out in the real world. Out of sight, out of mind. "It doesn't affect me."
And, as we're seeing with the
sudorust rewrite and the coreutils rewrite, along with other corporate inspired pushes such as moving to x86-64 v2, 3 or 4, the people who have nothing to lose are fine with the rest of the world losing those things, even if it means problems for everyone.I wish the rewrite-everything-in-rust people would actually take the time to understand the effects of what they're pushing for.
jado | 2 hours ago
As a rewrite-in-anything-better-than-C guy I agree the platform support for Rust is obviously below C, but instead of saying "it doesn't affect me" I would rather pour more resources into expanding platform support, in an effort to rewrite the world away from C.
I am of the opinion that if it could be caught statically then it must be caught statically. Saying "we only blew our foot off 14 times" isn't comforting for critical infrastructure.
ssokolow | 2 hours ago
When the topic is portability, it really depends on who's pushing for the rewrite. As with X11 to Wayland, sometimes it's the developers feeling at their limits with the old tech.
You porting a compiler or compatibility layer of some sort doesn't opt every C developer whose project suddenly became compatible into an obligation to support a platform they never intended to support and possibly never heard of.
See, for example: https://blog.yossarian.net/2021/02/28/Weird-architectures-werent-supported-to-begin-with
nytpu | 2 hours ago
But the point being, it goes from "possible to be portable with meticulous effort" to "impossible to be portable at all without becoming a compiler developer." (and not just any compiler developer, but working on the most massive and complex compilers in existence)
And true, few people do actually bother to write portable code. But I very meticulously do, even for projects that don't need it; and the SQLite devs do; and Curl did/does; and so do many other projects.
As an anecdote, I've run into one or two Rust compiler bugs rendering the language unusable for things as simple as embedded ARM32 targets. Targets that, while GCC is preferred, Clang still works for, so it has to be some frontend Rust issue rather than LLVM. So not even that far off the beaten path (i.e. "modern desktops and smartphones"), still in architectures nominally supported, and Rust already becomes largely unusable.
ekuber | 2 hours ago
Could you share links to the bug reports? I would be intrigued to see what the problems were, and on which specific platform, because ARM32 support runs the gamut from tier 2 to tier 3. It could be a bug on the rustc side, but it could also be a bug on the llvm side that gets excercised by rustc but not clang (one could argue the bug exists in the combination of rustc+llvm+your platform).
nytpu | 2 hours ago
Admittedly I never actually filed bug reports (and "quite a number" is an exaggeration, it was one or two) because I just couldn't be assed to figure out a minimum reproduction when I was just messing around with using Rust alongside C for the project. It was for a GBA homebrew game (ARMv4T), had to do with interwork between ARM32 and Thumb (not Thumb-2) code; in mixed assembly, C, and Rust sources. I think it was either general ABI issues (something related to veneers maybe?), or things being consistently linked wrong or something, I can't quite remember. (I've run into (easier-to-reproduce) miscompiles in GCC's Ada/GNAT with this setup/target too XD, just an odd target and I guess I tend to push languages pretty hard). I'll see if I can dig up the sources that caused it, it could've been incidentally fixed by now.
kornel | an hour ago
For ABI issues, see https://faultlore.com/abi-cafe/
The C standard doesn't promise you any ABI. It's an under-documented fragile mess, so in practice it requires testing and tweaking every combination until it seems to work. Rust has already found cases where even
gccandclangdisagree.nytpu | an hour ago
It was not following the explicit wording of AAPCS, § 5.3 and § 5.6 if my memory about it being interworking/veneers is correct. And per your second paragraph, AAPCS § 7 and AAELF which gives a concrete C→machine ABI for anything that would've been relevant to my issues (I for sure manually verified the assembly from C and Rust when I noticed issues, and I know my own assembly followed AAPCS)
kornel | an hour ago
Thanks. I stand corrected.
nytpu | an hour ago
You're broadly correct, there is ambiguity with things like threading and more complex OS/hosted stuff, and for portable code there's no ABI you could rely on (your statement about "C code isn't portable, just ported" is exactly how I'd put it. See also: the Faultlore post about "C isn't a programming language anymore").
But for a single embedded target in explicitly non-portable code there's usually a concrete ABI you can trust for at least most of ISO C stuff. Which is good because freestanding environments usually need a lot of assembly that you need to be able to reliably call and interact with lol
ssokolow | 2 hours ago
That's all true, but it doesn't change the fact that, unless you're paying them to do it, you don't get to veto developer decisions to migrate to a language that they believe will reduce the cognitive burden of supporting the platforms they intend to support.
Anything more is entitlement.
nytpu | 2 hours ago
So it's not entitled to demand people rewrite their mature programs from scratch in Rust like a subset of the community has been doing to projects for years?
ssokolow | 2 hours ago
Please refer back to my initial post.
That's the whole point I was making. Of course it's entitled when random Joes push for it... but it's also entitled when random Joes push for developers to not make a decision that would cut against goals they never set.
You don't get to hijack their roadmap by opting yourself into compatibility.
nytpu | 2 hours ago
Oh yeah, okay. I agree with that, I just think it should be the project's decision. e.g. SQLite where they highly prioritize stability and portability above all else (and have fantastic testing that catches any of the issues Rust would've solved easier), vs. Linux where they are more concerned with driver bugs that affect the larger kernel and security issues at this point.
Although from a rewrite perspective (rather than "new code in <>, leave the old C code" or such) I think it has been kinda demonstrated over and over that it's not a particularly good idea lol; but that's just my opinion/advice and projects should be able to do what they want.
hjvt | 2 hours ago
Seems like it worked out pretty well for Fish, though
ssokolow | 2 hours ago
librsvg too, but that's where the nuance comes in.
Part of the reason it's possible at all with Rust is that it's got good C<->Rust interop which makes incremental porting tractable (i.e. The downsides of rewriting are more mitigated the more incremental you can make it) and I'd say the tipping point is when continued development in C is more difficult than an incremental rewrite into Rust.
It's another form of "at some point, you may find that technical debt has grown too big and is impeding your ability to develop the codebase"... just with the technical debt being centred around the relationship between C, how the developer uses it, how the project's scale has grown, etc.
ssokolow | 2 hours ago
Agreed. I like to point people at https://www.joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i/ for that one.
johnklos | an hour ago
Of course it depends on who is pushing for a rewrite. I stated that my issue is with the rewrite-everything-in-rust crowd, who, generally, like to parrot what they've read or heard because it makes them feel smarter, not too unlike the people who like to tell everyone else that self-hosting email can't be done properly.
Has anyone suggested that?
ssokolow | 38 minutes ago
That was what was implied by the outrage at
pyca/cryptographydeciding to migrate to Rust ASN.1 parsing as referenced in https://blog.yossarian.net/2021/02/28/Weird-architectures-werent-supported-to-begin-withIt broke compatibility with compiler targets the
pyca/cryptographypeople had never intended to support.kornel | an hour ago
Rust has substantially caught up in platform support. There's Rust for Haiku, QNX. There's Rust for 68k and AVR. It can target BPF and NVPTX. Thanks to Rust's GCC backend, people even got Rust running on Dreamcast. People managed to build Rust for Windows XP and even 95. The platforms that are left out now are really really niche bottom of the barrel.
Push to x86 with AVX is not Rust's fault. Rust can build for OG Athlon and i686.
Rust requires a supported platform to have 2 maintainers and ability to run tests in CI, so the platforms that are unsupported don't meet the bar - they're so niche that they can't find more than one person willing to do the work or find a still-working hardware that could be used in CI.
sny | an hour ago
There's this great slide Daniel includes in his talks every now and then that shows just how many operating systems curl supports. I wonder how many of these are supported by Rust.
kornel | an hour ago
I don't think any rewrite of
curlin Rust will survive mainly because Rust already has a Rust-native HTTP ecosystem and doesn't need yet another HTTP library (and also has most of the other protocols covered).curlis a great achievement for C, and C needs it. Rust doesn't.pert | an hour ago
it would be interesting to see, rather than a "rewrite of curl", instead a feature compatible piece of software which is instead built upon the HTTP libraries we already have in rust. I.e. same CLI surface but completely separate implementation