Skip to content

[CONS-1091] Harbor renders catalog links without checking they are web URLs - #209

Merged
defunctl merged 10 commits into
experiment/software-stackfrom
fix/CONS-1091-web-url-links
Oct 11, 2026
Merged

defunctl merged 10 commits into
experiment/software-stackfrom
fix/CONS-1091-web-url-links

Conversation

@johnhooks

@johnhooks johnhooks commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

🎫 Ticket

CONS-1091

🗒️ Description

Renders catalog upgrade, purchase and activation links only when they are http(s), using the check the NPS upsell offers already applied.

⚠️ Blockers

Based on #205.

Upgrade, purchase and activation links came from the catalog and were
rendered whatever their scheme, so a javascript: or data: value would
become a working wp-admin link. They now share the http(s) check the
NPS upsell offers already used, and anything else renders no link.
@linear

linear Bot commented Oct 11, 2026

Copy link
Copy Markdown

CONS-1091

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Enterprise
  • Run ID: 5aab053a-dc62-4ce3-accd-7d1ed8450967

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR









🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR















  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@johnhooks

Copy link
Copy Markdown
Collaborator Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown
⚠️ Action not completed

Head commit changed.

Purchase and upgrade URLs are kept only when their scheme is http(s),
then passed through esc_url_raw(). The scheme is checked first because
esc_url_raw() prepends http:// to schemeless input. Sanitizing in
from_array() also cleans catalogs already cached in the state option.
@johnhooks
johnhooks marked this pull request as ready for review October 11, 2026 21:37
@johnhooks
johnhooks requested a review from defunctl October 11, 2026 21:37
@johnhooks johnhooks self-assigned this Oct 11, 2026

@defunctl defunctl 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.

The catalog URL checks look good. I ran the existing JS suite locally and all 166 tests passed. I also added two temporary component tests while reviewing, and both exposed gaps in the activation handling. Let's cover those before merging.

These are validation gaps, not a confirmed remote exploit. The activation URL normally comes from Harbor's configured Portal URL.

Comment thread resources/js/lib/activation-url.ts
Comment thread resources/js/lib/activation-url.ts
johnhooks and others added 2 commits October 11, 2026 14:58
The activation and subscriptions URLs were rendered unchecked, and
activation controls decided whether to show from the raw URL, so a
rejected one left a visible control with no destination. Each control now
shows only when it has a validated link.
@johnhooks
johnhooks requested a review from defunctl October 11, 2026 22:00

@defunctl defunctl 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.

Both issues from my earlier review are fixed, including hiding activation controls when the URL is rejected. The subscription links are covered too. I reran all 185 JS tests, the 14 PHP catalog tests and TypeScript checks, and both frontend builds compile. Looks good to merge.

@defunctl
defunctl merged commit daf9d1e into experiment/software-stack Oct 11, 2026
15 checks passed
@defunctl
defunctl deleted the fix/CONS-1091-web-url-links branch October 11, 2026 23:38
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.

2 participants