melib/nntp: accept invalid (non-ascii) address comment text #270

Merged
Manos Pitsidianakis merged 3 commits from fix/269-invalid-ctext-loop into master 2023-08-10 18:38:48 +03:00

NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.

Fixes #269.

NNTP servers may return addresses that are not RFC 5322 compliant. An address with a comment with non-ascii characters will make the parser loop indefinitely. Fixes #269.
Manos Pitsidianakis added 1 commit 2023-08-05 16:18:30 +03:00
2a079ee175 melib/nntp: accept invalid (non-ascii) address comment text
NNTP servers may return addresses that are not RFC 5322 compliant. An
address with a comment with non-ascii characters will make the parser loop indefinitely.

Fixes #269.

@epilys HI, I was able to pull this PR locally and cargo build,
the news.software.nntp etc does work now.
but the second issue is still there when I add more usenet groups I get the "Loading..." as I reported first.

some of the groups are:

[accounts.nntp_hispagatos.mailboxes]
"hispagatos.talk" = {}
"hispagatos.comunicados" = {}
"hispagatos.test" = {}
"alt.2600" = {}
"comp.infosystems.gemini" = {}
"news.groups.proposals" = {}
"news.announce.newgroups" = {}
"news.software.nntp" = {}
"rocksolid.feeds.news" = {}
"alt.computer.workshop" = {}
"news.software.readers" = {}
"news.groups.questions" = {}
"news.groups" = {}
"news.answers" = {}
"news.announce.newusers" = {}
"news.announce.important" = {}
"news.announce.conferences" = {}
"news.admin.technical" = {}
"news.admin.peering" = {}
"news.admin.net-abuse.usenet" = {}
"news.admin.moderation" = {}
"news.admin.misc" = {}
"news.admin.hierarchies" = {}
"news.admin.censorship" = {}
"news.admin.announce" = {}
"es.soc.consumidor" = {}
"es.rec.video.misc" = {}
"es.rec.musica.techno" = {}
"es.rec.juegos.rol" = {}
"es.comp.seguridad.so" = {}
"es.comp.seguridad.misc" = {}
"es.comp.os.unix" = {}
"es.comp.os.misc" = {}
"es.comp.os.linux.misc" = {}
"es.comp.os.linux.anuncios" = {}
"comp.os.linux.misc" = {}
"alt.cyberpunk.movement" = {}
"alt.cyberpunk" = {}
"alt.cybergoth" = {}
"comp.lang.c" = {}
"alt.anonymous" = {}
"alt.comp.linux" = {}
"alt.cypherpunks" = {}
"alt.privacy.anon-server" = {}
"comp.lang.misc" = {}
"comp.infosystems.gopher" = {}
"rocksolid.shared.i2p" = {}

It never loads any of the groups so can't tell which one is creating the bottleneck or if is just to many requests to the server etc...

Thanks

@epilys HI, I was able to pull this PR locally and cargo build, the news.software.nntp etc does work now. but the second issue is still there when I add more usenet groups I get the "Loading..." as I reported first. some of the groups are: ``` [accounts.nntp_hispagatos.mailboxes] "hispagatos.talk" = {} "hispagatos.comunicados" = {} "hispagatos.test" = {} "alt.2600" = {} "comp.infosystems.gemini" = {} "news.groups.proposals" = {} "news.announce.newgroups" = {} "news.software.nntp" = {} "rocksolid.feeds.news" = {} "alt.computer.workshop" = {} "news.software.readers" = {} "news.groups.questions" = {} "news.groups" = {} "news.answers" = {} "news.announce.newusers" = {} "news.announce.important" = {} "news.announce.conferences" = {} "news.admin.technical" = {} "news.admin.peering" = {} "news.admin.net-abuse.usenet" = {} "news.admin.moderation" = {} "news.admin.misc" = {} "news.admin.hierarchies" = {} "news.admin.censorship" = {} "news.admin.announce" = {} "es.soc.consumidor" = {} "es.rec.video.misc" = {} "es.rec.musica.techno" = {} "es.rec.juegos.rol" = {} "es.comp.seguridad.so" = {} "es.comp.seguridad.misc" = {} "es.comp.os.unix" = {} "es.comp.os.misc" = {} "es.comp.os.linux.misc" = {} "es.comp.os.linux.anuncios" = {} "comp.os.linux.misc" = {} "alt.cyberpunk.movement" = {} "alt.cyberpunk" = {} "alt.cybergoth" = {} "comp.lang.c" = {} "alt.anonymous" = {} "alt.comp.linux" = {} "alt.cypherpunks" = {} "alt.privacy.anon-server" = {} "comp.lang.misc" = {} "comp.infosystems.gopher" = {} "rocksolid.shared.i2p" = {} ``` It never loads any of the groups so can't tell which one is creating the bottleneck or if is just to many requests to the server etc... Thanks

@r3k2 thanks for giving me a list to test with! Will get on it asap.

@r3k2 thanks for giving me a list to test with! Will get on it asap.
Manos Pitsidianakis added 2 commits 2023-08-07 11:44:01 +03:00
c8abb15d78 melib/nntp: limit LIST ACTIVE command length to 512 octets
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

Sending a `LIST ACTIVE` command with lots of newgroups and passing the
512 byte limit is therefore invalid. This commit splits the mailboxes in
chunks and sends a separate command for each maximal chunk that has
a valid length.

Fixes #269.

Reported-by: r3k2
Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (push) Failing after 8m11s Details
b603524bc3
melib/nntp: log error when command length exceeds 512 octets
According to RFC 3977:

> Command lines MUST NOT exceed 512 octets, which includes the
> terminating CRLF pair

This commit adds a log::error entry when any sent command exceeds that
limit and recommends the user to report this as a bug.

@epilys Thanks! I just finished patching this PR and testing, this seems to be working great, some groups take some time to finish but that is ok. PD: wondering how to do a mark all as read need to read the docs more. :)

@epilys Thanks! I just finished patching this PR and testing, this seems to be working great, some groups take some time to finish but that is ok. PD: wondering how to do a mark all as read need to read the docs more. :)

Great, will merge in a few days because I'm away from home and I don't have access to my GPG key to sign the commits.

Great, will merge in a few days because I'm away from home and I don't have access to my GPG key to sign the commits.
Manos Pitsidianakis force-pushed fix/269-invalid-ctext-loop from b603524bc3 to 448e0635e0 2023-08-10 18:38:27 +03:00 Compare
Manos Pitsidianakis merged commit 448e0635e0 into master 2023-08-10 18:38:48 +03:00
Manos Pitsidianakis deleted branch fix/269-invalid-ctext-loop 2023-08-10 18:38:48 +03:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: meli/meli#270
There is no content yet.