upvote
I now run all my network facing C code via fil-c. I have limited needs (ssh, static file server), but for those it works very well. I personally am more in favour of making existing battle tested C safer via fil-c or formal verification, than I am of rewriting the world in rust.

New code means new bugs, and losing the many years of accumulated bug fixes and hardening present in many critical pieces of our infra by rewriting in rust is not a desirable tradeoff. The new world we live in where fv has become many orders of magnitude cheaper also makes rust seem much less attractive.

reply
Fil-C is also a great solution, albeit with different performance trade-offs.
reply
In theory, scpptool provides another solution with different performance, compatibility and portability trade-offs. Unlike Fil-C, it is not "fanatically compatible" with existing C code. But in theory, with maybe some minor adjustments to the code (and maybe less-minor adjustments to the build system), you can auto-translate your existing C code base to an essentially memory-safe subset of C++ at build-time [1].

While generally more of a hassle than Fil-C, the scpptool approach provides an incremental path to optimal performance (for performance-sensitive sections of the code) via migration to a (statically-enforced) memory-safe subset of C++. And unlike Fil-C, the scpptool solution essentially maintains the portability of the original code, as well as its deterministic performance and resource usage (i.e. no GC). It also supports ABI compatibility via "unsafe"/"check-suppression" annotations. The scpptool approach is not so much an alternative to Fil-C, as it is an optional path forward for C (or C++) code bases that may (or may not) be already using Fil-C for memory safety.

[1] https://github.com/duneroadrunner/SaferCPlusPlus-AutoTransla...

reply
What good is a car that goes 1000 miles per hour if it has no brakes?

It's time for performance above everything else to die, especially on anything and everything that gets anywhere close to untrusted data.

reply
Same, made a fil-c fork of nginx a while back, saved me from many RCEs https://github.com/remixer-dec/filc-nginx Don't have the tokens to maintain it though :(
reply
This sounds like a fantastic solution, especially for non-high-volume stuff. Would you consider writing down your setup and experiences? I'm sure it'll be a hit on this site!
reply
fv?
reply
Formal verification.
reply
formal verification?
reply
I've reached the same conclusion myself. Many of the recent exploits seem like edge-cases that the author acknowledged 10-20 years ago but didn't predict that tools would eventually be able to chain together 100k network requests in order to trigger a buffer overflow.
reply
Who exactly are the people behind xin...?

The project isn't currently open source and there's next to nothing on the site to reassure you who's behind the server gateway you'd be running.

Googling the company in the footer produces this, but it also doesn't have much: https://www.signeen.com

reply
Nginx and C have been around for decades. Migrating to new, poorly tested (in the real world) software does not seem an improvement at all.
reply
Nobody is saying that it needs to be rushed. Cloudflare started moving towards Rust more than a decade ago and (shortly after heartbleed happened) and progressively rolled bits out over the course of years. I'm sure there were problems here and there but it's hardly been a drag on them.

And parts of that involved specifically replacing Nginx in their architecture, so it's hardly irrelevant here.

https://blog.cloudflare.com/20-percent-internet-upgrade/

https://blog.cloudflare.com/how-we-built-pingora-the-proxy-t...

> With those assurances we can focus more on how a change to our service will interact with other services or a customer's origin. We can develop features at a higher cadence and not be burdened by memory safety and hard to diagnose crashes.

> When crashes do occur an engineer needs to spend time to diagnose how it happened and what caused it. Since Pingora's inception we’ve served a few hundred trillion requests and have yet to crash due to our service code.

> In fact, Pingora crashes are so rare we usually find unrelated issues when we do encounter one. Recently we discovered a kernel bug soon after our service started crashing. We've also discovered hardware issues on a few machines, in the past ruling out rare memory bugs caused by our software even after significant debugging was nearly impossible.

reply
deleted
reply
I mean, a lot of nginx use cases can be handled by e.g caddy - which does have significant real world deployment.
reply
Given the volume and depth of testing possible with AI these days I'd say the decades of testing isn't that expensive to reproduce, especially if it's an OSS project with a public bug tracker.
reply
xinproxy has a pretty restrictive license, but I'll give ferron.sh a closer look.
reply
But rust is not a silver bullet. Rust compiler still has memory corruption bugs. Rust is only memory safe by design not by implementation. Borrow checker allows unsafe code without using unsafe keyword.
reply
It isn't perfect. But it is still way better than c.
reply
> Borrow checker allows unsafe code without using unsafe keyword.

