mirror of
https://github.com/apache/superset.git
synced 2026-05-29 20:29:34 +00:00
fix: escape SQL identifiers in db engine spec prequeries and metadata queries (#39840)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -169,6 +169,11 @@ def test_impersonation_username(mocker: MockerFixture) -> None:
|
||||
'EXECUTE AS "alice" WITH NO REVERT;'
|
||||
]
|
||||
|
||||
database.get_effective_user.return_value = 'evil" WITH NO REVERT; DROP TABLE x--'
|
||||
assert StarRocksEngineSpec.get_prequeries(database) == [
|
||||
'EXECUTE AS "evil"" WITH NO REVERT; DROP TABLE x--" WITH NO REVERT;'
|
||||
]
|
||||
|
||||
|
||||
def test_impersonation_disabled(mocker: MockerFixture) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user