#0 __memcpy_avx_unaligned_erms () at ../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:331
#1 0x0000555555610271 in Firebird::makeDynamicStrings (length=7, dst=0x7ffff7601cb8, src=0x7fffffffc3f8) at src/common/DynamicStrings.cpp:90
#2 0x00005555555bfa5c in Firebird::DynamicVector<20u>::save (this=0x7ffff7601cb0, length=7, status=0x7fffffffc3f8, warningMode=false) at src/include/../remote/../common/StatusHolder.h:81
#3 0x00005555555bee06 in Firebird::DynamicVector<20u>::save (this=0x7ffff7601cb0, status=0x7fffffffc3f8, warningMode=false) at src/include/../remote/../common/StatusHolder.h:118
#4 0x00005555555bc351 in xdr_status_vector (xdrs=0x7ffff7601b60, vector=@0x7ffff4bf0788: 0x7ffff7601cb0) at src/remote/protocol.cpp:2146
#5 0x00005555555b63ac in xdr_protocol (xdrs=0x7ffff7601b60, p=0x7ffff4bf0638) at src/remote/protocol.cpp:444
#6 0x00005555555a6a31 in receive (main_port=0x7ffff75f8e50, packet=0x7ffff4bf0638) at src/remote/inet.cpp:2042
#7 0x00005555555c10d0 in rem_port::receive (this=0x7ffff75f8e50, pckt=0x7ffff4bf0638) at src/remote/remote.cpp:667
#8 0x00005555555d99f4 in SRVR_multi_thread (main_port=0x7ffff75f26d0, flags=2) at src/remote/server/server.cpp:1764
#9 0x00005555555fdbfe in main (argc=1, argv=0x7fffffffd6c0) at src/remote/server/os/posix/inet_server.cpp:582
Summary
Incorrect decoding of the 'op_response' packet can cause a crash when parsing the status vector.
Details
The main problem is inside
xdr_status_vector(), it doesn't handleisc_arg_cstringat all, so if anisc_arg_cstringis contained in the status vector, incorrect parsing will cause the server to crash.Basically there is no reason to send
op_responsefrom the client, the request will be dropped later inloopThread(), but the server should not fail anyway.Stacktrace
PoC
To reproduce the vulnerability, simply run the server and the Python script to emulate the malicious packet.
Python script
Impact
Essentially, every server is affected.
Affected versions
Tested on v5 and v6, but code looks old, so it possible that v4 and v3 also affected.