Commit Graph
1993 Commits
Author SHA1 Message Date
Jesse Glick be06d6c4b8 Merge pull request #11 from jenkinsci-cert/SECURITY-162
[SECURITY-162] Forbid symlink attacks from artifact archiving
2015-02-07 11:25:08 -05:00
Robert Sandell 1887656c11 Merge pull request #9 from jenkinsci-cert/SECURITY-165
[SECURITY-165] blacklist the document xpath function for use in Api
2015-02-06 18:18:30 +01:00
Jesse Glick 1bba1ac3c6 [SECURITY-162] Capture the root directory in VirtualFile.forFile and reject attempts to escape it. 2015-02-06 11:37:24 -05:00
Robert Sandell 1629a93fbc Tidy up
Review comments fixed:
 Added license header
 Reformat the issue comment
 Restricted NoExternalUse
 toLowerCase in English locale
 lesser resolution of declared exception from the test
2015-02-06 10:34:41 +01:00
Jesse Glick 57d2b5382b Merge pull request #8 from jenkinsci-cert/testConfigureDownstreamProjectSecurity-RandomlyFails
@RandomlyFails
2015-02-05 21:27:55 -05:00
Jesse Glick b237a41af4 Also checking DirectoryBrowserSupport behavior, as in DirectoryBrowserSupportTest. 2015-02-05 18:42:54 -05:00
Jesse Glick b72246edb1 outsideSymlinks 2015-02-05 18:30:16 -05:00
Ryan Campbell 3e40c6fa00 Merge pull request #10 from jenkinsci-cert/SECURITY-166
[SECURITY-166] Make UI tests work across Jenkins versions
2015-02-05 16:39:50 -06:00
Jesse Glick a001f71ded Merge pull request #6 from jenkinsci-cert/SECURITY-125
[SECURITY-125] Matrix project script security
2015-02-05 15:44:47 -05:00
Ryan Campbell 29f59e42ae [SECURITY-166] Make UI tests work across Jenkins versions 2015-02-05 13:45:33 -06:00
Robert Sandell de4414cbf3 [SECURITY-165] blacklist the document xpath function for use in Api 2015-02-05 20:37:57 +01:00
James Nord 5564a62eb6 Merge pull request #7 from jenkinsci-cert/SECURITY-167_2
[SECURITY-167] Followup tweaks to address review comments.
2015-02-05 16:19:14 +00:00
Jesse Glick dff4beb641 @RandomlyFails 2015-02-05 10:09:08 -05:00
Ryan Campbell 1338e661aa Merge pull request #5 from jenkinsci-cert/SECURITY-166
Fixes for SECURITY-166
2015-02-05 08:44:51 -06:00
James Nord 1786daa514 [SECURITY-167] Followup tweaks to address review comments.
Addresses some comments received after the original fix was merged.
2015-02-05 14:36:29 +00:00
Jesse Glick 76ff1034a9 Avoid duplicate class conflict with core/src/test/java/hudson/model/AbstractItemTest.java. 2015-02-05 09:05:06 -05:00
James Nord 065c3b40d3 Merge pull request #4 from jenkinsci-cert/security-167
SECURITY-167

defend against XXE attacks in core https://issues.jenkins-ci.org/browse/SECURITY-167
2015-02-05 10:21:26 +00:00
Jesse Glick f987f9ce89 Need to test against the same version of matrix-project we bundle.
Otherwise FingerprinterTest.matrixDependency throws an AbstractMethodError.
2015-02-04 15:52:56 -05:00
Jesse Glick 075bd9b5b3 matrix-project 1.0-beta-1
(cherry picked from commit 9259f8736c)
2015-02-04 14:05:06 -05:00
Jesse Glick 92ca85339f Preparing to include transitional release.
(cherry picked from commit 071951e658)
2015-02-04 14:05:00 -05:00
Jesse Glick 9069428f0b Test harness must depend on matrix-project.
(cherry picked from commit b628b47285)
2015-02-04 14:04:52 -05:00
Jesse Glick 7d926f720e Removing hudson.matrix classes and associated resources as a first pass.
(cherry picked from commit 4aad749cbe)

