Skip to content

Commit 5a2f7f4

Browse files
authored
Merge branch 'master' into chore/remove-commons-lang-2.6
2 parents fea13b1 + 12c2e2b commit 5a2f7f4

File tree

71 files changed

+3112
-1785
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+3112
-1785
lines changed

.github/comment-ops.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
commands:
2+
close:
3+
enabled: true
4+
reopen:
5+
enabled: true
26
label:
37
enabled: true
48
removeLabel:

.github/release-drafter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Configuration for Release Drafter: https://github.com/toolmantim/release-drafter
2-
_extends: .github
2+
_extends: github:jenkinsci/.github:/.github/release-drafter.yml
33
# We use the 2-digit versioning in Jenkins weekly releases.
44
version-template: $MAJOR.$MINOR
55
name-template: $NEXT_MINOR_VERSION

.github/workflows/announce-lts-rc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ jobs:
1010
if: ${{ github.repository_owner == 'jenkinsci' }}
1111
steps:
1212
- name: Post on Discourse
13-
uses: roots/discourse-topic-github-release-action@c30dc233349b7c6f24f52fb1c659cc64f13b5474 # v1.0.1
13+
uses: roots/discourse-topic-github-release-action@557d74ea05b6cc0c47f555c1d5d28a89d904005b # v1.1.0
1414
with:
1515
discourse-api-key: ${{ secrets.DISCOURSE_RELEASES_API_KEY }}
1616
discourse-base-url: https://community.jenkins.io/
1717
discourse-author-username: jenkins-release-bot
1818
discourse-category: 23
1919
- name: Post on mailing list
20-
uses: dawidd6/action-send-mail@ba302ba66e88942841281c984a6b31ca6d6289e6 # v11
20+
uses: dawidd6/action-send-mail@d38f3f7cd391cdebfe0d38efc3998b935e951c4f # v16
2121
with:
2222
server_address: smtp.gmail.com
2323
server_port: 465

.github/workflows/changelog.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ jobs:
2424
# Drafts your next Release notes as Pull Requests are merged into "master"
2525
- name: Generate GitHub Release Draft
2626
id: release-drafter
27-
uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0
28-
env:
29-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1
28+
with:
29+
token: ${{ secrets.GITHUB_TOKEN }}
3030
# Generates a YAML changelog file using https://github.com/jenkinsci/jenkins-core-changelog-generator
3131
# used by Oleg N in open graph generator experiment for now
3232
- name: Generate YAML changelog draft
3333
id: jenkins-core-changelog-generator
3434
uses: jenkinsci/core-changelog-generator@feb124ed2262f8586ac4561348436afb965812e1 # v2.2.2
35-
env:
36-
GITHUB_AUTH: github-actions:${{ secrets.GITHUB_TOKEN }}
35+
with:
36+
token: github-actions:${{ secrets.GITHUB_TOKEN }}
3737
- name: Upload Changelog YAML
3838
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
3939
with:
@@ -44,7 +44,7 @@ jobs:
4444
runs-on: ubuntu-latest
4545
if: github.repository_owner == 'jenkinsci'
4646
steps:
47-
- uses: actions/create-github-app-token@29824e69f54612133e76f7eaac726eef6c875baf # v2.2.1
47+
- uses: actions/create-github-app-token@f8d387b68d61c58ab83c6c016672934102569859 # v3.0.0
4848
id: generate-token
4949
with:
5050
app-id: ${{ secrets.JENKINS_CHANGELOG_UPDATER_APP_ID }}

.github/workflows/publish-release-artifact.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
wget -q https://get.jenkins.io/${REPO}/${PROJECT_VERSION}/${FILE_NAME}
7575
- name: Upload Release Asset
7676
id: upload-war
77-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
77+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
7878
env:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080
with:
@@ -109,7 +109,7 @@ jobs:
109109
- name: Upload Release Asset
110110
id: upload-deb
111111
if: always()
112-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
112+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
113113
env:
114114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
115115
with:
@@ -146,7 +146,7 @@ jobs:
146146
- name: Upload Release Asset
147147
id: upload-rpm
148148
if: always()
149-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
149+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
150150
env:
151151
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
152152
with:
@@ -182,7 +182,7 @@ jobs:
182182
- name: Upload Release Asset
183183
id: upload-msi
184184
if: always()
185-
uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b # v2.5.0
185+
uses: softprops/action-gh-release@153bb8e04406b158c6c84fc1615b65b24149a1fe # v2.6.1
186186
env:
187187
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
188188
with:

