Skip to content

Clear the 17 open CodeQL alerts - #14

Merged
sanketsudake merged 1 commit into
mainfrom
fix/codeql-alerts-public
Nov 21, 2026
Merged

sanketsudake merged 1 commit into
mainfrom
fix/codeql-alerts-public

Conversation

@sanketsudake

Copy link
Copy Markdown
Collaborator

Summary

Fixes every open code-scanning alert in this repository, in code, with no dismissals.

Alerts Rule Severity Fix
#18, #19, #20 actions/missing-workflow-permissions medium permissions: contents: read at the top of backend-ci.yml, frontend-ci.yml and frontend-e2e.yml; only codeql.yml needs security-events: write.
#4, #5 js/incomplete-sanitization high The two Langflow iframe assertions escaped . only, so any other metacharacter in the URL would have broken the prefix match. They now call DevelopPage.expectEmbeddedFrom, which escapes every regex metacharacter, so one copy of the RegExp serves both e2e tiers.
#6-#17 py/clear-text-logging-sensitive-data high The query treats a value as sensitive when the name that holds it matches its secret heuristic, so logging a Secret name (secret_name, credential.secret_name, GATEWAY_CLIENT_SECRET_NAME) is reported. The 12 sinks no longer interpolate a Secret name; they log the namespace and the instance kind/id instead. No Secret value was ever logged.

Why the Python alerts are fixed rather than dismissed

py/clear-text-logging-sensitive-data has no sanitizer, and the sources here are
name-heuristic (SensitiveVariableAssignment marks secret_name = "..." as a source),
not a real flow of Secret data. Dropping the name from the message keeps the log
useful (the namespace and instance id identify the instance; the names were
constants or fixed suffixes) and leaves nothing for the heuristic to flag.

Test plan

  • backend/hack/lint.sh (ruff check + format)
  • backend/hack/runtest.sh — 770 passed
  • pnpm exec tsc --noEmit, pnpm lint and prettier --check on the changed e2e files
  • playwright test e2e/fast/runtime-config.spec.ts — the iframe assertion passes; the later clipboard-toast step fails identically on unmodified main on this machine, so it is pre-existing and unrelated
  • CodeQL analysis on this PR (the alerts should disappear on the merge ref)

Three groups of findings, all fixed in code rather than dismissed:

- actions/missing-workflow-permissions (backend-ci, frontend-ci,
  frontend-e2e): the workflows inherited the repository default for
  GITHUB_TOKEN. Each now declares `permissions: contents: read`, the
  least it needs; only codeql.yml asks for security-events: write.

- js/incomplete-sanitization (both Langflow iframe assertions): the
  specs escaped dots only, so any other metacharacter in the URL would
  have made the prefix match wrong. The assertion moves into
  DevelopPage.expectEmbeddedFrom, which escapes every metacharacter,
  and both tiers call it instead of duplicating the RegExp.

- py/clear-text-logging-sensitive-data (12 sinks): the query treats a
  value as sensitive when the name that holds it matches its secret
  heuristic, so the Secret *names* logged by the NIM controller, the
  credential helpers and the gateway client-secret copy were reported.
  The log lines no longer interpolate a Secret name; they keep the
  namespace and the instance kind/id, which identify the instance
  anyway. No Secret value was ever logged.
@sanketsudake

Copy link
Copy Markdown
Collaborator Author

The fast job fails, but not from this change: the same 25 toast assertions
(li[role="status"] never appears) fail on unmodified main.

Evidence:

  • Locally, on a clean checkout of main (no changes applied), playwright test e2e/fast/snippets.spec.ts e2e/fast/runtime-config.spec.ts fails on the same toast locators, and the page snapshot has no status region at all.
  • On CI the first failing frontend-e2e runs start right after 22eefa5 ("Take the frontend dependency updates…"), which bumped lucide-react to 1.x and tailwind-merge to 3.x; every frontend-e2e run before it passed.

So the toasts are broken on main independently of these CodeQL fixes; this PR only touches the two iframe assertions in the e2e specs.

@sanketsudake
sanketsudake merged commit 79fda5c into main Nov 21, 2026
7 of 8 checks passed
@sanketsudake
sanketsudake deleted the fix/codeql-alerts-public branch November 21, 2026 13:05
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.

1 participant