-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: [M3-7277] - SAST Scan Findings: Path Traversal Vulnerability v2 #11914
refactor: [M3-7277] - SAST Scan Findings: Path Traversal Vulnerability v2 #11914
Conversation
4a30223
to
0b72d9b
Compare
0b72d9b
to
5f13994
Compare
// Logic to parse the changeset file and generate the changelog content | ||
const filePath = path.join(changesetDirectory(linodePackage), file); | ||
const filePath = changesetDirectory(linodePackage) + path.sep + file; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semgrep specifically flags the use of path.join()
with variables at runtime, however this approach should still be safe since changesetDirectory()
returns pre-validated paths created at initialization. path.sep
is used for cross-platform compatibility for path constructions b/t Windows vs Unix.
Cloud Manager UI test results🎉 533 passing tests on test run #5 ↗︎
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description 📝
This PR addresses path traversal vulnerabilities identified by SAST security scanning.
Changes 🔄
manager/scripts/
directorypath.sep
for cross-platform compatibilityPreview 📷
Prerequisites
semgrep
if not already installed withpip install semgrep
Verification steps
semgrep --config=p/default scripts/changelog/utils/constants.mjs scripts/changelog/utils/deleteChangesets.mjs scripts/changelog/generate-changelogs.mjs scripts/package-versions/index.js
- the output should say "Findings: 0 (0 blocking)".generate-changelog
script still works as expected. Runpnpm run generate-changelogs
and you should see an addedCHANGELOG.md
file added and existing changeset files in.changeset/
directories are deleted.package-versions
script still works as expected. Runpnpm run package-versions
and look for package info output in terminal.Author Checklists
As an Author, to speed up the review process, I considered 🤔
👀 Doing a self review
❔ Our contribution guidelines
🤏 Splitting feature into small PRs
➕ Adding a changeset
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support
As an Author, before moving this PR from Draft to Open, I confirmed ✅