Commit Graph
6 Commits
Author SHA1 Message Date
Alhuda Khan d5375e58f8 bouncedcc: only let the user's own clients connect to an IRC-originated bounce
When the DCC request came from IRC, ZNC connects out to the remote peer
and the thing connecting to the bounce listener should be one of the
user's clients. In GetSockObj, compare the connecting address with the
remote IP of each currently connected client and refuse anyone else,
closing the accepted socket straight away while leaving the listener up
for the real client. The user-originated path is unchanged, since there
it is the remote IRC peer that is expected to connect.
2026-10-23 13:00:06 +05:30
Alhuda Khan 8aef9873fc bouncedcc: refuse DCC requests from IRC aimed at loopback or link-local
The address in an incoming DCC CHAT/SEND is chosen by the remote IRC
user, and ZNC is the side that connects to it, relaying traffic to
whoever connects to the bounce listener. Refuse requests that point at
0/8, 127/8, 169.254/16, 224/3 or values above 32 bits (which
CUtils::GetIP would otherwise mask down to one of those).
2026-10-20 17:36:19 +05:30
Alhuda Khan 71dd0e0f88 zncstring: use openssl RAND_bytes for RandomString when available 2026-10-18 12:22:56 +05:30
Alhuda Khan 5916955b80 zncstring: generate RandomString with a CSPRNG instead of rand() 2026-10-14 15:10:53 +05:30
Alhuda Khan 16908dc4aa utils: fix size_t underflow in FormatTime %f padding 2026-10-14 11:32:00 +05:30
Alhuda Khan 942e458bf5 cast to unsigned char for ctype calls on signed-char input 2026-10-11 23:54:28 +05:30