Conflicts:
	core/src/main/java/hudson/matrix/MatrixBuild.java
	core/src/main/java/hudson/matrix/MatrixConfiguration.java
	core/src/main/java/hudson/matrix/MatrixProject.java
	core/src/main/resources/hudson/matrix/MatrixProject/configure-entries.jelly
2015-02-04 13:08:01 -05:00
Ryan Campbell 09c04e3b66 Resolve feedback on SECURITY-165 2015-02-04 09:36:16 -06:00
Ryan Campbell 01a087d127 [SECURITY-166] Prevent the creation of anonymous, system or unknown users.
These users can still be instantiated, as would happen if there is no security and an anonymous user triggers a build -- the anonymous user would correctly be created and added to the User list. This fix merely prevents the saving of that user, and therefore prevents them from logging in.

There may be some plugins which trigger a build as the SYSTEM user, and that is not prohibited here.

Also prevent full names of 'anonymous', 'system' or 'uknown'. As discussed on SECURITY-166 this may encumber auditing since full names are used in most places in the UI
2015-02-04 05:48:05 -06:00
James Nord 2a1b8542cb [SECURITY-167] fix failing unit test. 2015-02-03 18:31:52 +00:00
James Nord d6e14b1eca [SECURITY-167] defend against XXE attacks.
Added a new EntityResolver that will throw an exception if any attempts
are made to load external entities.
Made the transforer use SAX so that we can use out EntityResolover.