is this just the continuation of the previous point (compiler/borrow checker can have bugs), a nod that you can import unsafe dependencies, or is there a soundness gap in rust that I'm not aware of?

reply
this is just a perfection fallacy. silver bullets don’t need to be perfect in every single way to be silver bullets. and rust is as much of one as anything.
reply
You can still die in a car accident while wearing a seatbelt, too.
reply
Software doesn’t generally get checked for bugs until it has users. These new web servers mostly have that going for them rather than the language.
reply
It is true that mileage is a good proxy for finding bugs, but this is isomorphic to the fundamental differences between testing v. verification. You can prove absence of classes of bugs with verification. Obviously there can be other logic bugs in newer software. No question. The issue is the memory-corruption bugs in socket-facing daemons can have catastrophic consequences, especially in light of chaining kernel vulnerabilities which defeats the privilege drop that nginx does.

So I'd say it is about a more holistic risk-analysis not just handwaving "all code can have bugs, duh!"

reply
A more holistic risk-analysis would also need to consider the fact that a high-performance webserver written in Rust may also have memory safety issue due to use of "unsafe" features or unsafe dependencies, may be affected by memory safety issues in the standard library, may also have catastrophic logic errors, may be more affect by supply chain risks due to the use of a language-level package manager, and may have a larger patch gap.
reply
Which is like complaining that Python is unsafe because it is written in C.

That is a far smaller surface as seen by research into incorporating rust in Android leading to none of the high profile vulnerabilities C and C++ led to previously.

reply
Not in the slightest. It's like pointing out that a Python script calling out to binaries written in C doesn't have the memory safety of Python's GC. Which is obviously the case, and if you're a serious developer it's a failure point you're very mindful of.

On the Android point, I remember those metrics were highly flawed and didn't account for the inequality of substructural type ergonomics in different contexts. You can get very nice metrics by rewriting things that fit to the grain of safe Rust, which gives you an inaccurate picture of how much unsafe code is "real world". LLMs have changed the field here, but it's worth pointing out that blog post you're referencing was more self-congratulatory marketing than serious science.

Also problematically, I remember it being highly misleading in that the actual observed result was lower severity in vulnerabilities, but a very minimal effect on the total number over all. That's certainly significant, but it wasn't how it presented itself, which is rather problematic if you expect people to take it seriously as objective research.

Measurements probably real, but not worth citing. It's not like on their own blog they're under usual academic journal pressures to overclaim results, p-hack, and engage in other misleading behaviors.

reply
By research you mean blog posts by Google?
reply
What specifically distinguishes the empirical research presented in Google’s blog posts, for example the one linked below, from your definition of research?

https://blog.google/security/rust-in-android-move-fast-fix-t...

reply
This argument is cope.

In theory, that could be possible. In practice, there have been many many case studies demonstrating the opposite and not that many case studies demonstrating in favor of your argument.

e.g. Cloudflare replaced Nginx with Pingora: https://blog.cloudflare.com/how-we-built-pingora-the-proxy-t...

> With those assurances we can focus more on how a change to our service will interact with other services or a customer's origin. We can develop features at a higher cadence and not be burdened by memory safety and hard to diagnose crashes.

> When crashes do occur an engineer needs to spend time to diagnose how it happened and what caused it. Since Pingora's inception we’ve served a few hundred trillion requests and have yet to crash due to our service code.

> In fact, Pingora crashes are so rare we usually find unrelated issues when we do encounter one. Recently we discovered a kernel bug soon after our service started crashing. We've also discovered hardware issues on a few machines, in the past ruling out rare memory bugs caused by our software even after significant debugging was nearly impossible.

The CVE counts for new parts of the Linux kernel written in Rust are much lower than the (recent) CVE counts for even mature, years old parts of the Linux kernel written in C, to say nothing of the historical record.

reply
If we're suggesting alternative web servers, I have had a pleasant experience with caddyserver (Go). It's been around 10+ years, has essentially transparent TLS certificate provisioning, and its config syntax is easy to understand. Even using AI to help vet configs, it's readable. It's packaged everywhere and has lots of plugins for things, though I only need the base package for my frontend proxy usecase.
reply
is xinproxy open source? the website only has binaries and I couldn't find anything on github
reply
Ferron is opensource. xin isn't yet.
reply
If you're using NGINX to run your PHP applications, consider eliminating everything other than PHP itself:

