Commit Graph
1448 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 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 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 bd4f6bcf4c merged back the RC branch 2014-03-03 06:58:15 -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
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
Jesse Glick f360ce3ee0 Javadoc for Queue.Task claimed they were compared using .equals(), but in critical cases this was not actually true.
Does not matter for the common case of Job, but when implementing custom tasks this could cause duplicate queue items (and executables).
2014-02-20 11:05:32 -05:00
Jesse Glick b2c69b4a35 Split RawHtmlMarkupFormatter into a bundled plugin (antisamy-markup-formatter).
https://trello.com/c/NvZt4WXu/15-rawhtmlmarkupformatter
2014-02-17 12:22:53 -05:00
Kohsuke Kawaguchi c88698c0af [JENKINS-21261] while I originally misdiagnosed the problem, the test is still marginally useful. 2014-02-14 18:29:21 -08:00
Kohsuke Kawaguchi bdd8ca3fe4 merged back the RC branch 2014-02-14 16:34:44 -08:00
Jesse Glick 724f9e0dfc Strengthening the reverse proxy admin monitor to detect nontransparent slash encoding (/ vs. %2F).
Apache in its default configuration botches this: http://stackoverflow.com/a/9933890/12916
2014-02-13 15:04:32 -05:00
Jesse Glick abc77438d2 Merge branch 'security' into security-rc
Conflicts:
	core/src/main/java/hudson/Functions.java
	core/src/main/java/hudson/markup/MyspacePolicy.java
	core/src/main/java/hudson/util/RobustReflectionConverter.java
	core/src/main/resources/lib/layout/layout.jelly
	war/pom.xml
2014-02-11 21:00:54 -05:00
Jesse Glick b6b2a367a7 [FIXED SECURITY-109] SECURITY-55 fix to BuildTrigger configuration failed if downstream project was not visible. 2014-02-11 14:22:46 -05:00
Jesse Glick bf53919856 [FIXED SECURITY-93] PasswordParameterDefinition should serve existing default value in encrypted form.
And strengthen functional tests (using configRoundTrip) to ensure that the same mistake is not made elsewhere.
2014-02-11 14:19:39 -05:00
Stefan Wolf be7a97ee32 [FIXED JENKINS-17606] Reuse existing fingerprint action if present.
Prevents multiple FingerprintActions.
2014-02-04 22:34:13 +01:00
CloudBees DEV@Cloud ef63ccac0a Merge commit 'cd526e99e63ae362f2d1ce1a04c3c68a38032a5c' 2014-02-04 16:35:04 +00:00
Jesse Glick cd526e99e6 [FIXED JENKINS-21023] Rewrote WorkspaceCleanupThread to determine where workspaces for known items should be, rather than looking for directories that look like they might be workspaces.
One key advantage is that this correctly handles the new default workspace location on the master.
Another is that this allows folders to be correctly skipped, and jobs in folders to be correctly deleted.
A subtler advantage would be handling of configured nondefault workspace locations, and compatibility with WorkspaceLocator.
(Orphaned workspaces from deleted jobs are not removed, but these were not removed before either.)
2014-02-04 11:34:14 -05:00