github-actions[bot] commented on code in PR #70338:
URL: https://github.com/apache/doris/pull/70338#discussion_r4496273297
##########
fe/fe-core/src/main/java/org/apache/doris/nereids/parser/LogicalPlanBuilderForEncryption.java:
##########
@@ -115,6 +115,15 @@ public LogicalPlan
visitCreateCatalog(DorisParser.CreateCatalogContext ctx) {
return super.visitCreateCatalog(ctx);
}
+ // alter catalog clause (ALTER CATALOG ... SET PROPERTIES(...))
+ @Override
+ public LogicalPlan
visitAlterCatalogProperties(DorisParser.AlterCatalogPropertiesContext ctx) {
+ DorisParser.PropertyItemListContext properties =
ctx.propertyItemList();
+ encryptProperty(visitPropertyItemList(properties),
properties.start.getStartIndex(),
+ properties.stop.getStopIndex());
Review Comment:
[P1] Convert code-point spans before slicing the original SQL
The new ALTER masking path passes ANTLR offsets directly to
`BaseViewInfo.rewriteSql`, which slices a Java `String` using UTF-16 offsets.
`CaseInsensitiveStream.fromString` uses a code-point stream whenever the SQL
contains a supplementary character, so the replacement ends early and copies
part of the original credential back into the result. For example, `ALTER
CATALOG ctl SET PROPERTIES("password"="πππππππsecret")` produces `ALTER CATALOG
ctl SET PROPERTIES("password" = "*XXX"secret")`: the entire ASCII suffix
remains in the audit and FE statement logs, without an exception to trigger
their fallback. Supplementary characters in an earlier SQL comment can expose
an otherwise ASCII password too. Convert both token boundaries to UTF-16
positions (including the exclusive end) before rewriting, and cover Unicode
values/comments in the masking tests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]