Repository navigation
fix(pluginfw): validate dependency names on plugin uninstall + 3.3.9 changelog - #8358
Merged
Merged
Conversation
GHSA-92hr-gmr6-h8cp validated plugin dependency names before they were used to build filesystem paths, but only on the install side. The uninstall side (removeSubDependency, uninstallDependency, unlinkSubDependency, unlinkDependency) still joined the raw package.json key onto pluginInstallPath / node_modules and passed it to rmSync({recursive, force}) or unlinkSync. A plugin declaring a dependency such as "zzz/../../../../tmp/x" with a GitHub-spec version got past live-plugin-manager, and uninstalling it deleted a directory outside the plugin folder. Move the name check into dependencyPath.ts, add a containment check (resolveDependencyPath) and use it at every uninstall/unlink sink. Names whose segments start with "." are now rejected as well. Reported by @baeseungwon1010 (GHSA-g9xm-3pqr-wcph). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013dDCHnxem1jJTYtTcY4Hqe
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5YroE8t1VhXCVTjJhx2kU
|
ⓘ Qodo reviews are paused because the subscription is no longer active. Ask your workspace admin to reactivate the subscription to resume reviews. Manage billing |
PR Summary by QodoPrevent path traversal during plugin uninstall
AI Description
Diagram
High-Level Assessment
Files changed (5)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can move or hide resolved findings to focus on what still needs action |
On Windows CI os.tmpdir() is on C: while the checkout is on D:, so no relative traversal path to the victim exists and the precondition assert failed. Create the victims next to the plugin folder instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Y5YroE8t1VhXCVTjJhx2kU
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes GHSA-g9xm-3pqr-wcph and adds the 3.3.9 CHANGELOG entry. It goes in ahead of the release.
GHSA-92hr-gmr6-h8cp added dependency-name checks to the plugin installer, but only on install. On uninstall,
uninstallDependency,removeSubDependency,unlinkSubDependencyandunlinkDependencystill passed the rawpackage.jsonkey tormSync/unlinkSync. A plugin with a dependency named likezzz/../../..could make an admin's uninstall delete a directory outside the plugin folder.All of these paths now go through
resolveDependencyPath()in the newpluginfw/dependencyPath.ts. It validates the name and checks that the resolved path stays inside the base directory. Invalid names are logged and skipped, and never fall back to the raw name.Reported by @baeseungwon1010.
Tests: new vitest unit tests for
dependencyPath, plus mocha regressions intests/backend/specs/LinkInstaller.tscovering uninstall, sub-dependency removal and unlink. The full vitest suite passes (842), and so does the LinkInstaller spec (7).🤖 Generated with Claude Code
https://claude.ai/code/session_01Y5YroE8t1VhXCVTjJhx2kU