Fix subscription topic authorization bypass - #18418
Conversation
|
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #18418 +/- ##
============================================
- Coverage 43.61% 43.60% -0.02%
Complexity 374 374
============================================
Files 5393 5393
Lines 385958 386055 +97
Branches 50267 50297 +30
============================================
- Hits 168337 168323 -14
- Misses 217621 217732 +111 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| private static boolean isRegexPattern(final String value) { | ||
| return value.indexOf('.') >= 0 | ||
| || value.indexOf('*') >= 0 | ||
| || value.indexOf('+') >= 0 | ||
| || value.indexOf('?') >= 0 | ||
| || value.indexOf('[') >= 0 | ||
| || value.indexOf(']') >= 0 | ||
| || value.indexOf('(') >= 0 | ||
| || value.indexOf(')') >= 0 | ||
| || value.indexOf('{') >= 0 | ||
| || value.indexOf('}') >= 0 | ||
| || value.indexOf('|') >= 0 | ||
| || value.indexOf('^') >= 0 | ||
| || value.indexOf('$') >= 0 | ||
| || value.indexOf('\\') >= 0; | ||
| } |
There was a problem hiding this comment.
Is it possible that the table name contains these chars?
There was a problem hiding this comment.
The database and table attributes in a table topic are regex patterns by contract (the same values are compiled by TablePattern). Therefore a metacharacter means the topic may cover multiple objects, and the conservative any-scope SELECT check is intentional. A literal name containing regex metacharacters must be escaped in the topic pattern; it is not interpreted as an unescaped literal table name.



Summary
READ_DATAfor tree-model topics andSELECTfor table-model subscriptionsThe reported
TRANSFER_SLICEallocation issue is already guarded onmasterby validating the received body size before allocating the original body buffer.Verification
mvn spotless:check -pl iotdb-core/datanodemvn checkstyle:check -pl iotdb-core/datanodegit diff --check