Federico Mariani created CAMEL-27031:
----------------------------------------

             Summary: camel-mina-sftp - a rejected login is retried 
maximumReconnectAttempts times, so a wrong password is sent 3 to 6 times per 
poll
                 Key: CAMEL-27031
                 URL: https://issues.apache.org/jira/browse/CAMEL-27031
             Project: Camel
          Issue Type: Bug
          Components: camel-mina-sftp
            Reporter: Federico Mariani


With a wrong password, the mina-sftp consumer sends the password 3 times per 
poll, and 6 times when the server offers both the {{password}} and the 
{{keyboard-interactive}} methods. {{MinaSftpOperations.tryConnect}} catches any 
{{IOException}}, including the one that {{session.auth().verify()}} throws when 
the server rejects the login, so {{connect}} opens a new session for each of 
the {{maximumReconnectAttempts}} (3). With {{autoCreate=true}} the consumer 
also connects when it starts, which adds the same count once. Each rejected 
login counts towards the lockout policy of a server, such as one that locks the 
account after a few failures.

{code:java}
from("mina-sftp://localhost:2222/inbox?username=admin&password=wrong&autoCreate=false&delay=1000";)
    .to("mock:result");
{code}

The passwords that an Apache SSHD server checks, with this route:
||Methods of the server||autoCreate||after poll 1||after poll 2||
|password|false|3|6|
|keyboard-interactive|false|3|6|
|password, keyboard-interactive|false|6|12|
|password, keyboard-interactive|true|12|18|

Expected: a rejected login ends the reconnect attempts, which still apply to 
the other connection failures, as CAMEL-27019 does for camel-sftp. With the 
fix, decide whether the password is also given once per session when the server 
offers both methods (CAMEL-27019 gives it once per connection in camel-sftp).

_Claude Code on behalf of Federico Mariani_




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to