https://news.ycombinator.com/item?id=50551504

reply
See Morris worm, and when it took place, afterwards check Multics security assement done by the DoD versus UNIX.

Additionally, check what the inventors themselves of UNIX and C did after being done with them, and what they did afterwards in terms of operating systems and programming languages.

Yet, some folks are more attached to C than the inventors themselves.

reply
Sure, using a closed source proxy from a company nobody has ever heard of... That's a good idea...

Ferron seems much better, but I'm also not convinced that it's really production ready

reply
It's a bit political to say that C is the fault here, I'd venture the radical position that this was an Nginx issue.
reply
As someone that was a developer for a long time what is the problem with C? How does going to rust mitigate this? Why is having the stuff in C a security challenge?
reply
It's very easy to accidentally write buffer overflows, use-after-frees or other memory-safety bugs in C. Modern tooling can probably catch some of these better than in the days of yore but the fundamentals of the language are still the same.

If e.g. the standard array type in a language has built-in bounds checks that error out when you try to write to an index that's outside of the array, you can't trivially create buffer overflows simply by writing to the wrong index or by trying to write n + 10 bytes into an n-byte array.

But C in itself has no guardrails against something like

  char buffer[100];
  strcpy(buffer, some_user_supplied_string_with_200_chars);
Of course most memory safety bugs aren't trivial like that since C programmers have hopefully learned to avoid the simple mistakes. But there can be more complicated and difficult to spot cases, and C has no guardrails against those either.
reply
Some people think it's fundamentally impossible for C to be correct or memory safe
reply
Fundamentally impossible? No.

Practically impossible? Yes.

SQLite is probably the most thoroughly tested and carefully developed C library in history and they still found a handful of memory safety bugs every year.

reply
Rust is memory safe at the cost of being harder to write, but with AI, it's actually really easy to write it because AI's loove strict compilers. So now that AIs can just find 0-days before things are even released (so I'm told), it makes a lot of sense to do bun[1]-style rewrites to Rust with AI.

1: https://bun.com/blog/bun-in-rust

reply
If a bug is found before its released... Then that's not a 0-day?

The name refers to the number of days since public release. "Exploitable 0 days since release". If you found a bug before release, then that's... Just a bug picked it up in normal development lifecycle.

reply
I read 0 days like "Exploitable 0 days since _discovery_". Also, it's only a bug in the normal lifecycle if the discoverer tells the developer making it. If they discover it and then have hours and days to perfect a program that exploits it, then starts running immediately when it is deployed or released, that's a new kind of "zero day". Makes you want to start differentiating what "0 days" mean, though.
reply
If AI found it, then the discoverer has told the dev, though, right? So it _is_ in the normal lifecycle. So it can't be a zero-day.
reply
The ai told the hacker. The hacker discovered it with his AI before the developer released by examining his git branch.

I think that's the fundamental disconnect in the conversation here. You think I'm talking about the dev because it's not released yet but just because it isn't tagged and released doesn't mean it's not done in the open where hackers can see it and their AI can scan it.

reply
This looks like someone prompted "rewrite nginx in rust, make no mistakes" in an afternoon and is now distributing it as a closed-source binary. Might as well just do it yourself.
reply
xin seems to be closed source and ai generated. Before even worrying about exploits, how is someone supposed to ascertain that xin's implementation is correct? Sure Rust might not have any memory safety issues, but other logic vulnerabilities may exist. 'Claude make no mistakes?'

Caddy, Traefik, or even Envoy may be better choices.

reply
No idea what the code is like, but the AI-generated landing page makes xinproxy an immediate "no thanks" for me.
reply
I'd hate to interrupt all the Rust fans sucking each other off again, but no one has yet mentioned the RCE relies on ASLR being disabled, which is basically non-existent nowadays. Another nothingburger CVE with a silly name and it's only Wednesday.
reply
[dead]
reply
[flagged]
reply
Haven't you heard? These vulnerabilities are just AI marketing stunts. And also, the Bun rewrite to rust was a marketing stunt, those things don't work. There's no way Bun is running on Rust from a couple month AI powered rewrite, that would shatter my preconceived worldview about what the future looks like. /s
reply