Skip to content

CVE-2026-24842 node-tar: Vulnerable to Arbitrary File Creation/Overwrite via Hardlink Path Traversal - #648

Merged
sbouchet merged 12 commits into
che-incubator:mainfrom
sbouchet:CVE-2026-24842
Mar 5, 2026
Merged

sbouchet merged 12 commits into
che-incubator:mainfrom
sbouchet:CVE-2026-24842

Conversation

@sbouchet

@sbouchet sbouchet commented Feb 4, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

This PR fixes GHSA-34x7-hfp2-rc4v : Vulnerable to Arbitrary File Creation/Overwrite via Hardlink Path Traversal.
tar version is updated to 7.5.8

What issues does this PR fix?

https://issues.redhat.com/browse/CRW-10039
https://issues.redhat.com/browse/CRW-10249

also
fixes https://github.com/che-incubator/che-code/security/dependabot/6
fixes https://github.com/che-incubator/che-code/security/dependabot/58
fixes https://github.com/che-incubator/che-code/security/dependabot/62
fixes https://github.com/che-incubator/che-code/security/dependabot/7
fixes https://github.com/che-incubator/che-code/security/dependabot/4
fixes https://github.com/che-incubator/che-code/security/dependabot/54
fixes https://github.com/che-incubator/che-code/security/dependabot/5
fixes https://github.com/che-incubator/che-code/security/dependabot/57
fixes https://github.com/che-incubator/che-code/security/dependabot/45
fixes https://github.com/che-incubator/che-code/security/dependabot/44

How to test this PR?

Does this PR contain changes that override default upstream Code-OSS behavior?

  • the PR contains changes in the code folder (you can skip it if your changes are placed in a che extension )
  • the corresponding items were added to the CHANGELOG.md file
  • rules for automatic git rebase were added to the .rebase folder

@github-actions

github-actions Bot commented Feb 4, 2026 •

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

3 similar comments
@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Feb 4, 2026

Copy link
Copy Markdown
Contributor

@sbouchet
sbouchet marked this pull request as ready for review February 5, 2026 13:55

@RomanNikitenko RomanNikitenko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is fixed from the security point of view.

I just noticed that [email protected] requires [email protected],
but we override it to 7.5.7

2.2.2 => 7.5.7 = too big difference = some risk

At the same time [email protected] was published 8 years ago, so no chance to get it updated to fix the problem. So, only replacing gulp-untar by another dependency could be an alternative solution...

@sbouchet

Copy link
Copy Markdown
Collaborator Author

The problem is fixed from the security point of view.

I just noticed that [email protected] requires [email protected], but we override it to 7.5.7

2.2.2 => 7.5.7 = too big difference = some risk

At the same time [email protected] was published 8 years ago, so no chance to get it updated to fix the problem. So, only replacing gulp-untar by another dependency could be an alternative solution...

one possible solution might be to use https://www.npmjs.com/package/gulp-decompress

@RomanNikitenko

Copy link
Copy Markdown
Collaborator

@sbouchet
I haven’t looked into this in depth and I’m not sure how many changes are needed, so I’ll rely on your expertise.

via Hardlink Path Traversal

Signed-off-by: Stephane Bouchet <[email protected]>
Signed-off-by: Stephane Bouchet <[email protected]>
Signed-off-by: Stephane Bouchet <[email protected]>
Signed-off-by: Stephane Bouchet <[email protected]>
@sbouchet

sbouchet commented Feb 18, 2026 •

Copy link
Copy Markdown
Collaborator Author

npm audit says :

tar  <7.5.8
Severity: high
Arbitrary File Read/Write via Hardlink Target Escape Through Symlink Chain in node-tar Extraction - https://github.com/advisories/GHSA-83g3-92jg-28cx
fix available via `npm audit fix --force`
Will install @vscode/[email protected], which is a breaking change
node_modules/tar
  @vscode/sqlite3  5.1.2-vscode || 5.1.3-vscode - 5.1.11-vscode
  Depends on vulnerable versions of tar
  node_modules/@vscode/sqlite3

so i'll rework this PR to bump to at least 7.5.8
advisory GHSA-83g3-92jg-28cx
jira https://issues.redhat.com/browse/CRW-10249

@github-actions

Copy link
Copy Markdown
Contributor

@sbouchet

Copy link
Copy Markdown
Collaborator Author

forgot to add rebase rules for source code. please wait for PR to be ready for review

@sbouchet
sbouchet marked this pull request as draft February 18, 2026 15:28
Signed-off-by: Stephane Bouchet <[email protected]>
@sbouchet
sbouchet marked this pull request as ready for review February 18, 2026 16:59
@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

@github-actions

Copy link
Copy Markdown
Contributor

Comment thread code/package.json Resolved
Comment thread code/package.json Resolved
@github-actions

github-actions Bot commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Signed-off-by: Stephane Bouchet <[email protected]>
@RomanNikitenko

Copy link
Copy Markdown
Collaborator

@sbouchet
changes look good to me
please prepare backport-PR

@github-actions

github-actions Bot commented Mar 5, 2026

Copy link
Copy Markdown
Contributor

@sbouchet
sbouchet merged commit a5e1e0f into che-incubator:main Mar 5, 2026
13 checks passed
@sbouchet
sbouchet deleted the CVE-2026-24842 branch March 5, 2026 15:25
gulp.src('*.tgz', { cwd: dir })
.pipe(gunzip())
.pipe(untar())
.pipe(decompress())

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sbouchet
I think we have a problem here
I don't see decompress() function was imported

const acquireBuiltOpenSSL = (callback) => {
const untar = require('gulp-untar');
const gunzip = require('gulp-gunzip');
const untar = require('gulp-decompress');

@RomanNikitenko RomanNikitenko Mar 13, 2026 •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is untar used?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you mean decompress?

function nodejs(platform, arch) {
const { fetchUrls, fetchGithub } = require('./lib/fetch');
const untar = require('gulp-untar');
const untar = require('gulp-decompress');

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is also not working :

$ node ./node_modules/gulp/bin/gulp.js node-linux-x64
[16:50:00] Using gulpfile ~/git/che-code/code/gulpfile.js
[16:50:00] Starting 'node-linux-x64'...
[16:50:00] Downloading node.js 22.18.0 linux x64 from https://nodejs.org...
[16:50:00] Using SHA256 checksum for checking integrity: a2e703725d8683be86bb5da967bf8272f4518bdaf10f21389e2b2c9eaeae8c8a
[16:50:00] 'node-linux-x64' errored after 13 ms
[16:50:00] ReferenceError: decompress is not defined
    at nodejs (/home/sbouchet/git/che-code/code/build/gulpfile.reh.js:240:6)
    at /home/sbouchet/git/che-code/code/build/gulpfile.reh.js:176:11
    at taskWrapper (/home/sbouchet/git/che-code/code/node_modules/undertaker/lib/set-task.js:13:15)
    at bound (node:domain:433:15)
    at runBound (node:domain:444:12)
    at asyncRunner (/home/sbouchet/git/che-code/code/node_modules/async-done/index.js:55:18)
    at process.processTicksAndRejections (node:internal/process/task_queues:85:11)

@sbouchet

Copy link
Copy Markdown
Collaborator Author

@RomanNikitenko for all above reviews, i've created #666 and backport #665

RomanNikitenko pushed a commit that referenced this pull request Aug 22, 2026
Reverts the gulp-decompress introduction from #648/#666 and realigns
with upstream VS Code's own solution: gunzip + untar() backed by
tar.Parser. This removes the vulnerable [email protected] (CVE-2026-53486,
CVSS 9.1) while keeping the tar@^7.5.22 pin for GHSA-34x7-hfp2-rc4v.

Signed-off-by: Stephane Bouchet <[email protected]>
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants