Skip to content

test: Webhook registration requires master key#10255

Merged
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:tests/GHSA-8pjv-59c8-44p8-v9
Mar 20, 2026
Merged

test: Webhook registration requires master key#10255
mtrezza merged 2 commits intoparse-community:alphafrom
mtrezza:tests/GHSA-8pjv-59c8-44p8-v9

Conversation

@mtrezza
Copy link
Member

@mtrezza mtrezza commented Mar 20, 2026

Issue

Webhook registration requires master key (GHSA-8pjv-59c8-44p8)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Mar 20, 2026

🚀 Thanks for opening this pull request! We appreciate your effort in improving the project. Please let us know once your pull request is ready for review.

Tip

  • Keep pull requests small. Large PRs will be rejected. Break complex features into smaller, incremental PRs.
  • Use Test Driven Development. Write failing tests before implementing functionality. Ensure tests pass.
  • Group code into logical blocks. Add a short comment before each block to explain its purpose.
  • We offer conceptual guidance. Coding is up to you. PRs must be merge-ready for human review.
  • Our review focuses on concept, not quality. PRs with code issues will be rejected. Use an AI agent.
  • Human review time is precious. Avoid review ping-pong. Inspect and test your AI-generated code.

Note

Please respond to review comments from AI agents just like you would to comments from a human reviewer. Let the reviewer resolve their own comments, unless they have reviewed and accepted your commit, or agreed with your explanation for why the feedback was incorrect.

Caution

Pull requests must be written using an AI agent with human supervision. Pull requests written entirely by a human will likely be rejected, because of lower code quality, higher review effort and the higher risk of introducing bugs. Please note that AI review comments on this pull request alone do not satisfy this requirement.

@parseplatformorg
Copy link
Contributor

parseplatformorg commented Mar 20, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@coderabbitai
Copy link

coderabbitai bot commented Mar 20, 2026

📝 Walkthrough

Walkthrough

Added a vulnerability-focused test block in spec/vulnerabilities.spec.js that asserts webhook-related requests using internal/private/localhost-style URLs are rejected with 403 when the request does not include the master key.

Changes

Cohort / File(s) Summary
Security Test Suite
spec/vulnerabilities.spec.js
Introduces an async helper and four negative SSRF test cases covering: function registration with webhook URL, function URL update, trigger registration, and webhook registration using a JavaScript key. Each asserts requests to internal/localhost/private addresses are rejected with HTTP 403 when missing the master key. One test creates a webhook function with the master key first to ensure update authorization is exercised.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no description provided by the author, missing all required sections from the template including Issue, Approach, and Tasks. Add a description following the template: include the issue/vulnerability reference (GHSA-8pjv-59c8-44p8), explain the approach (SSRF webhook URL protection tests), and check the 'Add tests' task.
✅ Passed checks (2 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title accurately reflects the main change: adding tests that verify webhook registration requires a master key, which is the core focus of the vulnerability fix.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@spec/vulnerabilities.spec.js`:
- Around line 3754-3820: Update the assertions to check for the exact auth
failure instead of any rejection: call the same request(...) for each endpoint
(POST /hooks/functions, PUT /hooks/functions/ssrf_probe, POST /hooks/triggers)
and assert response.status === 403 and that the response body/error message
indicates "master key required"; for the PUT /hooks/functions/ssrf_probe test
seed/create the webhook first (use POST /hooks/functions with functionName
'ssrf_probe' and a safe URL) so the subsequent PUT actually hits auth validation
rather than a "not found" error; replace generic expectAsync(...).toBeRejected()
checks with explicit status and message assertions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8261f8d-b589-4b37-9171-174aa338872b

📥 Commits

Reviewing files that changed from the base of the PR and between a9511a7 and 63eb0eb.

📒 Files selected for processing (1)
  • spec/vulnerabilities.spec.js

@codecov
Copy link

codecov bot commented Mar 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.54%. Comparing base (0c0a0a5) to head (10d8c82).
⚠️ Report is 4 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10255      +/-   ##
==========================================
- Coverage   92.55%   92.54%   -0.01%     
==========================================
  Files         192      192              
  Lines       16399    16399              
  Branches      221      221              
==========================================
- Hits        15178    15177       -1     
- Misses       1202     1203       +1     
  Partials       19       19              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mtrezza mtrezza changed the title test: GHSA-8pjv-59c8-44p8 v9 test: Webhook registration requires master key (GHSA-8pjv-59c8-44p8) Mar 20, 2026
@mtrezza mtrezza changed the title test: Webhook registration requires master key (GHSA-8pjv-59c8-44p8) test: Webhook registration requires master key Mar 20, 2026
@mtrezza mtrezza merged commit 683e2ae into parse-community:alpha Mar 20, 2026
21 of 24 checks passed
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 9.6.0-alpha.44

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

Labels

state:released-alpha Released as alpha version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants