Go是否容易受到缓冲区溢出的影响
Is Go vulnerable for buffer overflow
我知道像 c# 这样的语言不容易受到缓冲区溢出的影响,除非您编组或使用不安全的代码。但是 go 容易受到缓冲区溢出的影响吗?
Go checks for bounds in strings, arrays and slices so it is not vulnerable as long as you are not playing around with unsafe 包。
快速搜索后,我找到了这个 link:http://0xdabbad00.com/2015/04/12/looking_for_security_trouble_spots_in_go_code/
它指出 golang 可以抵御大多数 "known" 攻击("known" 在 C 中使用)。例如,没有指针算法,没有手动内存管理,这使得它不太容易出现导致 "exploitable" 代码的错误。
我不是 golang 专家,但它似乎是一种经过深思熟虑的语言,具有良好的环境(标准库、编译器等...)
“Go 通常是一种安全的语言。它具有内存内置安全措施,可以避免常见的缓冲区溢出漏洞,就像它们经常存在于 C 程序中一样。”
https://dev.to/jlauinger/exploitation-exercise-with-unsafe-pointer-in-go-information-leak-part-1-1kga
正如那里所说,“不安全的标准库包破坏了这种内存安全。使用 unsafe.Pointer,我们可以创建任意类型的指针。”
就像@Grzegorz Żur 所说的那样,只要您不使用不安全的包,它就不会受到攻击。
干杯
我知道像 c# 这样的语言不容易受到缓冲区溢出的影响,除非您编组或使用不安全的代码。但是 go 容易受到缓冲区溢出的影响吗?
Go checks for bounds in strings, arrays and slices so it is not vulnerable as long as you are not playing around with unsafe 包。
快速搜索后,我找到了这个 link:http://0xdabbad00.com/2015/04/12/looking_for_security_trouble_spots_in_go_code/
它指出 golang 可以抵御大多数 "known" 攻击("known" 在 C 中使用)。例如,没有指针算法,没有手动内存管理,这使得它不太容易出现导致 "exploitable" 代码的错误。
我不是 golang 专家,但它似乎是一种经过深思熟虑的语言,具有良好的环境(标准库、编译器等...)
“Go 通常是一种安全的语言。它具有内存内置安全措施,可以避免常见的缓冲区溢出漏洞,就像它们经常存在于 C 程序中一样。” https://dev.to/jlauinger/exploitation-exercise-with-unsafe-pointer-in-go-information-leak-part-1-1kga
正如那里所说,“不安全的标准库包破坏了这种内存安全。使用 unsafe.Pointer,我们可以创建任意类型的指针。”
就像@Grzegorz Żur 所说的那样,只要您不使用不安全的包,它就不会受到攻击。
干杯