-
Notifications
You must be signed in to change notification settings - Fork 806
Plain SQL restore runs with '\restrict' option to prevent harmful psql meta-commands. #9368 #9426
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
Conversation
WalkthroughDocumentation adds a note about plain SQL restore using psql's \restrict option. Backend changes generate a random restrict key (via Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
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. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
docs/en_US/restore_dialog.rst (1)
32-36: Clarify that\restrictis a psql meta-command, not an “option”.To better match upstream terminology and avoid confusion, consider rephrasing to something like “using the psql command with the
\restrictmeta-command” instead of “with the\restrictoption”. This keeps the explanation accurate without changing the intent.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
docs/en_US/restore_dialog.rst(1 hunks)web/pgadmin/tools/backup/static/js/backup.js(0 hunks)web/pgadmin/tools/maintenance/static/js/maintenance.js(0 hunks)web/pgadmin/tools/restore/__init__.py(3 hunks)web/pgadmin/tools/restore/static/js/restore.js(0 hunks)
💤 Files with no reviewable changes (3)
- web/pgadmin/tools/backup/static/js/backup.js
- web/pgadmin/tools/maintenance/static/js/maintenance.js
- web/pgadmin/tools/restore/static/js/restore.js
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
- GitHub Check: run-python-tests-pg (windows-latest, 13)
- GitHub Check: run-python-tests-pg (windows-latest, 14)
- GitHub Check: run-python-tests-pg (windows-latest, 17)
- GitHub Check: run-python-tests-pg (windows-latest, 18)
- GitHub Check: run-python-tests-pg (windows-latest, 15)
- GitHub Check: run-feature-tests-pg (18)
- GitHub Check: run-feature-tests-pg (16)
- GitHub Check: run-feature-tests-pg (14)
- GitHub Check: run-feature-tests-pg (15)
- GitHub Check: run-feature-tests-pg (17)
- GitHub Check: run-feature-tests-pg (13)
🔇 Additional comments (1)
web/pgadmin/tools/restore/__init__.py (1)
14-15: The review comment references code changes that do not exist in the file. A search ofweb/pgadmin/tools/restore/__init__.pyreveals:
- No
import secretsat lines 14-15 (the file begins with imports forjson,re,flask, etc.)- No
restrict_keyvariable orsecrets.token_hex()calls anywhere in the file- No
-c '\\restrict {restrict_key}'injection in theget_sql_util_args()function (lines 350-365 show the function without any restrict-related logic)- The grep search for "secrets", "restrict_key", and "token_hex" found zero matches in the restore module itself (though
import secretsdoes appear in test files)The underlying security concern about
\restrictversion compatibility is valid and well-reasoned in principle—CVE-2025-8714 is real,\restrictwas added in PostgreSQL 13.22+, 14.19+, 15.14+, 16.10+, and 17.6+, and older psql binaries would not recognize the command. However, there is no code to review here because the described implementation does not exist in this file.Likely an incorrect or invalid review comment.
Summary by CodeRabbit
Bug Fixes
Documentation
✏️ Tip: You can customize this high-level summary in your review settings.