|
| Undoubtedly there are all sorts of languages in the world,
yet none of them is without meaning. | | 1 Corinthians 14:10 (NIV) |
There are many language-specific security issues.
Many of them can be summarized as follows:
Turn on all relevant warnings and protection mechanisms available to you
where practical.
For compiled languages, this includes
both compile-time mechanisms and run-time mechanisms.
In general, security-relevant programs should compile cleanly with
all warnings turned on. Avoid dangerous and deprecated operations in the language.
By ``dangerous'', I mean operations which are difficult to use correctly. Ensure that the languages'
infrastructure (e.g., run-time library) is available and secured. Languages that automatically garbage-collect strings should be
especially careful to immediately erase secret data
(in particular secret keys and passwords). Know precisely the semantics of the operations that you are using.
Look up each operation's semantics in its documentation.
Do not ignore return values unless you're sure they cannot be relevant.
Don't ignore the difference between ``signed'' and ``unsigned'' values.
This is particularly difficult in languages which don't support exceptions,
like C, but that's the way it goes.
|