Question

Provide an original example of a security flaw or vulnerability related to pointers. The original source should be cited...

Provide an original example of a security flaw or vulnerability related to pointers. The original source should be cited but not copied directly.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

NULL pointer dereference erros are common in C/C++ languages. Pointer is a programming language data type that references a location in memory. Once the value of the location is obtained by the pointer, this pointer is considered dereferenced. The NULL pointer dereference weakness occurs where application dereferences a pointer that is expected to be a valid address but instead is equal to NULL. The following C++ example causes a NULL pointer dereference error:

  1. #include <stdio.h>

  2. int *ptr = NULL;

  3. int _tmain(int argc, _TINT* argv[])

  4. {

  5.   *ptr = 17;

  6.   return 0;

  7. }

The following C++ code demonstrates NULL pointer dereference error within the getaddrinfo() function when argv[2] is empty:

  1. #undef UNICODE

  2. #include "StdAfx.h"

  3. #include <winsock2.h>

  4. #include <ws2tcpip.h>

  5. #include <stdio.h>

  6. #pragma comment (lib, "Ws2_32.lib")

  7. int __cdecl main(int argc, char **argv)

  8. {

  9. WSADATA wsaData;

  10.   int iResult;

  11. INT iRetval;

  12. DWORD dwRetval;

  13.   int i = 1;

  14.   struct addrinfo *result = NULL;

  15.   struct addrinfo *ptr = NULL;

  16.   struct addrinfo hints;

  17.   if(argc<2){

  18.   printf("usage: %s <proto> <hostname> <servicename>\n", argv[0]);

  19.   return 1;

  20.   }

  21. iResult = WSAStartup(MAKEWORD(2, 2), &wsaData);

  22.   if (iResult != 0) {

  23.   printf("WSAStartup failed: %d\n", iResult);

  24.   return 1;

  25.   }

  26. ZeroMemory( &hints, sizeof(hints) );

  27. hints.ai_family = AF_UNSPEC;

  28. hints.ai_socktype = SOCK_STREAM;

  29. hints.ai_protocol = IPPROTO_TCP;

  30. dwRetval = getaddrinfo(argv[2], argv[3], &hints, &result);

  31.   if ( dwRetval != 0 ) {

  32.   printf("getaddrinfo failed with error: %d\n", dwRetval);

  33. WSACleanup();

  34.   return 1;

  35.   }

  36.   printf("getaddrinfo returned success\n");

  37.   return 0;

  38. }

The above code contains a logic error when checking against the number of input parameters in the if(argc<2) statement. As a result, NULL is passed as the first argument of the getaddrinfo() function instead of a valid address.

A number of flaws can cause NULL pointer dereference issues, including race condition, and programming omissions as demonstrated above.

Potential impact

In most cases, NULL pointer dereference errors result in the crash of application however, code execution is possible under certain circumstances. Depending on privileges of the application, this weakness can result in a denial of service attack against the entire system or can be used to gain complete control over it.

Add a comment
Know the answer?
Add Answer to:
Provide an original example of a security flaw or vulnerability related to pointers. The original source should be cited...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Provide one real world example where hashing was used as a security measure. Be sure to...

    Provide one real world example where hashing was used as a security measure. Be sure to provide a source to validate your example. After you have provided an example you are to answer two questions: 1: Why did hashing work as a security measure in this instance? 2: What could have been done to defeat the hashing by hackers?

  • . NEED ANSWER ASAP / NEEDS TO BE ORIGINAL SOURCE NEVER USED BEFORE. PLEASE PROVIDE A...

    . NEED ANSWER ASAP / NEEDS TO BE ORIGINAL SOURCE NEVER USED BEFORE. PLEASE PROVIDE A 1-2 page summary Of a spices product summary of Coriander, Chilli, Turmeric, & Cumin. ( can be related to either or all, market strategy, competitive nature in market place, business concept strategy, ,how it affects community around it ,ect.) PLEASE ANSWER AS THROUGHLY AS POSSIBLE COPY AND PASTE ANSWER NOT ATTACHMENT NEW ANSWER NEVER USED BEFORE ORIGINAL SOURCE

  • Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers...

    Hello I need help with this program. Should programmed in C! Program 2: Sorting with Pointers Sometimes we're given an array of data that we need to be able to view in sorted order while leaving the original order unchanged. In such cases we could sort the data set, but then we would lose the information contained in the original order. We need a better solution. One solution might be to create a duplicate of the data set, perhaps make...

  • Item 1 In the case below, the original source material is given along with a sample...

    Item 1 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version The lack of specific technology knowledge and skills, technology-supported pedagogical knowledge and skills, and technology-related- classroom management knowledge and skills has been identified as a major barrier to technology integration. Lack of specific technology knowledge and skills is one of the common reasons given by...

  • Question A •There are several different type of access mechanisms, they include (MAC, DAC and RBAC)....

    Question A •There are several different type of access mechanisms, they include (MAC, DAC and RBAC). Describe and give an example of each of these. Please include pro’s and con’s as well. •Do we need more laws or are existing laws sufficient for IT security? Who should have jurisdiction? What about in international cases? (justify your position) Question B research a unique news story or article related to Information Technology. Post a summary of what you learned to the discussion...

  • Item 1 In the case below, the original source material is given along with a sample...

    Item 1 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version Analysis of patterns in time (APT) is a method for gathering information about observable phenomena such that probabilities of temporal patterns of events can be estimated empirically. If appropriate sampling strategies are employed, temporal patterns can be predicted from APT results. Finally, APT is compared...

  • Item 1 In the case below, the original source material is given along with a sample...

    Item 1 In the case below, the original source material is given along with a sample of student work. Original Source Material Suppose you study a group of successful companies and you find that they emphasize customer focus, or quality improvement, or empowerment; how do you know that you haven't merely discovered the management practice equivalent of having buildings? How do you know that you've discovered something that distinguishes the successful companies from other companies? You don't know. You can't...

  • Using your reading and the Internet, provide a one-page response detailing the relevance of physical security...

    Using your reading and the Internet, provide a one-page response detailing the relevance of physical security in the cybersecurity arena. Write a few short paragraphs and feel free to use bullets. Part 1: Compile Cyber Investigation Guidelines (3 points) Using your reading and the Internet, provide a response detailing the chain of custody considerations to enable you to collect evidence that will useful for a legal prosecution. Write short paragraphs guiding IT employees regarding the need to protect evidence and...

  • Item 6 In the case below, the original source material is given along with a sample...

    Item 6 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version Precedent is also described as "the unique knowledge embedded in a known design" (Oxman, 1994, p. 146), meaning, in everyday terms, that the memory of having experienced an existing design is a memory that contains special forms of knowledge... At heart, the design case is...

  • Item 3 In the case below, the original source material is given along with a sample...

    Item 3 In the case below, the original source material is given along with a sample of student work. Determine the type of plagiarism by clicking the appropriate radio button. Original Source Material Student Version Instructional designers typically employ models to guide their day- to-day work. Due to the increased practice of the systematic design of instruction in a growing number of settings, available models become more and more proliferated, focusing on particular types and contexts of learning, particular groups...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT