server -> znc PONG with missing (optional) prefix is not correctly filtered by znc #725

Closed
opened 2026-10-05 04:41:06 +02:00 by adam · 1 comment
Owner
23:55 <*status> ZNC 1.6.3 - http://znc.in
23:55 <*status> IPv6: yes, SSL: yes, DNS: threads, charset: no

When connecting to irc.gitter.im via znc 1.6.3, I see PONG messages on my irc client connection (weechat 1.5).

23:23    znc_g     │ PONG
23:24    znc_g     │ PONG
23:25    znc_g     │ PONG
23:26    znc_g     │ PONG
23:27    znc_g     │ PONG
23:28    znc_g     │ PONG

This issue was observed when connecting to the irc.gitter.im bridge service. It affects znc 1.6.3 and apparently other older versions. See GitterHQ/irc-bridge#34 for some discussion of the problem.

@RealKindOne has observed that this issue is fixed in znc master branch so this issue is only useful for a bug-fix release of 1.6.x. The bug is avoided in master since the message parsing code in Message.cpp deals with the omitted prefix and correctly identifies the command as PONG.

The GitterHQ/irc-bridge code generates what looks like a valid, but atypical, PONG message which znc fails to suppress on the way to the client. The gitterHQ code should probably be fixed but arguably this is a bug in the 1.6.x branch of znc. You can see the PONG generation code in the irc-bridge code here

I think the znc bug is here: https://github.com/znc/znc/blob/znc-1.6.3/src/IRCSock.cpp#L148

  • It makes the assumption that the command "PONG" will be the 2nd token (Token(1)) on the line
  • That's normally true of most irc servers since they include a prefix (ie. line starts with ":server.domain PONG")
  • The gitter server doesn't include the (optional) prefix so the message is exactly "PONG :irc.gitter.im"
  • znc 1.6.3 doesn't recognize that as a PONG and then it fails to suppress it toward the client

``` 23:55 <*status> ZNC 1.6.3 - http://znc.in 23:55 <*status> IPv6: yes, SSL: yes, DNS: threads, charset: no ``` When connecting to irc.gitter.im via znc 1.6.3, I see PONG messages on my irc client connection (weechat 1.5). ``` 23:23 znc_g │ PONG 23:24 znc_g │ PONG 23:25 znc_g │ PONG 23:26 znc_g │ PONG 23:27 znc_g │ PONG 23:28 znc_g │ PONG ``` This issue was observed when connecting to the irc.gitter.im bridge service. It affects znc 1.6.3 and apparently other older versions. See GitterHQ/irc-bridge#34 for some discussion of the problem. @RealKindOne has observed that this issue is fixed in znc master branch so this issue is only useful for a bug-fix release of 1.6.x. The bug is avoided in master since the message parsing code in Message.cpp deals with the omitted prefix and correctly identifies the command as PONG. The GitterHQ/irc-bridge code generates what looks like a valid, but atypical, PONG message which znc fails to suppress on the way to the client. The gitterHQ code should probably be fixed but arguably this is a bug in the 1.6.x branch of znc. You can see the PONG generation code in the irc-bridge code [here](https://github.com/gitterHQ/irc-bridge/blob/master/lib/client.js#L66) I think the znc bug is here: https://github.com/znc/znc/blob/znc-1.6.3/src/IRCSock.cpp#L148 - It makes the assumption that the command "PONG" will be the 2nd token (Token(1)) on the line - That's normally true of most irc servers since they include a prefix (ie. line starts with ":server.domain PONG") - The gitter server doesn't include the (optional) prefix so the message is exactly "PONG :irc.gitter.im" - znc 1.6.3 doesn't recognize that as a PONG and then it fails to suppress it toward the client ## <!-- github-sync-id:179135108 -->
adam closed this issue 2026-10-05 04:41:06 +02:00
Author
Owner

Thanks for fixing this @DarthGandalf.

Thanks for fixing this @DarthGandalf. <!-- github-comment-id:261796088 -->
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/znc#725