Harden workflows and server paths/output to resolve Code Scanning alerts #76–#100 - #3
Draft
kerrrang9214-tech with Copilot wants to merge 2 commits into
Draft
Harden workflows and server paths/output to resolve Code Scanning alerts #76–#100#3kerrrang9214-tech with Copilot wants to merge 2 commits into
kerrrang9214-tech with Copilot wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
6 tasks
Co-authored-by: kerrrang9214-tech <242015866+kerrrang9214-tech@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code scanning alerts #76 to #100
Harden workflows and server paths/output to resolve Code Scanning alerts #76–#100
Aug 26, 2026
There was a problem hiding this comment.
🟡 Changes recommended
A few security/ops hardening details still need adjustment (CRLF log sanitization, consistent path passed to dir listing generation, and workflow permissions likely needed for caching).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 6/6 changed files
- Comments generated: 3
- Review effort level: Lite
Comment on lines
+84
to
+86
| const requestPath = decodeURIComponent(new URL(req.url, 'http://localhost').pathname); | ||
| const filePath = path.resolve(STATIC_DIR, `.${requestPath}`); | ||
| if (filePath !== STATIC_DIR && !filePath.startsWith(`${STATIC_DIR}${path.sep}`)) { |
Comment on lines
+50
to
+52
| permissions: | ||
| contents: read | ||
|
|
| this.handle_user_submit(this.curChatId, gMe.apiEP).catch((/** @type{Error} */reason)=>{ | ||
| let msg = `ERRR:SimpleChat\nMCUI:HandleUserSubmit:${this.curChatId}\n${reason.name}:${reason.message}`; | ||
| console.error(msg.replace("\n", ":")); | ||
| console.error(msg.replace(/\n/g, ":")); |
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.
Make sure to read the contributing guidelines before submitting a PR
This updates CI workflow and server-side input/output handling to address the full set of code scanning findings (ggml-org#76–#100) with minimal, targeted changes. The fixes focus on permission scope, untrusted ref handling, traversal prevention, and output sanitization.
GitHub Actions hardening
build.yml(contents: read).workflow_dispatchSHA from checkout ref selection in server workflows.Static server security fixes (
scripts/serve-static.js)403 Forbiddenfor traversal attempts.reqUrl, filenames) before rendering HTML to prevent reflected XSS.Client-side sanitization fix (
tools/server/public_simplechat/simplechat.js)Alert disposition