Skip to content

Validate secret fields before JDBC URL construction#334

Merged
simonmarty merged 3 commits into
aws:v2from
vedant-jaiswal:bug-bounty
May 13, 2026
Merged

Validate secret fields before JDBC URL construction#334
simonmarty merged 3 commits into
aws:v2from
vedant-jaiswal:bug-bounty

Conversation

@vedant-jaiswal

@vedant-jaiswal vedant-jaiswal commented May 11, 2026

Copy link
Copy Markdown
Contributor

Description

Why is this change being made?

  1. To prevent URL injection attacks (CWE-610) where malicious characters in secret fields could be used to manipulate JDBC URLs and bypass security controls or redirect connections to unintended databases.

What is changing?

  1. Added validateSecretFields() method in AWSSecretsManagerDriver that validates the host, port, and dbname fields from secrets before URL construction.

Related Links

  • Issue #, if available: N/A

Testing

How was this tested?

  1. Added new test methods for this change.

When testing locally, provide testing artifact(s):

  1. mvn clean test Tests run: 155, Failures: 0, Errors: 0, Skipped: 0

Reviewee Checklist

Update the checklist after submitting the PR

  • I have reviewed, tested and understand all changes
    If not, why:
  • I have filled out the Description and Testing sections above
    If not, why:
  • Build and Unit tests are passing
    If not, why:
  • Unit test coverage check is passing
    If not, why:
  • I have ensured no sensitive information is leaking (i.e., no logging of sensitive fields, or otherwise)
    If not, why:
  • I have added explanatory comments for complex logic, new classes/methods and new tests
    If not, why:
  • I have updated README/documentation (if needed)
    If not, why:
  • I have clearly called out breaking changes (if any)
    If not, why:

Reviewer Checklist

All reviewers please ensure the following are true before reviewing:

  • Reviewee checklist has been accurately filled out
  • Code changes align with stated purpose in description
  • Test coverage adequately validates the changes

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@vedant-jaiswal vedant-jaiswal requested a review from a team as a code owner May 11, 2026 23:30
@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.84%. Comparing base (62bfcd9) to head (00ee422).

Files with missing lines Patch % Lines
...ws/secretsmanager/sql/AWSSecretsManagerDriver.java 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                 v2     #334      +/-   ##
============================================
+ Coverage     83.02%   83.84%   +0.82%     
- Complexity      156      168      +12     
============================================
  Files            12       12              
  Lines           377      390      +13     
  Branches         50       53       +3     
============================================
+ Hits            313      327      +14     
  Misses           58       58              
+ Partials          6        5       -1     

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

Comment thread src/main/java/com/amazonaws/secretsmanager/sql/AWSSecretsManagerDriver.java Outdated
@vedant-jaiswal vedant-jaiswal requested a review from simonmarty May 11, 2026 23:55
simonmarty
simonmarty previously approved these changes May 12, 2026
@simonmarty simonmarty merged commit eca6c90 into aws:v2 May 13, 2026
5 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.

3 participants