3 ms·
Are there any scanners out there that will detect user input ending up as the format string of a printf? Perhaps a scanner than I can run against all of github
by londons_explore 6y ago
Are there any scanners out there that will detect user input ending up as the format string of a printf?
Perhaps a scanner than I can run against all of github, and then rank results by the number of times that code is exposed on a high value server connected to the internet...?
- Someone 6y agoAny modern C compiler will already warn you if the format string isn’t a string literal (https://stackoverflow.com/questions/32362918/error-format-string-is-not-a-string-literal/32362980 https://stackoverflow.com/questions/32362918/error-format-st...) I don’t think it’s worth the effort to extend that to look for tainted strings, not because it wouldn’t be useful, but because it would be hard to do (as an extreme example: is data read from a file user input? It could be a file containing internationalization info) The (relatively) few programs that construct format strings on the fly will have to add pragmas to disable these warnings.