upvote
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