You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@ant.apache.org by "Hans Lund (JIRA)" <ji...@apache.org> on 2008/07/04 11:41:49 UTC
[jira] Created: (IVY-854) Evil behavior form resolve latest.status:
performs DOS attacks
Evil behavior form resolve latest.status: performs DOS attacks
--------------------------------------------------------------
Key: IVY-854
URL: https://issues.apache.org/jira/browse/IVY-854
Project: Ivy
Issue Type: Bug
Components: Core
Affects Versions: 2.0.0-beta-2
Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
Reporter: Hans Lund
Ivy is extremely aggressive towards repositories . This can result in
resolving fails, even towards a healthy repository.
The symptom:
[ivy:resolve] 01-07-2008 13:16:24
org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
[ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
processing request: Address already in use: connect.
In effect this happens when Ivy has performed a successfully DOS attack against the repository.
This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Ernest Pasour (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12735587#action_12735587 ]
Ernest Pasour commented on IVY-854:
-----------------------------------
It appears that the problem we are experiencing right now is because of all the attempts to read non-existent directories using the ApacheURLLister class. When the connection attempts (and fails) to get the input stream, it is apparently enough to create a connection, but the connection is not cleaned up properly, even using the disconnect call. The code below reproduces the problem (on windows) if you put the proper data in the url definition. You will get the BindException after about 15 seconds. If you do a "netstat" from the command line, you will see lots of connections in the TIME_WAIT state.
I think Nascif's idea above makes sense to reduce the number of connections being made. I think it would also make sense to reduce the number of invalid URLs used. I hacked together some code to keep a hash of the shortest invalid urls and then not attempt to make connections when subsequent urls show up with an invalid prefix. This seems to work but I haven't really validated it yet. This idea could also be used in conjunction with Nascif's idea.
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.BindException;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
public class Test2 {
public static void main(String[] args) throws IOException {
for (int i=0;;i++)
{
URL url=new URL("http", "<your server>", 80, "<bad path on server>"); //shows problem
// URL url=new URL("http", "<your server>", 80, "<existing path on server>"); //works fine; does not leak connections
URLConnection conn=url.openConnection();
String htmlText = "";
try
{
BufferedReader r = new BufferedReader(new InputStreamReader(conn.getInputStream()));
}
catch (BindException e)
{
e.printStackTrace();
}
catch (IOException e)
{}
finally
{
if (conn instanceof HttpURLConnection)
{
((HttpURLConnection)conn).disconnect();
}
}
}
}
}
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
> Assignee: Maarten Coene
> Fix For: 2.0-RC1
>
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Nascif Abousalh-Neto (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12734783#action_12734783 ]
Nascif Abousalh-Neto commented on IVY-854:
------------------------------------------
I believe we are seeing the same issue on Ivy 2.0 final, will post more details soon.
I have to agree that the current design is very much a DOS attack on the server. Our scenario is very much as described above as well, large number of modules, with large number of revisions, and resolving for latest. We can easily get to thousands of connections created and destroyed in a resolve, and we are bumping into the Windows limitations described in http://support.microsoft.com/default.aspx?scid=kb;EN-US;196271. For continuous integration builds, this is a major issue.
I wonder if a different approach could be taken for the url resolver. Instead of releasing the connection on every download() and upload(), why not take advantage of HTTP 1.1 ability to keep connections open? You would go from thousands of connections per resolve to 1 - and it would be constant, instead of on the order of modules x versions x resolvers as it is today.
Since there is already a concept of locking in Ivy, it means there is a concept of transaction borders. You could use that to implement to setup and closing of the connection.
http://java.sun.com/j2se/1.5.0/docs/guide/net/http-keepalive.html
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
> Assignee: Maarten Coene
> Fix For: 2.0-RC1
>
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Xavier Hanin resolved IVY-854.
------------------------------
Resolution: Fixed
Fix Version/s: 2.0-RC1
Assignee: Maarten Coene
I mark this as fixed, with no fresh news on the fix. Feel free to reopen with more details if you encounter the same problem.
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
> Assignee: Maarten Coene
> Fix For: 2.0-RC1
>
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12616279#action_12616279 ]
Maarten Coene commented on IVY-854:
-----------------------------------
I've committed a new version of HttpClientHandler.java into SVN trunk.
Could you test it to see if it makes a difference?
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Maarten Coene (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610594#action_12610594 ]
Maarten Coene commented on IVY-854:
-----------------------------------
Which version of httpclient are you using?
Do you have the same problem if you don't use httpclient?
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (IVY-854) Evil behavior form resolve
latest.status: performs DOS attacks
Posted by "Xavier Hanin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/IVY-854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12627659#action_12627659 ]
Xavier Hanin commented on IVY-854:
----------------------------------
Any news on this Hans?
> Evil behavior form resolve latest.status: performs DOS attacks
> --------------------------------------------------------------
>
> Key: IVY-854
> URL: https://issues.apache.org/jira/browse/IVY-854
> Project: Ivy
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.0.0-beta-2
> Environment: windows xp sp2, linux fedora core 9, running Ivy repository through http for remote resolving and Hudson CI server (publishing to the repo).
> Reporter: Hans Lund
>
> Ivy is extremely aggressive towards repositories . This can result in
> resolving fails, even towards a healthy repository.
> The symptom:
> [ivy:resolve] 01-07-2008 13:16:24
> org.apache.commons.httpclient.HttpMethodDirector executeWithRetry
> [ivy:resolve] INFO: I/O exception (java.net.BindException) caught when
> processing request: Address already in use: connect.
> In effect this happens when Ivy has performed a successfully DOS attack against the repository.
> This is especially a problem when having large repositories (lost of revisions) and resolve against latest.status -> as this will fetch ivy.xml md5 and sha1 files for every revision.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.