As we can't defend against calls that have already parsed the xml (e.g.
DOMSource) if we are parsed one of those throw an exception (which can be
disabled with a System property.
2015-02-03 13:52:46 +00:00
Jesse Glick 6dd9c8eb65 Merge branch 'security' into SECURITY-163 2015-01-13 14:25:43 -05:00
Jesse Glick fd430a3432 Do not redirectTestOutputToFile when we are running an individual test (suite or case).
In this case we are probably interested in looking at the output as it arrives in real time.
Can always be overridden on the command line if desired.
(cherry picked from commit 44a8ec1104)
2015-01-13 14:25:29 -05:00
Jesse Glick 03f047d801 Test failure. 2015-01-10 08:33:02 -05:00
Jesse Glick cc95634ddf Can get signatures from *.json.html. 2015-01-09 16:18:04 -05:00
Jesse Glick 6b71faccb9 Reproduced problem in a test. 2015-01-09 15:25:41 -05:00
Jesse Glick d00f7ab9b6 Removed DownloadSettings.checkSignature; back to using a plain system property for this.
(cherry picked from commit df9c92e461)
2015-01-09 15:16:44 -05:00
Jesse Glick 8311fb5c7f May as well use new DownloadService.loadJSON method here.
(cherry picked from commit 1c99cc1af0)
2015-01-09 15:16:44 -05:00
Jesse Glick 6c6e1751fe Deleting failing test updateDirectlyWithHtml.
loadJSON does not support parsing HTML.
Nor should it need to, since UC URLs are supposed to be to the JSONP file.
The .html extension is added automatically by downloadService when postBack is supported.
(cherry picked from commit d6b37a9457)

Conflicts:
	test/src/test/java/hudson/model/UpdateSiteTest.java
	test/src/test/resources/hudson/model/update-center.json.html
2015-01-09 15:16:38 -05:00
Jesse Glick 01ba28d0a2 Testing the loadJSON method directly to make sure various JSONP formats are handled.
(cherry picked from commit fb52414513)
2015-01-09 15:15:34 -05:00
Jesse Glick 33d88c015c [FIXED JENKINS-19081] Offer the option of downloading metadata directly from the server.
(cherry picked from commit 1ac77750e9)

Conflicts:
	core/src/main/java/hudson/model/DownloadService.java
	core/src/main/java/hudson/model/UpdateSite.java
2015-01-09 15:15:02 -05:00
Kohsuke Kawaguchi 857a229617 [maven-release-plugin] prepare for next development iteration 2014-03-09 22:51:51 -07:00
Kohsuke Kawaguchi 55eb795769 [maven-release-plugin] prepare release jenkins-1.554 2014-03-09 22:51:50 -07:00
Kohsuke Kawaguchi bd4f6bcf4c merged back the RC branch 2014-03-03 06:58:15 -08:00
Kohsuke Kawaguchi ddf1a5267c [maven-release-plugin] prepare for next development iteration 2014-03-02 23:04:12 -08:00
Kohsuke Kawaguchi 1f28286ee6 [maven-release-plugin] prepare release jenkins-1.553 2014-03-02 23:04:12 -08:00
Kohsuke Kawaguchi 7b0daade1f Timestamp has expired 2014-03-02 22:25:53 -08:00
Jesse Glick 00d27176f3 [FIXED JENKINS-22001] Simpler fix of JENKINS-19446 that does not introduce asynchronous behavior. 2014-02-28 14:34:29 -05:00
Jesse Glick 334ce1be69 [JENKINS-21984] Disabling cert check on updateDirectlyWithJson since the certificate is now expired, and it is no good to have a test which is known to start failing at a particular time in the future! 2014-02-28 10:45:38 -05:00
Jesse Glick c87b7daf79 [JENKINS-21984] Checking stable UC as well. Cannot reproduce certificate problem in test. 2014-02-28 10:44:55 -05:00
Jesse Glick ef474202e5 @RandomlyFails 2014-02-26 18:42:54 -05:00
Jesse Glick 7c568178f3 [FIXED JENKINS-21958] FilePath.copyRecursiveTo given a scanner including a symlink but not any regular file in the same directory would neglect to create the parent directory on the destination and thus not copy the link.
(Util.createSymlink is partly to blame for not throwing a descriptive IOException when it fails to create a link,
but this is its historical behavior needed for compatibility.
copyRecursiveTo also continues to suppress error text from this method because there is nowhere for it to go.
Perhaps need a new variant of createSymlink that is guaranteed to either have created the link or throw an exception.)
2014-02-26 10:13:39 -05:00
Kohsuke Kawaguchi 011f4ceca8 the trunk is toward 1.554-SNAPSHOT 2014-02-25 07:18:40 -08:00
Jesse Glick fdda9ca656 [FIXED JENKINS-16332] Ensure that User records are saved when the fullName is not recoverable from the id.
Otherwise User.get(id).getFullName() after restarting Jenkins will produce the wrong result.
2014-02-23 17:48:44 -05:00
Jesse Glick 3ec7e562fe Trying to diagnose recent CI failures of HtmlUnit calls.
For example https://jenkins.ci.cloudbees.com/job/core/job/jenkins-core-validated-merge/38/testReport/lib.layout/LayoutTest/rejectedLinks/ failed with:
java.io.IOException: GET http://localhost:52099/jenkins/login failed
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:152)
	at java.net.SocketInputStream.read(SocketInputStream.java:122)
	at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
	at java.io.BufferedInputStream.read(BufferedInputStream.java:254)
	at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
	at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
	at org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
	at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1413)
	at org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1973)
	at org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1735)
	at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
	at com.gargoylesoftware.htmlunit.HttpWebConnection.getResponse(HttpWebConnection.java:101)
	at com.gargoylesoftware.htmlunit.WebClient.loadWebResponseFromWebConnection(WebClient.java:1456)
	at com.gargoylesoftware.htmlunit.WebClient.loadWebResponse(WebClient.java:1387)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:328)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:389)
	at com.gargoylesoftware.htmlunit.WebClient.getPage(WebClient.java:374)
	at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:1944)
	at org.jvnet.hudson.test.JenkinsRule$WebClient.goTo(JenkinsRule.java:1926)
	at lib.layout.LayoutTest.rejectedLinks(LayoutTest.java:44)
which makes little sense since the named IOException is actually thrown from HttpWebConnection.java:130.
Perhaps Surefire is not reporting the original cause correctly, conflating the wrapper’s message with the original stack trace.
As a temporary measure, printing the original stack trace to stderr if there is any.
2014-02-23 16:57:05 -05:00