Skip to content
This repository was archived by the owner on Oct 14, 2026. It is now read-only.

Fix security issues - #1378

Merged
bpander merged 2 commits into
masterfrom
fix-code-scanning-issues
Oct 12, 2026
Merged

bpander merged 2 commits into
masterfrom
fix-code-scanning-issues

Conversation

@bpander

@bpander bpander commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

Fix security issues flagged in https://github.com/metabase/metabase.github.io/pull/6651/checks?check_run_id=113024868999

They're also flagged in this repo: https://github.com/metabase/docs.metabase.github.io/security/code-scanning

Fixing them now so they don't get flagged in the docs->monorepo migration and because they're easy and we should do them anyway.

@bpander bpander self-assigned this Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

The deployments were removed when this pull request closed. Reopening it deploys again at the same address.

@bpander
bpander force-pushed the fix-code-scanning-issues branch from 9a3f820 to c016525 Compare October 8, 2026 17:52
@bpander
bpander force-pushed the fix-code-scanning-issues branch from c016525 to 658af28 Compare October 8, 2026 18:21
@bpander
bpander marked this pull request as ready for review October 8, 2026 18:30
@bpander
bpander requested a review from a team October 8, 2026 18:31
Comment thread public/docs/js/anonymous-snowplow.js Outdated
referrerUrl = document.referrer ? new URL(document.referrer) : null;
} catch (e) {
// Ignore invalid referrer URLs
referrerUrl = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary since it repeats the default value...

Comment thread public/docs/js/marketing-snowplow.js Outdated
referrerUrl = document.referrer ? new URL(document.referrer) : null;
} catch (e) {
// Ignore invalid referrer URLs
referrerUrl = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary since it repeats the default value...

Comment thread public/docs/js/anonymous-snowplow.js Outdated
}

// custom referrer (only for metabase.com)
var referrerUrl = null;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since everything is named with the Anon suffix, should we have the same for that? Meaning referrerUrlAnon... it might create a "collision" with the other referrerUrl ;)

@bpander
bpander force-pushed the fix-code-scanning-issues branch from ef1b3f0 to 231822c Compare October 9, 2026 13:21
@bpander

bpander commented Oct 9, 2026

Copy link
Copy Markdown
Contributor Author

@losrebellos Thanks for the feedback! Addressed the comments in 231822c.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No unresolved review issues were identified.

0 open findings

What changed in this PR

Fixes security issues in Snowplow referrer handling and GitHub Actions permissions.

Changes:

  • Validate referrer URLs using HTTPS and exact hostnames.
  • Restrict workflow permissions to least privilege.
File Description
public/​docs/​js/​marketing-snowplow.js Secures marketing referrer validation.
public/​docs/​js/​anonymous-snowplow.js Secures anonymous referrer validation.
.github/​workflows/​update-version-support.yml Limits workflow permissions.
.github/​workflows/​test.yml Limits test workflow permissions.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@losrebellos losrebellos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good ;)

@bpander
bpander merged commit 8154195 into master Oct 12, 2026
7 checks passed
@bpander
bpander deleted the fix-code-scanning-issues branch October 12, 2026 18:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants