-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
upgrade commons-net to 3.10.0 due to cve #171
Conversation
so far, this is causing problems with org.apache.pekko.stream.connectors.ftp.FtpsWithProxyStageTest like this one:
|
test issue possibly caused by changes https://issues.apache.org/jira/browse/NET-642 - see https://issues.apache.org/jira/browse/NET-718 |
8fb8d43
to
f036083
Compare
Since https://issues.apache.org/jira/browse/NET-718 is not making progress - I have brought the old working code from commons-net 3.8.0 into my PR. Aim is to add a config setting that lets users choose to use the latest commons-net FTPSClient or to use the legacy one. The legacy one will be default since we know that that works with our tests - while the change in commons-net has no tests but theoretically fixes issues for some users (https://issues.apache.org/jira/browse/NET-642) |
lgtm |
experiment to see if we relay on this dangerous option in the broken tests try a different type of proxy for FTPS (plain HTTP seems strange) Update FtpsWithProxyStageTest.java Update BaseFtpSupport.java Update BaseFtpSupport.java
00d2456
to
4aa4b04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm
* initialization of the connection. | ||
* @throws IOException If there is any problem with the connection. | ||
* @see FTPClient#_openDataConnection_(int, String) | ||
* @deprecated (3.3) Use {@link FTPClient#_openDataConnection_(FTPCmd, String)} instead |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we adopt the @SInCE version in this file ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary copy of the commons-net code. We can remove it when commons-net 3.11.0 is released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code is not public - ie the class is not public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a temporary copy of the commons-net code. We can remove it when commons-net 3.11.0 is released.
How serious is this cve, can we just wait until commens-net 3.11.0 is released?
If it's that critical I would have assumed that commons-net 3.11.0 would be out by now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commons-net have assigned severity 'low' to it, NVD a 6.5 medium.
the problem was actually fixed in 3.9.0. 3.11.0 is not the fix but adds apache/commons-net#204 which apparently makes it easier to adopt this newer version in pekko-connectors
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this, doesn't it just make sense to wait till 3.11.0 is released rather than prematurely rushing to inline the code now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that there is a CVE in the SFTP code of commons-net, fixed in v3.9.0. Unfortunately, commons-net 3.9.0 also includes a change in the FTPS code. The contributor and some other commenters claimed that it fixed FTPS via proxy for them - without providing evidence or a test case. The equivalent test case in Akka/Pekko (FTPS via proxy) fails with the change. So this code copies in the old FTPS code and lets Pekko users choose if they want the old or new FTPS code. I submitted a fix for commons-net 3.11.0 that allows the old code to be shorter because it can extend the commons-net FTPSClient. It can't extend the commons-net FTPSClient in commons-net 3.10.0 because too much state is private. I can provide a patch to Pekko Connectors when commons-net 3.11.0 is released (which is not yet under discussion afaik).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay let me look into this in more detail then, I was just skimming the PR beforehand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I have read about the context of this PR, I have no problem with retaining the legacy client and set as default. But I have a question that will not block this PR, that is, the new FTPClient
will not work under the proxy settings. Is this limited to testing or general? Should we mention it in the document or the release notes?
We will include release notes describing the new setting that controls whether to use the legacy or the new FTPS Client. |
I logged #465 as a follow up |
see #169
Remaining work