Skip to content

Security hardening: CI permissions/pinning, webview/hover, policy#22

Merged
magnesj merged 1 commit into
mainfrom
security-hardening
May 25, 2026
Merged

Security hardening: CI permissions/pinning, webview/hover, policy#22
magnesj merged 1 commit into
mainfrom
security-hardening

Conversation

@magnesj
Copy link
Copy Markdown
Member

@magnesj magnesj commented May 23, 2026

Defense-in-depth hardening pass. No high-severity vulnerability was found; these changes close latent gaps and tighten the supply-chain posture.

CI workflow

  • Add top-level permissions: contents: read. The package job still elevates to contents: write for the release upload.
  • Pin every action to a full commit SHA (with # v<n> trailing comment):
    • actions/checkout, actions/setup-python, actions/setup-node, actions/upload-artifact, actions/download-artifact
    • softprops/action-gh-release (third-party — highest-value pin)
  • Pin @vscode/vsce@3.9.1 (build + publish) and ovsx@0.10.12 so the publish step holding VSCE_PAT no longer auto-installs latest at runtime.

Extension (vscode-extension/src/extension.ts)

  • escHtml also escapes single quotes ('&#39;) — closes a latent footgun if any future attribute is single-quoted.
  • The <td>${p.index}</td> cell now goes through escHtml to match the attribute usage on the same line.
  • DocsViewProvider sets localResourceRoots: []. The webview renders only inline content and never needs filesystem access.
  • Drop md.isTrusted from buildKeywordHover and buildParameterHover. supportHtml is kept where the inline <span> notices need it. isTrusted would additionally permit command: link execution, which these hovers never use.

New files

  • SECURITY.md — supported-versions statement and private vulnerability reporting via GitHub Security Advisories.
  • .github/dependabot.yml — weekly updates for npm (vscode-extension/), pip (scripts/), and github-actions (/). Keeps the new SHA pins fresh.

Verification

  • tsc -p ./ — compiles clean.
  • jest — 189/189 tests pass.
  • YAML files parse.

CI workflow:
- Add top-level permissions: contents: read; package job still elevates
  to contents: write for the release upload.
- Pin every action to a full commit SHA with a # v<n> trailing comment.
- Pin @vscode/vsce to 3.9.1 and ovsx to 0.10.12 so the publish step
  holding VSCE_PAT no longer auto-installs latest at runtime.

Extension:
- escHtml also escapes single quotes.
- The <td>${p.index}</td> cell now goes through escHtml to match the
  attribute usage on the same line.
- DocsViewProvider sets localResourceRoots: [] — the webview renders
  only inline content and never needs filesystem access.
- Drop md.isTrusted from buildKeywordHover and buildParameterHover;
  supportHtml stays where the inline span notices need it. isTrusted
  would additionally permit command: link execution, which these
  hovers never use.

New files:
- SECURITY.md — supported-versions statement and private vulnerability
  reporting via GitHub Security Advisories.
- .github/dependabot.yml — weekly updates for npm (vscode-extension/),
  pip (scripts/), and github-actions (/).
@magnesj magnesj merged commit 0e67a95 into main May 25, 2026
4 checks passed
@magnesj magnesj deleted the security-hardening branch May 25, 2026 06:44
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