Skip to content

SHOW pgdog.shards command #179

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

Merged
merged 3 commits into from
May 21, 2025
Merged

SHOW pgdog.shards command #179

merged 3 commits into from
May 21, 2025

Conversation

levkk
Copy link
Collaborator

@levkk levkk commented May 21, 2025

Description

  • Add SHOW pgdog.shards command so clients can find out how many shards are currently configured in the proxy.
  • Add wrapper to Rails gem.
  • Fix SQL injection in Rails gem.

Copy link

jazzberry-ai bot commented May 21, 2025

Bug Report

Name Severity Example test case Description
Integer Overflow in Shard Count Low Configure a very large number of shards (greater than 9223372036854775807) and execute SHOW pgdog.shards. The number of shards is represented as a usize in Rust. When handling the SHOW pgdog.shards command, this value is cast to i64 before being sent to the client. If the number of shards is sufficiently large, this cast can lead to an integer overflow, resulting in an incorrect value being reported to the client.

Comments? Email us. Your free trial ends in 7 days.

Copy link

jazzberry-ai bot commented May 21, 2025

Bug Report

Name Severity Example test case Description
SQL Injection in with_sharding_key High Set sharding key to '; DROP TABLE users; -- The with_sharding_key method in sdk/ruby/pgdog/lib/pgdog.rb is vulnerable to SQL injection.
Information Disclosure: Unprotected SHOW pgdog.shards command Low Execute SHOW pgdog.shards The SHOW pgdog.shards command does not have any authorization checks, leading to information disclosure.

Comments? Email us. Your free trial ends in 7 days.

Copy link

jazzberry-ai bot commented May 21, 2025

Bug Report

Name Severity Example test case Description
SQL Injection Vulnerability High Inject a semicolon and a SQL command in with_sharding_key The single quote escaping in with_sharding_key is insufficient to prevent SQL injection attacks.
Missing CRUD Tests High N/A Skipping the CRUD spec increases the risk of regressions and unexpected behavior in basic database operations.

Comments? Email us. Your free trial ends in 7 days.

@levkk levkk marked this pull request as ready for review May 21, 2025 02:48
@levkk levkk merged commit 08a0bb0 into main May 21, 2025
4 checks passed
@levkk levkk deleted the levk-show-shards branch May 21, 2025 02:48
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.

1 participant