Skip to content

🛡️ Sentinel: [MEDIUM] Fix SSRF risk in push notification endpoints#1169

Merged
daler91 merged 1 commit into
mainfrom
sentinel/fix-ssrf-push-endpoint-10700333223020819974
May 14, 2026
Merged

🛡️ Sentinel: [MEDIUM] Fix SSRF risk in push notification endpoints#1169
daler91 merged 1 commit into
mainfrom
sentinel/fix-ssrf-push-endpoint-10700333223020819974

Conversation

@daler91
Copy link
Copy Markdown
Owner

@daler91 daler91 commented May 13, 2026

🚨 Severity: MEDIUM
💡 Vulnerability: The web push subscription endpoint /api/v1/push/subscribe previously accepted any valid URL for the push endpoint field, including internal http:// URLs.
🎯 Impact: When dealing with external callback URLs, failing to strictly enforce HTTPS allows an attacker to supply an internal IP or local domain (e.g., http://localhost or http://169.254.169.254). The server's web push library could then unknowingly make a POST request to this internal address, resulting in a blind Server-Side Request Forgery (SSRF) attack.
🔧 Fix: Updated the Zod schemas in server/routes/push.ts to explicitly enforce https:// URLs using .refine.
Verification: Ran the full test suite (pnpm test), type check (pnpm check), and linting (pnpm lint) to ensure no regressions. The change purely restricts input validation safely, as valid Web Push subscriptions use secure HTTPS endpoints (fcm.googleapis.com, updates.push.services.mozilla.com, etc.).


PR created automatically by Jules for task 10700333223020819974 started by @rdale-dev

Enforces HTTPS for web push notification endpoints to prevent
potential Server-Side Request Forgery against internal services.

Co-authored-by: rdale-dev <203160809+rdale-dev@users.noreply.github.com>
@google-labs-jules
Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown

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

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: 4ddb437138

ℹ️ 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 server/routes/push.ts
const subscribeSchema = z.object({
endpoint: z.url(),
// 🛡️ Sentinel: Enforce HTTPS to prevent SSRF against internal/local services
endpoint: z.string().url().refine((url) => url.startsWith("https://"), {
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 Validate HTTPS scheme case-insensitively

The new startsWith("https://") refinement rejects valid HTTPS URLs whose scheme is uppercase or mixed case (for example HTTPS://...), even though z.string().url() accepts them and URL schemes are case-insensitive. That creates a regression where otherwise valid subscription/unsubscription payloads can fail validation with 400 responses depending on client normalization. Parse the URL and check new URL(url).protocol === "https:" (or use a case-insensitive protocol constraint) instead of a case-sensitive prefix check.

Useful? React with 👍 / 👎.

@cypress
Copy link
Copy Markdown

cypress Bot commented May 13, 2026

Default Project    Run #3210

Run Properties:  status check passed Passed #3210  •  git commit 5248135807: Merge pull request #1169 from daler91/sentinel/fix-ssrf-push-endpoint-1070033322...
Project Default Project
Branch Review main
Run status status check passed Passed #3210
Run duration 02m 23s
Commit git commit 5248135807: Merge pull request #1169 from daler91/sentinel/fix-ssrf-push-endpoint-1070033322...
Committer daler91
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 70
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@daler91 daler91 merged commit 5248135 into main May 14, 2026
15 checks passed
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