Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is Go vulnerable for buffer overflow

I know languages like c# aren't vulnerable to buffer overflows unless you marshal or use unsafe code. But is go vulnerable for buffer overflows?

like image 239
Jan-Fokke Avatar asked Oct 26 '16 12:10

Jan-Fokke


2 Answers

Go checks for bounds in strings, arrays and slices so it is not vulnerable as long as you are not playing around with unsafe package.

like image 120
Grzegorz Żur Avatar answered Oct 21 '22 02:10

Grzegorz Żur


After a quick search I found this link: http://0xdabbad00.com/2015/04/12/looking_for_security_trouble_spots_in_go_code/

It states that golang is safe from most "known" attacks ("known" as in used in C). For instance, the fact that there is no pointer arithmetics, no manual memory management make it less prone to errors that would lead to "exploitable" code.

I'm no expert of golang but it seems like a well thought language with a good environment (std lib, compiler, etc...)

like image 21
Rowern Avatar answered Oct 21 '22 03:10

Rowern