(I guess that semantics can also be seen as a formally verified property)
Compare that to a language designed well enough that reflection isn't necessary for good APIs, for instance.
That's not really where you'd expect RCE-problems.
Like, the log4j thing came from (among other design errors) choosing to use reflection to look up filters for processing data during logging. Why would log4j's developers possibly think reflection is an appropriate tool for making filters available? Because it's the easy option in Java. Because it's the easy option, people are already comfortable with it in other libraries. Because it's easy and comfortable, it's what gets done.
Some languages make reflection much more difficult (or nearly impossible) and other APIs much easier. It's far more difficult to make that class of error in languages like that.
whistles in python
pickle._getattribute(__import__(package), path)
everywhere, which is basically how Java reflection works half the time. In Python, you'd have something like copyreg.dispatch_table, and have plugin modules that register themselves in the table at load-time – limiting your attack surface to the modules you expect to be attack surface, rather than every single package accessible to the JVM.But more broadly the thing is that eliminating these low level language footguns would allow people to focus on the logic and design errors.
Yes, a safer language is not enough, but it is a huge leap forward, so I'll take it.
NSA's Software Memory Safety recommendation:
https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/1/CSI... (pdf)
So better approach is to use container security or something like that.
"The threat of accidental vulnerabilities in local code is almost impossible to address with the Security Manager. Many of the claims that the Security Manager is widely used to secure local code do not stand up to scrutiny; it is used far less in production than many people assume. There are many reasons for its lack of use: [...]"
Would be interesting to know if there were other cases besides ElasticSearch that were protected from log4j by JSM.
Which is a pity, but unfortunely capability based systems still seem to have a problem for the common developer to properly configure them.
Bad design is a universal orthogonal problem.
See how eg optimized tail calls essentially give you back all the power of goto without the old downsides.
Well, everyone would want that, but it's not possible. Formal verification comes nowhere close to promising that, especially not on a large project. I'm pretty sure OpenSSL is larger than any formally verified software to date (perhaps CompCert is larger?).
Donald Knuth