-
Notifications
You must be signed in to change notification settings - Fork 188
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Buffer overflow vulnerability in netperf through 2.6.0 #40
Comments
Is there a PR that fixes this issue? Did you find this by manual inspection or by creating a fuzz target for something like AFL or libfuzzer? Should there be a CVE? It looks like this buffer overflow allows Are there any (default or additional) build flags that can help prevent exploitation of the identified vulnerability? |
https://awesome-safety-critical.readthedocs.io/en/latest/#coding-guidelines Is this a CWE-120 or a CWE-119 or similar? "CWE-120: Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')" "CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer" |
Is there a FOSS static analysis tool that could be added to the build that would detect is it a |
"Secure Coding in C and C++: Strings and Buffer Overflows" describes use of Would |
FWIW, you can monospace format code
$ echo "like this" void main() {
sprint("like this");
} And And you can include code snippets by adding a link to the source blob followed by a line range: #L111-L117; which you can specify by clicking a line number and then shift-clicking an ending line number. Pressing You can also / instead click the line number and then select 'Copy permalink': Lines 642 to 650 in bcb868b
|
In OpenWrt, typically used as single-user system, netperf's netserver runs as root. |
https://openwrt.org/packages/pkgdata/netperf
(OT but FWIW:
|
Netperf 2.6.0 s a benchmark tool than developed by Helett Packard that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional troughput and end-to-end latency.
Stack-based buffer overflow vulnerability in function scan_cmd_line() allows local attackers to cause a denial of service(application crash) or get a system shell(by ROP when canary protection disabled).
POC:
root@iZp6mmjqib52f6Z:~# netperf -a `python -c 'print "A"*8220+"DCBA"'`
*** stack smashing detected ***: netperf terminated
Aborted (core dumped)
Vulnerability in src/netsh.c:
line 633 in function scan_cmd_line():
``
When command line argument starts with '-a', the string optarg is copied to arg1 and arg2 via function break_args(), causing a stack-based buffer overflow.
When attackers try to exploit the vulnerability, if __stack_chk_fail is enabled, the program checks stack canary and exits. Otherwise, the program returns to constructed RIP(shellcode address or ROP address) and attackers may get a shell via system('/bin/sh').
The text was updated successfully, but these errors were encountered: