468,268 Members | 1,605 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,268 developers. It's quick & easy.

Do checked iterators/containers make code more secure?

zr
Hi,

Does usage of checked iterators and checked containers make code more
secure?
If so, can that code considered to be reasonably secure?

Nov 20 '08 #1
3 2511
On 2008-11-20 09:08:58 -0500, zr <zv*****@gmail.comsaid:
>
Does usage of checked iterators and checked containers make code more
secure?
If so, can that code considered to be reasonably secure?
Define "secure" and "reasonably secure".

--
Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

Nov 20 '08 #2
zr
On Nov 20, 4:11*pm, Pete Becker <p...@versatilecoding.comwrote:
On 2008-11-20 09:08:58 -0500, zr <zvir...@gmail.comsaid:
Does usage of checked iterators and checked containers make code more
secure?
If so, can that code considered to be reasonably secure?

Define "secure" and "reasonably secure".

--
* Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)
Obviously checked iterators make it easier to detect defects, but i am
asking about security. By "secure" i mean resistant to malicious usage
of the application and resistant to other hostile code. I will let the
security experts define the term more precisely.
By "reasonably secure" i mean the required security quality that
production software software should meet (yes, if it asks for your
credit card number, it should be more than just "reasonably secure").
On second thought, it might have been better if i started with a
question like "how can i learn to write secure C++ code?" - you are
welcome to answer it as well.
Nov 21 '08 #3
zr <zv*****@gmail.comkirjutas:
On Nov 20, 4:11*pm, Pete Becker <p...@versatilecoding.comwrote:
>On 2008-11-20 09:08:58 -0500, zr <zvir...@gmail.comsaid:
Does usage of checked iterators and checked containers make code
more secure?
If so, can that code considered to be reasonably secure?

Define "secure" and "reasonably secure".

--
* Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of "The
Standard C++ Library Extensions: a Tutorial and Reference
(www.petebecker.com/tr1book)

Obviously checked iterators make it easier to detect defects, but i am
asking about security. By "secure" i mean resistant to malicious usage
of the application and resistant to other hostile code. I will let the
security experts define the term more precisely.
By "reasonably secure" i mean the required security quality that
production software software should meet (yes, if it asks for your
credit card number, it should be more than just "reasonably secure").
On second thought, it might have been better if i started with a
question like "how can i learn to write secure C++ code?" - you are
welcome to answer it as well.
Probably not the best place, there seem to be many groups
comp.security*.

In Perl for example there is some built-in support meant for enhancing
security (taint mode). In C++, there is no such built-in support, so the
topic is not really language-specific. I'm no expert, but it generally
comes down to having no memory access errors, and not trusting input
from uncontrolled sources.

I think checked iterators a la MSVC++ may actually help here a bit,
detecting some of memory access errors. Another similar aid would be to
use garbage collector instead deletes, recently advocated here by James
Kanze, to avoid accidental access to a wrong object. Another useful aid
in the same fashion would be to splitter the code by assert()-s for
obvious and non-obvious things (and of course taking care to not compile
it away in the final release). However, these are not silver bullets, so
just compiling your whatever code with checked iterators support does
not magically make it "reasonably secure", whatever that might be.

Anyway, one has to start from the software requirements. If some server
software must have the best possible performance and allows the remote
user to execute arbitrary system() or dynamic library calls, then there
are no security benefits from checked iterators or asserts, only runtime
costs pulling down the performance. Naturally, such software should be
used only in a trusted network.

Paavo

Nov 21 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Ney André de Mello Zunino | last post: by
2 posts views Thread by Alexander Stippler | last post: by
4 posts views Thread by Merlin | last post: by
2 posts views Thread by Patrick Kowalzick | last post: by
3 posts views Thread by codefixer | last post: by
8 posts views Thread by babak | last post: by
4 posts views Thread by kalita | last post: by
19 posts views Thread by fungus | last post: by
18 posts views Thread by desktop | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.