My background is in compilers/code optimization, and I'm wondering whether there might be any interesting applications of extremely aggressive runtime code specialization towards improving security applications. So: suppose we have a JIT compiler that can perform aggressive code optimizations based on runtime constants. (These runtime values are not known at compile time and so the corresponding optimizations can't be done at compile time.) Are there interesting security-related problems that could benefit from something like this?
This is probably far-fetched (and admittedly speculative), but I'll post to hopefully stimulate ideas in others:
In traditional software design, code paths dependency was clear and not dynamically determined. As such, any security [static] analysis that relied on source-sink trace analysis was "easy" to do. (E.g. finding a code path via static analysis that uses user input in a SQL without having passed through a cleansing function; or user input reflecting back in output opening to XSS; or password making it to log files in cleartext).
So one thing that a JIT compiler could, theoretically at least, do is identify new source-sink paths that are created, and either perform at least some rudimentary type analysis, or perhaps generate an event that a security monitoring app could trap and perform in-depth analysis at runtime.
The hurdle here is not just JIT-based source-sink identification in inexpensive way, but also that security type analysis on top of it is [currently] is prohibitively slow (AFAIK). But perhaps some rudimentary type analysis may be done at runtime in at a reasonable performance expense.