.github/workflows/require-changelog-label.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
issues: write
1313
pull-requests: write
1414
steps:
15-
- uses: mheap/github-action-required-labels@8afbe8ae6ab7647d0c9f0cfa7c2f939650d22509 # v5.5.1
15+
- uses: mheap/github-action-required-labels@0ac283b4e65c1fb28ce6079dea5546ceca98ccbe # v5.5.2
1616
with:
1717
mode: minimum
1818
count: 1

ath.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ set -o xtrace
66
cd "$(dirname "$0")"
77

88
# https://github.com/jenkinsci/acceptance-test-harness/releases
9-
export ATH_VERSION=6587.v2a_7493c89346
9+
export ATH_VERSION=6605.vef11d34eec91
1010

1111
if [[ $# -eq 0 ]]; then
1212
export JDK=21

bom/pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ THE SOFTWARE.
4141
<commons-fileupload2.version>2.0.0-M5</commons-fileupload2.version>
4242
<groovy.version>2.4.21</groovy.version>
4343
<jelly.version>1.1-jenkins-20250731</jelly.version>
44-
<stapler.version>2076.v1b_a_c12445eb_e</stapler.version>
44+
<stapler.version>2079.v5849a_9f19b_da_</stapler.version>
4545
</properties>
4646

4747
<dependencyManagement>
@@ -63,15 +63,15 @@ THE SOFTWARE.
6363
<dependency>
6464
<groupId>org.springframework</groupId>
6565
<artifactId>spring-framework-bom</artifactId>
66-
<version>6.2.16</version>
66+
<version>7.0.6</version>
6767
<type>pom</type>
6868
<scope>import</scope>
6969
</dependency>
7070
<dependency>
7171
<!-- https://docs.spring.io/spring-security/reference/6.3/getting-spring-security.html#getting-maven-no-boot -->
7272
<groupId>org.springframework.security</groupId>
7373
<artifactId>spring-security-bom</artifactId>
74-
<version>6.5.8</version>
74+
<version>7.0.4</version>
7575
<type>pom</type>
7676
<scope>import</scope>
7777
</dependency>
@@ -327,7 +327,7 @@ THE SOFTWARE.
327327
<!-- provided by jcl-over-slf4j -->
328328
<groupId>commons-logging</groupId>
329329
<artifactId>commons-logging</artifactId>
330-
<version>1.3.5</version>
330+
<version>1.3.6</version>
331331
<scope>provided</scope>
332332
</dependency>
333333
</dependencies>

core/src/main/java/hudson/AboutJenkins.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
package hudson;
22

3+
import edu.umd.cs.findbugs.annotations.CheckForNull;
34
import edu.umd.cs.findbugs.annotations.NonNull;
45
import hudson.model.ManagementLink;
56
import hudson.security.Permission;
67
import java.net.URL;
78
import jenkins.model.Jenkins;
89
import org.jenkinsci.Symbol;
910
import org.kohsuke.accmod.Restricted;
11+
import org.kohsuke.accmod.restrictions.DoNotUse;
1012
import org.kohsuke.accmod.restrictions.NoExternalUse;
1113

1214
/**
@@ -52,4 +54,15 @@ public Permission getRequiredPermission() {
5254
public Category getCategory() {
5355
return Category.STATUS;
5456
}
57+
58+
/**
59+
* Used to display subpages for plugin information.
60+
* @return the plugin with the given short name.
61+
*/
62+
@CheckForNull
63+
@Restricted(DoNotUse.class)
64+
public PluginWrapper getPlugin(String shortName) {
65+
Plugin plugin = Jenkins.get().getPlugin(shortName);
66+
return plugin != null ? plugin.getWrapper() : null;
67+
}
5568
}

core/src/main/java/hudson/FilePath.java

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,15 @@
213213
*/
214214
public final class FilePath implements SerializableOnlyOverRemoting {
215215

216+
/**
217+
* Set to {@code true} to disable validation to ensure that we do not attempt to extract paths that may allow determining the path to the destination directory.
218+
*/
219+
private static /* non-final for script console */ boolean ALLOW_REENTRY_PATH_TRAVERSAL = SystemProperties.getBoolean(FilePath.class.getName() + ".ALLOW_REENTRY_PATH_TRAVERSAL");
220+
/**
221+
* Set to {@code true} to disable the fix for SECURITY-3657 that prevents path traversal from crafted tar files.
222+
*/
223+
private static /* non-final for script console */ boolean ALLOW_UNTAR_SYMLINK_RESOLUTION = SystemProperties.getBoolean(FilePath.class.getName() + ".ALLOW_UNTAR_SYMLINK_RESOLUTION");
224+
216225
public enum DisplayOption implements OpenOption, CopyOption {
217226
IGNORE_TMP_DIRS
218227
}
@@ -3051,26 +3060,54 @@ private static void readFromTar(String name, File baseDir, InputStream in) throw
30513060
/**
30523061
* Reads from a tar stream and stores obtained files to the base dir.
30533062
* Supports large files &gt; 10 GB since 1.627.
3063+
* This prohibits any path traversal out of the base dir, as well as writing through any existing symlinks.
30543064
*/
30553065
private static void readFromTar(String name, File baseDir, InputStream in, Charset filenamesEncoding) throws IOException {
3056-
3066+
final File absoluteBaseDir = baseDir.getAbsoluteFile();
3067+
final Path normalizedAbsoluteBaseDir = absoluteBaseDir.toPath().normalize();
30573068
try (TarInputStream t = new TarInputStream(in, filenamesEncoding.name())) {
30583069
TarEntry te;
30593070
while ((te = t.getNextEntry()) != null) {
3060-
File f = new File(baseDir, te.getName());
3061-
if (!f.toPath().normalize().startsWith(baseDir.toPath())) {
3062-
throw new IOException(
3063-
"Tar " + name + " contains illegal file name that breaks out of the target directory: " + te.getName());
3071+
final String entryName = te.getName();
3072+
if (!ALLOW_REENTRY_PATH_TRAVERSAL) {
3073+
if (new File(entryName).toPath().normalize().startsWith(Path.of(".."))) {
3074+
// catch relative path that would escape and then enter the destination dir again, like `../../../var/jenkins_home/...`
3075+
throw new IOException("Tar " + name + " contains entry that escapes destination directory: " + entryName);
3076+
}
30643077
}
3078+
3079+
// We cannot replace 'f' with its canonical path here, otherwise, if it is a symlink, it becomes its link target and attempting to overwrite 'f' will have unintended behavior (JENKINS-67063)
3080+
File f = new File(baseDir, entryName).getAbsoluteFile();
3081+
File parent = f.getParentFile();
3082+
if (!f.toPath().normalize().startsWith(normalizedAbsoluteBaseDir)) {
3083+
// This covers both relative path traversal, and potential undefined File(String, String) constructor behavior when it takes a second argument that's absolute.
3084+
throw new IOException("Tar " + name + " contains entry that escapes destination directory: " + entryName);
3085+
}
3086+
3087+
if (!ALLOW_UNTAR_SYMLINK_RESOLUTION) {
3088+
// getCanonicalFile doesn't follow symlinks on Windows, so do this the hard way: Check each ancestor up to the base dir for whether it's a symlink
3089+
File current = parent;
3090+
while (current != null && !current.equals(absoluteBaseDir)) {
3091+
if (Util.isSymlink(current)) {
3092+
throw new IOException("Tar " + name + " attempts to write to file with symlink in path: " + entryName);
3093+
}
3094+
current = current.getParentFile();
3095+
}
3096+
}
3097+
30653098
if (te.isDirectory()) {
30663099
mkdirs(f);
30673100
} else {
3068-
File parent = f.getParentFile();
30693101
if (parent != null) mkdirs(parent);
30703102

30713103
if (te.isSymbolicLink()) {
30723104
new FilePath(f).symlinkTo(te.getLinkName(), TaskListener.NULL);
30733105
} else {
3106+
if (!ALLOW_UNTAR_SYMLINK_RESOLUTION) {
3107+
if (Util.isSymlink(f)) {
3108+
throw new IOException("Tar '" + name + "' entry '" + entryName + "' would write through existing symlink: " + f);
3109+
}
3110+
}
30743111
IOUtils.copy(t, f);
30753112

30763113
Files.setLastModifiedTime(Util.fileToPath(f), FileTime.from(te.getModTime().toInstant()));

0 commit comments

Comments
 (0)