πŸš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #79364

Re: About 480 and 502 codes

#79364
From: Russ Allbery
Date: Tue, 26 Aug 2008 07:43
64 lines
3829 bytes
Julien Γ‰LIE <iulius@nom-de-mon-site.com.invalid> writes:

> Thanks again for all your answers and having taken time to search for
> them.  I am sorry for those which are very clear in RFC; had I read the
> right paragraph, I would not have asked you questions on them.

Oh, it's quite okay.  One of the advantages of having been involved in the
working group is that I know where to look.  :)  I don't mind answering
questions like this at all.

> What happens with:
>
> AUTHINFO USER user
> 381
> AUTHINFO PASS pass
> 482

482 isn't a sensible return code here, since they were issued in
sequence.  This will either return 281 or 481.  I assume you meant 481.

> AUTHINFO PASS newpass
>
> Is the last AUTHINFO PASS command treated with the most recent AUTHINFO
> USER received, as said in RFC 4643?  Or should the cached username be
> reset on first AUTHINFO PASS failure?

I think the RFC isn't particularly clear here unless the return code is
281.  If it's 281, then this is an attempt to reauthenticate and should be
rejected as such.  If it's 481, then I think a reasonable interpretation
is a try with a different password, and there doesn't seem to be anything
saying that we can't retry with the stored username.

> Another question:
>
> AUTHINFO USER user
> 381 PASS required
> AUTHINFO PASS password
> 502 Authentication error
> Connection closed by foreign host.
>
> nnrpd currently closes the connection right after a failure.  Thus, the
> reader cannot try to authenticate a second time (RFC says it can try
> another times).  Should we change that behaviour?  Do you know why it
> was implemented this way?

Possibly to make it mildly more difficult to try brute force attacks on
the password.  However, we explicitly aren't allowed to do this.  RFC
3977, section 3.2.1:

      Note that the server MUST NOT close the connection immediately
      after a 502 response except at the initial connection
      (Section 5.1) and with the MODE READER command.

If we're going to close the client connection, I think we have to return
400, which isn't particularly appealing.  I'm inclined to say that we
should stop closing the connection here and just return failure and let
the client choose to continue unauthenticated or try again.  Closing the
connection isn't really providing much real brute force protection anyway.

-- 
Russ Allbery (rra@stanford.edu)             <http://www.eyrie.org/~eagle/>

          Please post questions rather than mailing me directly.
     <http://www.eyrie.org/~eagle/faqs/questions.html> explains why.
Technical Details
Message-ID: <87r68cgr21.fsf@windlord.stanford.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!news.stanford.edu!not-for-mail
References: <g8s5lo$7d1$1@news.trigofacile.com> <87prnxdged.fsf@windlord.stanford.edu> <g8thgh$84n$1@news.trigofacile.com> <87sksty31w.fsf@windlord.stanford.edu> <g8v5kh$i9d$1@news.trigofacile.com> <87vdxosfr5.fsf@windlord.stanford.edu> <g907e2$q5m$1@news.trigofacile.com>

Show Full Headers
Complete Article Headers
Message-ID: <87r68cgr21.fsf@windlord.stanford.edu>
Subject: Re: About 480 and 502 codes
Date: Tue, 26 Aug 2008 00:43:02 -0700
From: Russ Allbery <rra@stanford.edu>
References: <g8s5lo$7d1$1@news.trigofacile.com> <87prnxdged.fsf@windlord.stanford.edu> <g8thgh$84n$1@news.trigofacile.com> <87sksty31w.fsf@windlord.stanford.edu> <g8v5kh$i9d$1@news.trigofacile.com> <87vdxosfr5.fsf@windlord.stanford.edu> <g907e2$q5m$1@news.trigofacile.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.20141118.mbox.gz!border1.nntp.dca.giganews.com!nntp.giganews.com!newshub.sdsu.edu!headwall.stanford.edu!news.stanford.edu!not-for-mail
Newsgroups: news.software.nntp
Organization: The Eyrie
Lines: 64
NNTP-Posting-Host: windlord.stanford.edu
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: news.stanford.edu 1219736582 16508 171.64.19.147 (26 Aug 2008
X-Complaints-To: news@news.stanford.edu
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)
Cancel-Lock: sha1:/1FFlULHNQKo6Gc4l3FLOctMxr0=