Questions tagged [stack-smash]

Stack smashing is a buffer overflow vulnerability which is characterized by writing data outside the size of a stack-allocated buffer, causing corruption of a neighboring stack frame and potentially permitting execution of malicious code. Use this tag for questions about `stack smashing detected` and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: [buffer-overflow] and [buffer-overrun].

In software, a stack buffer overflow (also known as stack smashing) occurs when a program writes to a memory address on the program's call stack outside of the intended data structure, which is usually a fixed length buffer. Stack buffer overflow bugs are caused when a program writes more data to a buffer located on the stack than what is actually allocated for that buffer. This almost always results in corruption of adjacent data on the stack, and in cases where the overflow was triggered by mistake, will often cause the program to crash or operate incorrectly. Stack buffer overflow is a type of the more general programming malfunction known as buffer overflow (or buffer overrun).

This tag should be used for questions about stack smashing detected and similar runtime errors, code with vulnerable buffers and other security risks related to stack smashing. See also: and .

161 questions
0
votes
0 answers

stack smashing calling python function importing tensorflow c++

I am new to tensorflow as well as including python code in c++, therefore I would apprechiate any tips/comments on the following weird behaviour: I have a c++ class pythoninterface with headerfile pythoninterface.h: #include #include…
Seastar
  • 386
  • 2
  • 19
0
votes
0 answers

What can i do to for these stack smashing detected in my program?

I have submitted the code please help me. The program is about creating a string data structure for containing dictionary only for alphabet a. [ #include #include #include char *string[1000]; …
Abbas Ali
  • 11
  • 1
0
votes
1 answer

ROP attack chain not detected as an argument

I have created an ROP attack chain which I know works since I have tested it with another program without the problem code. My problem is whenever I run my ROP chain as an input argument into my target binary file, it can't get pass this part: if…
Daniel
  • 11
  • 5
0
votes
0 answers

Segmentation fault when trying to adapt "Smashing The Stack For Fun And Profit"

I am following the classic paper Smashing The Stack For Fun And Profit along side "Smashing the Stack in 2011". Despite all the Q/As about these papers I cannot find an answer to my problem. I am trying to run a simple exit(0) command but with a…
dippynark
  • 2,743
  • 20
  • 58
0
votes
1 answer

Segmentation fault on a read function

I have got some serious problems with Stack Smash Protection and now I get a new error -Segmentation fault-. I think it is strongly related to the fact that linux has some special protections. Can anyone please explain me why do I get Segmentation…
Codrin Strîmbei
  • 125
  • 7
  • 22
0
votes
1 answer

What does __interceptor_strchr do?

my function crashes(due to stack overrun) right after this machine instruction: 0x00000000004b1e4c : e8 3f 85 fa ff callq 0x45a390 <__interceptor_strchr(char const*, int)> What does __interceptor_strchr(char const*, int) do?
TYN
  • 29
  • 5
0
votes
0 answers

Temporarily disable segmentation fault Ubuntu 14.04

I am doing some homework for University and the book I am working from (Secure coding in C and C++ by Robert Seacord) has the following example in it; You write a simple enter password program and do a stack smash on the program to make the terminal…
0
votes
1 answer

Return address from separate function when exploiting buffer vulnerability

I have to exploit a buffer vulnerability in the code below using a string of shell op codes. I have seen almost everything Google has suggested but this particular problem is confusing me because of the function separations. void printThis(){ …
0
votes
0 answers

Why variable 'pass' change it's value after stack buffer overflow?

I can't understand what's happening with buf1 and pass in main(). I understand that after buffer overflow in gets(buf1): Firstly (by input more then 15 characters), we are actually changing calling frame for calling function main() Secondly (if…
0
votes
2 answers

C - stack smashing detected

I need to implement a pretty easy in-place LU-decomposition of matrix A. I'm using Gaussian elimination and I want to test it with a 3x3 matrix. The problem is, I keep getting stack smashing error and I don't have any idea why. I don't see any…
Eenoku
  • 2,741
  • 4
  • 32
  • 64
0
votes
5 answers

Stack Smashing/BackTrace

I wrote a little piece of code that is supposed to take a char array and make it look like the computer is typing the text out. Simple enough, right? But when I ran it, Terminal told me this: *** stack smashing detected ***: ./TYPE…
DarkSun
  • 41
  • 2
  • 6
0
votes
1 answer

*** stack smashing detected *** Aborted (core dumped)

I'm trying to debug a program that gives the error: Abort (core dumped). Valgrind detects a stack smashing and gives a LEAK SUMMARY with 1 block still reachable. It signals to line 12 of a the function downloadAndOpen where I have an fopen that I…
user4386193
0
votes
1 answer

Loading "/bin/sh" into a register

I'm trying to write ASM code to spawn a shell. I've figured out that the syscall number for __execve is 0x3b or 59. I need to send "/bin/sh" as the first parameter, a pointer to {"/bin/sh", NULL} as the second parameter and NULL as the third…
Karthik Balakrishnan
  • 4,353
  • 6
  • 37
  • 69
0
votes
1 answer

How to detect run-time stack smashing/buffer overflow in C and enable gdb to exit gracefully with proper message.?

Buffer overflow is causing gdb to behave in a erratic way and proper logs are not being printed. How to enable gdb to print logs in a proper way? Also, is there a way to detect runtime stack smashing in a multithreaded environment? Searched about…
0
votes
1 answer

c stack smashing detected on file managing

I'm having problem with my program. The variables are written in italian, I'm sorry! I have to handle the penalties phase of a football game. If in the first five penalties the teams end tie, they will go for penalties to the end. if…
Astinog
  • 1,151
  • 3
  • 12
  • 35