Skip to content

fix: Auth adapters for Facebook, Instagram, VK and WeChat send auth data unencoded in provider requests - #10904

Merged
mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:fix/auth-adapter-provider-request-encoding
Nov 26, 2026
Merged

mtrezza merged 1 commit into
parse-community:alphafrom
mtrezza:fix/auth-adapter-provider-request-encoding

Conversation

@mtrezza

@mtrezza mtrezza commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Pull Request

Issue

Auth adapters for Facebook, Instagram, VK and WeChat send auth data unencoded in provider requests

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)
  • Add security check
  • Add new Parse Error codes to Parse JS SDK

Summary by CodeRabbit

  • Bug Fixes
    • Facebook, Instagram, Vkontakte, and WeChat sign-in now correctly handle authentication values containing characters such as & and #, preventing them from being misread as extra URL parameters or fragments.
  • Tests
    • Added coverage for authentication requests with special characters in tokens, authorization codes, and user IDs.

@parse-github-assistant

Copy link
Copy Markdown

🚀 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. Our CI and AI review are safeguards, not development tools. If many issues are flagged, rethink your development approach. Invest more effort in planning and design rather than using review cycles to fix low-quality code.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Facebook, Instagram, Vkontakte, and WeChat authentication adapters now use URLSearchParams to construct request queries. Added tests check that values containing query-like characters and fragments remain query parameter values.

Changes: Authentication query parameter encoding

Layer / File(s) Summary
Facebook and Instagram Graph requests
src/Adapters/Auth/facebook.js, src/Adapters/Auth/instagram.js, spec/AuthenticationAdapters.spec.js, spec/Adapters/Auth/instagram.spec.js
Facebook and Instagram use URLSearchParams for Graph API query parameters. Tests check captured URLs, including special-character tokens and the Facebook appsecret_proof.
WeChat token and user requests
src/Adapters/Auth/wechat.js, spec/Adapters/Auth/wechat.spec.js
WeChat uses URLSearchParams for token-exchange and user-lookup queries. Tests check code, access-token, and user-ID values in captured URLs.
Vkontakte user lookup
src/Adapters/Auth/vkontakte.js, spec/AuthenticationAdapters.spec.js
Vkontakte uses URLSearchParams for the users.get query. A test checks the access token and API version in the captured URL.

Estimated code review effort: 2 (Simple) | ~15 minutes

Suggested reviewers: flovilmart, dplewis

Merge Risk: Minimal · up to 021a3

The change makes authentication provider requests encode token and ID values correctly, and no actionable merge-blocking risk was identified. Tests were added for each adapter.

Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

Failed Failed checks: 1 inconclusive

Check name Status Explanation Resolution
Description check Inconclusive The description follows the repository template. It includes the Pull Request section with the standard links, an Issue section that states the problem, and a Tasks section with "Add tests" checked. I… Add an Approach section that describes the changes. For example, state that the adapters now build query strings with URLSearchParams and which requests changed. Link the related issue in the Issue section if one exists. Keep the remaining …
Passed Passed checks: 5 passed

Check name Status Explanation
Title check Passed The title begins with the required prefix "fix:" and the first letter after the prefix is capitalized ("Auth"). It describes the main change: encoding auth data in provider requests for the Facebook, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Security Check Passed The PR changes seven files. Four source files in src/Adapters/Auth (facebook.js, instagram.js, vkontakte.js, wechat.js) build provider request URLs with URLSearchParams instead of string concatenation…
Engage In Review Feedback Passed The check requires that the user engage with review feedback before resolving or ignoring it. The supplied context shows no feedback to engage with. - Posted review threads: none were returned. The co…
Full details: Title check

Explanation

The title begins with the required prefix "fix:" and the first letter after the prefix is capitalized ("Auth"). It describes the main change: encoding auth data in provider requests for the Facebook, Instagram, VK and WeChat adapters.

Full details: Security Check

Explanation

The PR changes seven files. Four source files in src/Adapters/Auth (facebook.js, instagram.js, vkontakte.js, wechat.js) build provider request URLs with URLSearchParams instead of string concatenation. The diff checks for the listed security issue patterns: - Query/parameter injection: before the change, raw values such as access_token, code, openid and user IDs were interpolated into URLs. A value containing &, # or = could add parameters or truncate the URL. URLSearchParams now encodes these values, so this risk is removed. - Secrets: the same secrets are sent as before (access token, app secret in WeChat's required query string, appsecret_proof). No new logging, storage or exposure path is added. - Authentication logic: the response validation (data.id == authData.id, appIds checks, VK user id checks) and the getAppSecretPath appsecret_proof logic are unchanged. - Null/undefined values: template interpolation and URLSearchParams both stringify undefined and null the same way, so no new bypass appears. - Spec files add tests only. They contain no new production risk. The change reduces an injection risk and adds no new vulnerability pattern.

Full details: Engage In Review Feedback

Explanation

The check requires that the user engage with review feedback before resolving or ignoring it. The supplied context shows no feedback to engage with. - Posted review threads: none were returned. The context states "No CodeRabbit review threads were returned." - Current review: zero actionable findings. No feedback was ignored or resolved without discussion, so the check's failure condition does not apply. The current-review result covers only that review. The context does not show whether earlier review comments exist, but no thread data was returned, so no unengaged feedback can be identified. Pull request context: PR #10904 (parse-community/parse-server, base alpha, head fix/auth-adapter-provider-request-encoding), authored by mtrezza. Author identity was not needed for this check. I did not inspect the code diff. The check depends only on review-thread state, which the supplied metadata fully covers.

Full details: Description check

Explanation

The description follows the repository template. It includes the Pull Request section with the standard links, an Issue section that states the problem, and a Tasks section with "Add tests" checked. It has no Approach section, so the description does not explain how the code changes encode the auth data. The Issue section is one line and does not link an issue.

Resolution

Add an Approach section that describes the changes. For example, state that the adapters now build query strings with URLSearchParams and which requests changed. Link the related issue in the Issue section if one exists. Keep the remaining template items as they are, or update them if they apply.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: a1265f49-0cac-44d5-8b89-c22d1e881f7c
Commits

Reviewing files that changed from the base of the PR and between a3f152f and 021a391.

Files selected for processing: 7

  • spec/Adapters/Auth/instagram.spec.js
  • spec/Adapters/Auth/wechat.spec.js
  • spec/AuthenticationAdapters.spec.js
  • src/Adapters/Auth/facebook.js
  • src/Adapters/Auth/instagram.js
  • src/Adapters/Auth/vkontakte.js
  • src/Adapters/Auth/wechat.js

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

@codecov

codecov Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.34%. Comparing base (a3f152f) to head (021a391).

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha   #10904      +/-   ##
==========================================
+ Coverage   94.26%   94.34%   +0.08%     
==========================================
  Files         193      193              
  Lines       17502    17506       +4     
  Branches      258      258              
==========================================
+ Hits        16498    16516      +18     
+ Misses        984      970      -14     
  Partials       20       20              

☔ View full report in Codecov by Harness.
📢 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 commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai full review

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Action performed

Full review finished.

@mtrezza

mtrezza commented Nov 26, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Nov 26, 2026

Copy link
Copy Markdown
Action performed

Comments resolved and changes approved.

@mtrezza
mtrezza merged commit 2d9d7d2 into parse-community:alpha Nov 26, 2026
26 checks passed
@mtrezza
mtrezza deleted the fix/auth-adapter-provider-request-encoding branch November 26, 2026 23:51
parseplatformorg pushed a commit that referenced this pull request Nov 26, 2026
# [9.12.0-alpha.6](9.12.0-alpha.5...9.12.0-alpha.6) (2026-11-26)

### Bug Fixes

* Auth adapters for Facebook, Instagram, VK and WeChat send auth data unencoded in provider requests ([#10904](#10904)) ([2d9d7d2](2d9d7d2))
@parseplatformorg

Copy link
Copy Markdown
Contributor

🎉 This change has been released in version 9.12.0-alpha.6

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Nov 26, 2026
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