Skip to content

fix(feedback): keep page links on tempo.xyz and strip invisible characters - #1136

Merged
brendanjryan merged 4 commits into
mainfrom
fix/feedback-link-sanitizing
Nov 13, 2026
Merged

brendanjryan merged 4 commits into
mainfrom
fix/feedback-link-sanitizing

Conversation

@brendanjryan

Copy link
Copy Markdown
Contributor

Feedback page URLs and related resources now link only to https://tempo.xyz and its subdomains; other URLs are dropped, keeping their path so the page is still named. Links to other hosts in free-text fields are defanged (hxxp[://]example[.]com) so they show as text, not links. Control, zero-width and bidi-override characters are stripped before whitespace is collapsed.

Tests: pnpm test, pnpm check:types, biome.

@vercel

vercel Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
tempo-docs Ready Ready Preview Nov 13, 2026 3:50pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-13T15:24:39.803512Z 182fa61 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 182fa612b8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/lib/feedback.ts Outdated
Comment on lines +297 to +298
const url = new URL(path.startsWith('/') ? path : `/${path}`, 'https://tempo.xyz/developers')
return isTempoHost(url.hostname) ? url.toString() : defaultPageUrl

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle defanged resources before resolving the fallback URL

When MCP feedback supplies a protocol-relative IPv4 resource such as //192.0.2.1/docs without a separate page URL or path, cleanResource now converts it to //192[.]0[.]2[.]1/docs. Resolving that value here throws Invalid URL because the defanged hostname contains brackets. sendSlackFeedback catches the exception and returns delivered: false without submitting anything to Slack, silently dropping the entire feedback report. Catch invalid fallback URLs and use defaultPageUrl, or avoid resolving defanged resources as URLs.

Useful? React with 👍 / 👎.

Comment thread src/lib/feedback.ts Resolved
Comment thread src/lib/feedback.ts Resolved
Comment thread src/lib/feedback.ts Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nothing blocking. The comments below are optional suggestions. There is no need to push a fix for them before merging.

3 other optional suggestions (nits or notes on pre-existing code) were found and not posted.

Comment thread src/lib/feedback.ts Resolved

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I reviewed the latest push and didn't find any new bugs. Because this is sanitization for text that ends up in Slack, built on fairly intricate regexes, a human look would still be worthwhile.

What was reviewed:

  • allowedUrl now checks the raw host against plain ASCII labels before parsing, so hosts like evil.com,.tempo.xyz and userinfo forms like tempo.xyz@ evil.com get defanged.
  • stripInvisible now drops every Cc/Cf code point except tab, CR and LF. Bare hostnames are defanged unless they are on tempo.xyz. Rejected pageUrls are rebuilt under /developers from the raw path.
  • Not done: I didn't run the AGENTS.md checks (pnpm test, check:types, Biome). I only read the code.
Extended reasoning...

The change touches only src/lib/feedback.ts and its tests. It hardens how docs and MCP feedback is normalized before it is posted to Slack: URL allowlisting to tempo.xyz, defanging other links, and stripping invisible characters. The security-sensitive surface is content injection into Slack, through clickable phishing links and hidden text. No auth or crypto is involved. The latest commits appear to address the earlier inline findings, but the regex-heavy host matching is subtle enough that a human should still look.

@brendanjryan
brendanjryan merged commit 6e9f60b into main Nov 13, 2026
16 checks passed
@brendanjryan
brendanjryan deleted the fix/feedback-link-sanitizing branch November 13, 2026 15:50

This branch was successfully deployed

1 active deployment
Preview — 9a864f80 Deployed Nov 13, 2026 by vercel[bot]
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