2763 Commits

Author SHA1 Message Date
Kawe Mazidjatari
a33f569ad5 Proper fix for playlists reloading on disconnect
This fixes a crash/exception that would occur when getting disconnected from your own listenserver due to the playlists reload task dispatch. Moving this to client only code, in the disconnect routine (post disconnect) fixes this problem.
2023-06-18 17:13:42 +02:00
Kawe Mazidjatari
f5151a74cf Add comments to 'SV_CheckForBan'
Some stuff was unclear and took a minute to understand again, these comments fixes this problem.
2023-06-18 17:13:42 +02:00
Kawe Mazidjatari
efe119a5f2 Remove unnecessary parentheses from check in 'CHostState::FrameUpdate'
Unnecessary.
2023-06-18 17:13:42 +02:00
Kawe Mazidjatari
0a6fc26529 Comment assert out
Verbose, libcurl free's null blocks.
2023-06-18 12:06:28 +02:00
Kawe Mazidjatari
4f7280ab4c Make inline
These type of functions should always be inline.
2023-06-18 01:25:49 +02:00
Kawe Mazidjatari
32c0e20e76 Init cURL with custom memory callbacks 2023-06-18 01:16:58 +02:00
Kawe Mazidjatari
982fe66570 Add memory callbacks similar to the game's implementation
Required for overriding memalloc callbacks in libraries to feature the game's implementation instead. Named using the 'R_' prefix, as the 'V_' versions were already used.
2023-06-18 01:16:24 +02:00
Kawe Mazidjatari
c8648b9289 Fix typo
Typo.
2023-06-17 16:31:45 +02:00
Kawe Mazidjatari
b64897d4c1 Remove extraneous cURL compile option
Because already set from global CMake init.
2023-06-17 16:31:26 +02:00
Kawe Mazidjatari
7691fa1b5f Light console optimizations 2023-06-17 16:30:10 +02:00
Kawe Mazidjatari
788f38b428 Adjust cURL compile options
- Disable function inlining entirely, this allows for much easier hooking between engine and SDK code (the compiled code is now identical between engine and SDK, except that the SDK has all relevant security problems patched as per https://curl.se/docs/vuln-7.54.0.html).
- Enable buffer security checks to avoid potential remote attacks.
2023-06-17 01:07:07 +02:00
Kawe Mazidjatari
3f8baf6f68 Allow setting compile options for specific targets
Previously, it was all controlled from the global init (applied to all projects), but some projects need different options. With these changes, you can disable the common options applied in the 'add_module' macro, and set your own if desired.
2023-06-17 00:45:27 +02:00
Kawe Mazidjatari
c6f25432fd Undo ImGui shutdown patch, and add missing/reorder shutdown calls
The shutdown patch from commit '48c2401c' created another bug where all inputs get collated, and once drawn, emitted to the ImGui interfaces. The patch has been undone, and the 'ImGui_ImplDX11_Shutdown()' call has been placed before 'ImGui_ImplWin32_Shutdown()', as this was how it was performed according to the official documentation and examples provided by Dear ImGui. The call 'ImGui::DestroyContext()' has also been added (taken from the examples). Removed redundant static global bool.
2023-06-16 23:16:02 +02:00
Kawe Mazidjatari
2ad72b9f8f Improve ImGui shader string literals
Remove all useless indentation characters, change to static char array, use sizeof operator instead of strlen.
2023-06-16 23:11:42 +02:00
Kawe Mazidjatari
f6e6f834ce Enable cURL IPv6 2023-06-16 23:09:38 +02:00
Kawe Mazidjatari
48c2401cf9 Fix rare crash on Dear ImGui shutdown
Fix a rare crash that occurs in AMD driver code, when ImGui shutdown was called. The crash did not occur if the library was shutdown after having rendered one of the ImGui panels for one frame. The fix is to just never call 'ImGui_ImplDX11_NewFrame()', 'ImGui_ImplWin32_NewFrame()' and 'ImGui::NewFrame()', 'ImGui::EndFrame()', 'ImGui::Render()' if none of the windows are visible. code has been tested on a system that would trigger the crash, and after the patch, the crash no longer happened.
2023-06-15 21:33:37 +02:00
Kawe Mazidjatari
51ea9c7c4f CUserCmd hardening
Fix several exploitable bugs in the CUserCmd class. Some of these have been used to exploit/cheat in-game. Fixes contain:
- Camera position clamping (the only patch that hasn't been tested yet!)
- Weapon activity exploit, allowing player to infinitely throw ordnances, and perform other 'cheats'.
- Akimbo exploit + server crasher, allowing client to set multiple inventory weapons as active. The active weapon index bounds were also not checked, a properly crafter CUserCmd message would therefore be able to crash the server.

Note that this does not fix all issues related to the UserCmd class; further reversing and testing revealed there is more to be fixed, these fixes will get implemented with a future commit.
2023-06-13 17:43:32 +02:00
Kawe Mazidjatari
96ab1f1af0 Use explicit cast for CUtlBuffer ctor 2023-06-13 17:09:07 +02:00
Kawe Mazidjatari
4090757035 Fix CVE-2023-27533
Merge: curl/curl@538b1e79a6
2023-06-13 16:49:15 +02:00
Kawe Mazidjatari
1d570a82d8 Fix CVE-2022-43552
Merge: curl/curl@4f20188ac6
2023-06-13 16:18:00 +02:00
Kawe Mazidjatari
634a4739db Fix CVE-2022-32221
Merge: curl/curl@a64e3e5993
2023-06-13 15:35:04 +02:00
Kawe Mazidjatari
0cbdc982fd Fix CVE-2022-35252
Merge: curl/curl@8dfc93e573
2023-06-13 15:31:23 +02:00
Kawe Mazidjatari
e9ba4540cd Fix CVE-2022-27774
Merge: curl/curl@139a54ed0a
Note: protocol compare couldn't be added, as this would require adding a new member in the state structure, and therefore, break compatibility with the structures in the compiled executable (breaking the ability to hook any of its code). This fix should be sufficient however.
2023-06-13 13:02:04 +02:00
Kawe Mazidjatari
926a34dbbb Fix CVE-2022-22576
Merge: curl/curl@852aa5ad35
2023-06-13 12:20:54 +02:00
Kawe Mazidjatari
8b24c4f7d8 Fix CVE-2021-22947
Merge: curl/curl@8ef147c436
2023-06-13 12:08:13 +02:00
Kawe Mazidjatari
f545af934a Fix CVE-2021-22946
Merge: curl/curl@364f174724
2023-06-13 11:38:31 +02:00
Kawe Mazidjatari
9529519fa3 Fix CVE-2021-22925
Merge: curl/curl@894f6ec730
2023-06-13 11:30:39 +02:00
Kawe Mazidjatari
44650ac245 Fix CVE-2021-22898
Merge: curl/curl@39ce47f219
2023-06-13 09:47:07 +02:00
Kawe Mazidjatari
b7cca52067 Fix CVE-2021-22876
Merge: curl/curl@7214288898
Note: The 'CURLU' class does not exist in this particular version of curl, therefore, an alternative approach has been incorporated to mitigate the issue. Code has been tested, and the issue has been fixed.
2023-06-13 09:45:16 +02:00
Kawe Mazidjatari
d177ecdb0a Fix CVE-2020-8286
Merge: curl/curl@d9d0167278
2023-06-13 01:35:15 +02:00
Kawe Mazidjatari
c38a5f214f Fix CVE-2020-8285
Merge: curl/curl@69a358f218
Note: due to the many updates between the curl version this has been fixed in, and the one used in the SDK, the function was slightly different. The code has been tested however, after implementing the fix for this particular version of the library, the code appears to work perfectly with the vuln being fixed (tested on an FTP server with 10k files in the directory).
2023-06-13 00:38:35 +02:00
Kawe Mazidjatari
5a9711878b Fix CVE-2020-8284
Merge: curl/curl@ec9cc725d5
2023-06-12 22:26:53 +02:00
Kawe Mazidjatari
d10b544f74 Fix CVE-2020-8231
Merge: curl/curl@3c9e021f86
Note: Member order in 'connfind' has been left identical, except for that 'found' (now 'id_tofind') is a long. Code however, should pad it to a 4 byte boundary. Size of 'UrlState' has also remained unchanged, the 'connectdata' member has been renamed to 'lastconnect_id', and its type has been changed to 'long'. Additional padding has been incorporated to make sure the structure's size remains the same as that of the game, may we ever hook compiled code with ours.
2023-06-12 22:20:39 +02:00
Kawe Mazidjatari
0ac029e1c0 Fix CVE-2019-5481
Merge: curl/curl@9069838b30
2023-06-12 21:36:38 +02:00
Kawe Mazidjatari
0920fb834a Fix CVE-2019-5482
Merge: curl/curl@facb0e4662
2023-06-12 21:34:01 +02:00
Kawe Mazidjatari
5e68af6eb5 Fix CVE-2019-5436
Merge: curl/curl@2576003415
2023-06-12 21:22:22 +02:00
Kawe Mazidjatari
fa05fbd1aa Fix CVE-2018-16890
Merge: curl/curl@b780b30d13
2023-06-12 20:51:12 +02:00
Kawe Mazidjatari
52d8ef5719 Fix CVE-2019-3822
Merge: curl/curl@50c9484278
2023-06-12 20:48:21 +02:00
Kawe Mazidjatari
46f11218c6 Fix 'CVE-2019-3823'
Merge: curl/curl@39df4073e5
2023-06-12 20:44:02 +02:00
Kawe Mazidjatari
a022f81bc4 Fix 'CVE-2018-16839'
Merge: curl/curl@f3a24d7916
2023-06-12 20:37:57 +02:00
Kawe Mazidjatari
1e4843fda3 Fix 'CVE-2018-14618'
Merge: curl/curl@8c7b3737d2
2023-06-12 20:27:51 +02:00
Kawe Mazidjatari
6c34f8dc4e Fix 'CVE-2018-1000301'
Merge: curl/curl@8c7b3737d2
2023-06-12 20:17:01 +02:00
Kawe Mazidjatari
2aee31375f Fix 'CVE-2018-1000122'
Merge: curl/curl@d52dc4760f
2023-06-12 20:13:24 +02:00
Kawe Mazidjatari
6069e9f00b Fix 'CVE-2018-1000121'
Merge: curl/curl@9889db0433
2023-06-12 20:09:12 +02:00
Kawe Mazidjatari
2739ff3a7d Fix 'CVE-2018-1000120'
Merge: curl/curl@535432c0ad
2023-06-12 20:06:31 +02:00
Kawe Mazidjatari
f3b27f66bb Fix 'CVE-2018-1000007'
Merge: curl/curl@af32cd3859
2023-06-12 19:56:24 +02:00
Kawe Mazidjatari
2905bcad53 Fix 'CVE-2018-1000005'
Merge: curl/curl@fa3dbb9a14
2023-06-12 19:47:37 +02:00
Kawe Mazidjatari
d000c0c3b3 Fix 'CVE-2017-8817'
Merge: curl/curl@0b664ba968
2023-06-12 19:44:01 +02:00
Kawe Mazidjatari
e48b68e870 Fix 'CVE-2017-8816'
Merge: curl/curl@7f2a1df6f5
2023-06-12 19:36:18 +02:00
Kawe Mazidjatari
bc2a6ae586 Fix 'CVE-2017-1000257'
Merge: curl/curl@13c9a9ded3
2023-06-12 19:33:12 +02:00