Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Buffer overflow
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Use of safe libraries=== The problem of buffer overflows is common in the C and C++ languages because they expose low level representational details of buffers as containers for data types. Buffer overflows can be avoided by maintaining a high degree of correctness in code that performs buffer management. It has also long been recommended to avoid standard library functions that are not bounds checked, such as <code>[[gets()|gets]]</code>, <code>[[scanf]]</code> and <code>[[strcpy]]</code>. The [[Morris worm]] exploited a <code>gets</code> call in [[fingerd]].<ref>{{cite web |url=http://wiretap.area.com/Gopher/Library/Techdoc/Virus/inetvir.823 |title=Archived copy |website=wiretap.area.com |access-date=6 June 2022 |archive-url=https://web.archive.org/web/20010505080457/http://wiretap.area.com/Gopher/Library/Techdoc/Virus/inetvir.823 |archive-date=5 May 2001 |url-status=dead}}</ref> Well-written and tested abstract data type libraries that centralize and automatically perform buffer management, including bounds checking, can reduce the occurrence and impact of buffer overflows. The primary data types in languages in which buffer overflows are common are strings and arrays. Thus, libraries preventing buffer overflows in these data types can provide the vast majority of the necessary coverage. However, failure to use these safe libraries correctly can result in buffer overflows and other vulnerabilities, and naturally any [[Software bug|bug]] in the library is also a potential vulnerability. "Safe" library implementations include "The Better String Library",<ref>{{cite web |url=http://bstring.sf.net/ |title=The Better String Library}}</ref> Vstr<ref>{{cite web |url=http://www.and.org/vstr/ |title=The Vstr Homepage |access-date=2007-05-15 |archive-url=https://web.archive.org/web/20170305020810/http://www.and.org/vstr/ |archive-date=2017-03-05 |url-status=dead }}</ref> and Erwin.<ref>{{cite web |url=http://www.theiling.de/projects/erwin.html |title=The Erwin Homepage |access-date=2007-05-15}}</ref> The [[OpenBSD]] operating system's [[C library]] provides the [[strlcpy]] and [[strlcat]] functions, but these are more limited than full safe library implementations. In September 2007, Technical Report 24731, prepared by the C standards committee, was published.<ref>{{Cite web|url=https://www.iso.org/obp/ui/#iso:std:iso-iec:tr:24731:-1:ed-2:v1:en:sec:4|title=Information technology β Programming languages, their environments and system software interfaces β Extensions to the C library β Part 1: Bounds-checking interfaces|last=International Organization for Standardization|date=2007|website=ISO Online Browsing Platform}}</ref> It specifies a set of functions that are based on the standard C library's string and IO functions, with additional buffer-size parameters. However, the efficacy of these functions for reducing buffer overflows is disputable. They require programmer intervention on a per function call basis that is equivalent to intervention that could make the analogous older standard library functions buffer overflow safe.<ref>{{cite web |url=https://www.securecoding.cert.org/confluence/x/QwY |archive-url=https://archive.today/20121228031633/https://www.securecoding.cert.org/confluence/x/QwY |url-status=dead |archive-date=December 28, 2012 |title=CERT Secure Coding Initiative |access-date=2007-07-30 }}</ref>
Summary:
Please note that all contributions to Niidae Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Buffer overflow
(section)
Add topic