这是indexloc提供的服务,不要输入任何密码
Skip to content

fix: hide DB credentials and handle duplicate inserts when using AlloyDB #3021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

laxman-gupta1006
Copy link

Background

Adding duplicate items to the cart caused a duplicate key error and leaked AlloyDB credentials via the error message.

Fixes

Fixes #2795

Change Summary

  • Replaced raw INSERT with INSERT ... ON CONFLICT DO UPDATE
  • Removed connection string from exception messages to avoid leaking DB credentials

Additional Notes

Fixes a priority: p1 security issue

Testing Procedure

  1. Add an item to the cart (e.g., Tank Top, qty = 1)
  2. Add the same item again (qty = 2)
  3. Cart updates correctly
  4. No crash
  5. No DB credentials exposed

Related PRs or Issues

#2795

@laxman-gupta1006 laxman-gupta1006 requested review from yoshi-approver and a team as code owners July 20, 2025 15:59
Copy link

google-cla bot commented Jul 20, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

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.

DB Credentials Leak When Using AlloyDB
1 participant