Skip to content

security: remove leaked OAuth credentials and stop logging user secrets - #18658

Merged
JinHai-CN merged 1 commit into
infiniflow:mainfrom
simpleqt:pr-box-secret
Aug 24, 2026
Merged

JinHai-CN merged 1 commit into
infiniflow:mainfrom
simpleqt:pr-box-secret

Conversation

@simpleqt

Copy link
Copy Markdown
Contributor

What this PR does

  • common/data_source/box_connector.py: a commented-out BoxOAuth example embedded a real-looking client_id / client_secret. Even disabled, committed secrets must be treated as compromised and rotated by their owner; the example now uses placeholders.
  • api/apps/restful_apis/connector_api.py: start_google_web_oauth printed the full parsed credentials dict (including client_secret) to stdout before caching it in Redis, so user-supplied secrets landed in container / log-aggregation logs. Dropped the print.

Verification

  • python -m py_compile on both files.
  • No behaviour change apart from the removed logging and the placeholder swap.

- a commented-out BoxOAuth example embedded a real-looking client_id and
  client_secret; committed secrets must be treated as compromised and
  rotated by their owner, so the example now uses placeholders
- start_google_web_oauth printed the full parsed credentials dict
  (including client_secret) to stdout before caching them; drop the
  print so user-supplied secrets never land in container logs
Copilot AI lite review requested due to automatic review settings August 23, 2026 07:03
@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Aug 23, 2026
@coderabbitai

coderabbitai Bot commented Aug 23, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 6c1537a9-186b-410b-b2c1-788b92073cc7

📥 Commits

Reviewing files that changed from the base of the PR and between 9ea83b7 and 0336142.

📒 Files selected for processing (2)
  • api/apps/restful_apis/connector_api.py
  • common/data_source/box_connector.py
💤 Files with no reviewable changes (1)
  • api/apps/restful_apis/connector_api.py

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The changes remove debug output for parsed Google OAuth credentials and replace embedded Box OAuth values in a commented example with placeholders.

Changes

OAuth credential cleanup

Layer / File(s) Summary
Credential output and example sanitization
api/apps/restful_apis/connector_api.py, common/data_source/box_connector.py
The Google OAuth startup no longer prints parsed credentials. The commented Box OAuth configuration now uses placeholder client credentials.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to 03361

This change replaces an embedded credential example with placeholders and stops logging user secrets; no actionable merge-blocking risk remains after normal checks and review.

Suggested reviewers: huang-aoqin

Poem

A rabbit found credentials in sight,
And tucked them safely out of light.
Google logs grew quiet,
Box examples shed their riot,
Placeholders now keep the burrow right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both security changes: removing exposed OAuth credentials and stopping logging of user secrets.
Description check ✅ Passed The description explains the security changes, provides background, and documents verification with py_compile.
Docstring Coverage ✅ Passed Docstring check was indeterminate for this PR — some files could not be analyzed in time. Not blocking.
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.

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.

Copilot AI 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.

Pull request overview

This PR mitigates secret-leak risk by removing committed OAuth credentials (even in commented examples) and eliminating stdout logging of user-supplied OAuth client configuration during Google web OAuth initialization.

Changes:

  • Replaced real-looking Box OAuth client_id / client_secret in a commented example with placeholders.
  • Removed a print(credentials) that could leak client_secret into container/log aggregation output during /connectors/google/oauth/web/start.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
common/data_source/box_connector.py Replaces embedded OAuth credential values in a commented example with non-sensitive placeholders.
api/apps/restful_apis/connector_api.py Removes stdout logging of parsed Google OAuth credentials before caching flow state.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@JinHai-CN JinHai-CN added the ci Continue Integration label Aug 24, 2026
@codecov

codecov Bot commented Aug 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.65%. Comparing base (9ea83b7) to head (0336142).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #18658   +/-   ##
=======================================
  Coverage   90.65%   90.65%           
=======================================
  Files          10       10           
  Lines         717      717           
  Branches      118      118           
=======================================
  Hits          650      650           
  Misses         39       39           
  Partials       28       28           

☔ 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.

@JinHai-CN
JinHai-CN merged commit af4651c into infiniflow:main Aug 24, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants