Potential fix for code scanning alert no. 10: Uncontrolled command line - #57
Closed
Ritual-Dev-Git wants to merge 1 commit into
Closed
Ritual-Dev-Git wants to merge 1 commit into
Ritual-Dev-Git wants to merge 1 commit into
Conversation
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Contributor
🛡️ DevShelf PR Validation Report
|
| File | Resource | Field | Issue |
|---|---|---|---|
ai-tools.json |
Promptfoo | description |
Description contains placeholder or incomplete text. |
🔄 Duplicate Detection Warnings
| Incoming Resource | Target URL | Existing Match | Existing File | Match Type |
|---|---|---|---|---|
| Vercel | Link | Vercel for Open Source | perks.json |
same_domain |
| Netlify | Link | Netlify for Open Source | perks.json |
same_domain |
| MongoDB Atlas | Link | MongoDB for Startups | perks.json |
same_domain |
Note: If this tool is an entirely new separate product hosted on the same domain, please leave a comment explaining why.
💡 Tip: You can use the DevShelf Contribution Wizard to generate error-free JSON.
🤖 DevShelf AI-Driven PR Optimization & Tagging
Automated Heuristic Analyzer • Add
GEMINI_API_KEYfor LLM enhancement.
📦 Resource: Open-Meteo
- Target File:
shelf/apis.json - Suggested Category:
Weather & Climate.json - Recommended Tags:
[100% Free Tier][No Auth Required]
📝 Description Refinement
- Original: "Free weather forecast API for commercial and non-commercial use with hourly forecasts and historical weather data."
- ✨ Suggested: "Free weather forecast API for commercial and non-commercial use with hourly forecasts and historical weather data."
📋 Ready-to-Merge JSON Block
{
"name": "Open-Meteo",
"url": "https://open-meteo.com",
"category": "Weather & Climate",
"description": "Free weather forecast API for commercial and non-commercial use with hourly forecasts and historical weather data.",
"auth": "No Key",
"cors": "Yes",
"rateLimit": "10,000 req/day",
"https": true,
"statusTags": [
"[100% Free Tier]",
"[No Auth Required]"
],
"section": "Weather & Climate"
}💡 Contributors can copy the JSON block above directly into their PR to ensure pristine catalog formatting.
Comment on lines
+49
to
+53
| const child = spawn(process.env.comspec || "cmd.exe", ["/c", "start", "", url], { | ||
| detached: true, | ||
| stdio: "ignore", | ||
| shell: false, | ||
| }); |
Ritual-Dev-Git
marked this pull request as ready for review
October 2, 2026 11:38
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.
Potential fix for https://github.com/RitualDev-Lab/DevShelf/security/code-scanning/10
The safest fix is to stop using
child_process.execwith a concatenated command string and instead usechild_process.spawn(orexecFile) with argument arrays andshell: false. This prevents shell interpretation of attacker-controlled characters.In
bin/cli.js, update the import at line 16 fromexectospawn, and rewriteopenUrl(url)(lines 45–54) to invoke platform-specific executables with argument arrays:spawn("open", [url], { shell: false, detached: true, stdio: "ignore" })spawn("xdg-open", [url], ...)cmd.exe /c start "" <url>viaspawn(process.env.comspec || "cmd.exe", ["/c", "start", "", url], { shell: false, ... })so the shell is not spawned by Node directly throughexecand no interpolated shell string is built.Also detach and
unref()to preserve the current non-blocking CLI behavior.Suggested fixes powered by Copilot Autofix. Review carefully before merging.