Skip to content

[server] Add authorization to databaseExists and tableExists RPC call…#3078

Open
vaibhavk1992 wants to merge 1 commit intoapache:mainfrom
vaibhavk1992:add-authorization-database-table-exists
Open

[server] Add authorization to databaseExists and tableExists RPC call…#3078
vaibhavk1992 wants to merge 1 commit intoapache:mainfrom
vaibhavk1992:add-authorization-database-table-exists

Conversation

@vaibhavk1992
Copy link
Copy Markdown
Contributor

Currently, the databaseExists and tableExists RPC methods do not enforce authorization, allowing any authenticated user to check if databases or tables exist, which poses a security risk.

This commit adds authorization checks to both methods:

  • databaseExists: Checks DESCRIBE permission on the database
  • tableExists: Checks DESCRIBE permission on the table

For security, both methods return false for unauthorized access, preventing information disclosure. Unauthorized users cannot distinguish between "resource doesn't exist" and "no permission", which prevents reconnaissance attacks to map database structure.

Changes:

  • Modified RpcServiceBase.databaseExists() to catch authorization exceptions
  • Modified RpcServiceBase.tableExists() to catch authorization exceptions
  • Added testDatabaseExistsAuthorization() integration test
  • Added testTableExistsAuthorization() integration test

apache#2007)

Currently, the databaseExists and tableExists RPC methods do not enforce
authorization, allowing any authenticated user to check if databases or
tables exist, which poses a security risk.

This commit adds authorization checks to both methods:
- databaseExists: Checks DESCRIBE permission on the database
- tableExists: Checks DESCRIBE permission on the table

For security, both methods return false for unauthorized access, preventing
information disclosure. Unauthorized users cannot distinguish between
"resource doesn't exist" and "no permission", which prevents reconnaissance
attacks to map database structure.

Changes:
- Modified RpcServiceBase.databaseExists() to catch authorization exceptions
- Modified RpcServiceBase.tableExists() to catch authorization exceptions
- Added testDatabaseExistsAuthorization() integration test
- Added testTableExistsAuthorization() integration test

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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