Skip to content

[dev] [Marfuen] mariano/fix-vendor-subdomain-url-filtering#2337

Merged
Marfuen merged 1 commit intomainfrom
mariano/fix-vendor-subdomain-url-filtering
Mar 18, 2026
Merged

[dev] [Marfuen] mariano/fix-vendor-subdomain-url-filtering#2337
Marfuen merged 1 commit intomainfrom
mariano/fix-vendor-subdomain-url-filtering

Conversation

@github-actions
Copy link
Contributor

This is an automated pull request to merge mariano/fix-vendor-subdomain-url-filtering into dev.
It was created by the [Auto Pull Request] action.

extractVendorDomain only stripped the www. prefix, so a vendor website
like https://app.slack.com yielded app.slack.com as the domain. This
caused validateVendorUrl to reject valid URLs on the parent domain
(slack.com/privacy) or sibling subdomains (trust.slack.com). Now uses
tldts to extract the root registrable domain correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cursor
Copy link

cursor bot commented Mar 18, 2026

PR Summary

Medium Risk
Changes vendor domain extraction to use tldts registrable-domain parsing, which can broaden or narrow which URLs are accepted for vendor policy links. Risk is moderate because it affects security/allowlist-style URL filtering and could cause false accepts/rejects if parsing differs from expectations.

Overview
Updates vendor URL domain handling to extract the registrable root domain (via tldts getDomain) instead of only stripping www, so vendor websites hosted on subdomains (e.g., app.slack.com) normalize to slack.com.

Expands tests to cover root-domain extraction from subdomains, multi-level subdomains, and two-part TLDs, and to ensure validateVendorUrl accepts parent/sibling subdomain URLs when the vendor website is a subdomain.

Written by Cursor Bugbot for commit 53c9e13. This will update automatically on new commits. Configure here.

@vercel
Copy link

vercel bot commented Mar 18, 2026

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

Project Deployment Actions Updated (UTC)
comp-api-test Ready Ready Preview, Comment Mar 18, 2026 6:27pm
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
app Skipped Skipped Mar 18, 2026 6:27pm
portal Skipped Skipped Mar 18, 2026 6:27pm

Request Review

@Marfuen Marfuen merged commit 8c6865b into main Mar 18, 2026
10 checks passed
@Marfuen Marfuen deleted the mariano/fix-vendor-subdomain-url-filtering branch March 18, 2026 18:29
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

/^https?:\/\//i.test(website) ? website : `https://${website}`,
);
return urlObj.hostname.toLowerCase().replace(/^www\./, '');
const domain = getDomain(urlObj.hostname);
Copy link

Choose a reason for hiding this comment

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

Shared hosting domains get overly broad domain extraction

Low Severity

getDomain from tldts defaults to allowPrivateDomains: false, so for vendors on shared hosting platforms (e.g., myapp.github.io, myapp.netlify.app), it returns the platform domain (github.io) instead of the tenant-specific domain (myapp.github.io). This would cause isUrlFromVendorDomain to accept URLs from any tenant on that shared platform, weakening URL validation compared to the previous behavior which preserved the full hostname (minus www.).

Fix in Cursor Fix in Web

claudfuen pushed a commit that referenced this pull request Mar 19, 2026
# [3.10.0](v3.9.0...v3.10.0) (2026-03-19)

### Bug Fixes

* **integrations:** filter GWS employee sync by organizational units ([#2336](#2336)) ([e3a9867](e3a9867))
* **portal:** show Company Forms section even when all tasks are completed ([#2334](#2334)) ([5661cd6](5661cd6))
* **vendors:** extract root domain from subdomain vendor websites ([#2337](#2337)) ([8c6865b](8c6865b))
* **vendors:** validate vendor research URLs belong to correct domain ([#2335](#2335)) ([37a9813](37a9813))

### Features

* **people:** add Agent Installed column and hide deactivated users by default ([#2331](#2331)) ([67041ab](67041ab))
@claudfuen
Copy link
Contributor

🎉 This PR is included in version 3.10.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants