Repository navigation
[fix](fe) Reject invalid stream load tokens on commit and rollback - #62111
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
There was a problem hiding this comment.
Pull request overview
This PR addresses a security/authentication correctness issue in FE stream-load transaction handling by enforcing the return value of checkToken() during commit operations.
Changes:
- Reject invalid stream-load tokens during
loadTxnCommitImplby throwingAuthenticationExceptionwhencheckToken()returns false. - Reject invalid tokens during
commitTxnImplwith the samecheckToken()return-value enforcement.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bd4043b to
226c408
Compare
|
run buildall |
|
/review |
There was a problem hiding this comment.
Found 1 issue.
fe/fe-core/src/main/java/org/apache/doris/service/FrontendServiceImpl.java: the rollback RPCs still ignore the result ofcheckToken().loadTxnRollbackImpl()(line 1966 in the current head) androllbackTxnImpl()(line 2085) both continue toabortTransaction(...)even when the token is invalid, so the PR does not yet satisfy its stated goal of rejecting invalid tokens on commit and rollback.
Critical checkpoints:
- Goal: Not fully achieved; commit paths are fixed, rollback paths remain vulnerable. No test proves both commit and rollback rejection.
- Minimality: Small and focused change, but incompletely applied to the parallel rollback paths.
- Concurrency: Not applicable; this patch only changes FE auth guards.
- Lifecycle/static init: Not applicable.
- Config: No config changes.
- Compatibility: No protocol or storage compatibility impact.
- Parallel code paths: Failed; equivalent rollback handlers were missed.
- Special checks: The new explicit boolean check is the right pattern where added.
- Test coverage: Missing coverage for invalid-token rollback and end-to-end auth rejection.
- Observability: Existing RPC status conversion remains adequate.
- Transaction/persistence: No EditLog or persistence changes, but auth gating for rollback is still incorrect.
- Data writes/modifications: Unauthorized rollback is still possible with an invalid token.
- FE-BE variable passing: No new variables.
- Performance: Negligible impact.
- Other issues: None beyond the missed rollback paths.
### What problem does this PR solve? Issue Number: None Related PR: apache#62111 Problem Summary: Reject invalid tokens in stream load rollback and transaction rollback paths, avoid echoing raw tokens in AuthenticationException messages, and add unit coverage for invalid-token commit and rollback requests. ### Release note Invalid tokens are now rejected consistently for commit and rollback requests without exposing the token value in error messages. ### Check List (For Author) - Test: FE unit test - ./run-fe-ut.sh --run org.apache.doris.service.FrontendServiceImplTest#testLoadTxnCommitRejectsInvalidToken+testLoadTxnRollbackRejectsInvalidToken+testCommitTxnRejectsInvalidToken+testRollbackTxnRejectsInvalidToken - Behavior changed: Yes (invalid tokens now fail consistently on rollback and error messages no longer expose token values) - Does this need documentation: No
|
run buildall |
dc3e309 to
061a919
Compare
Issue Number: None Related PR: apache#62111 Problem Summary: Reject invalid tokens in stream load rollback and transaction rollback paths, avoid echoing raw tokens in AuthenticationException messages, and add unit coverage for invalid-token commit and rollback requests. Invalid tokens are now rejected consistently for commit and rollback requests without exposing the token value in error messages. - Test: FE unit test - ./run-fe-ut.sh --run org.apache.doris.service.FrontendServiceImplTest#testLoadTxnCommitRejectsInvalidToken+testLoadTxnRollbackRejectsInvalidToken+testCommitTxnRejectsInvalidToken+testRollbackTxnRejectsInvalidToken - Behavior changed: Yes (invalid tokens now fail consistently on rollback and error messages no longer expose token values) - Does this need documentation: No
|
run buildall |
FE UT Coverage ReportIncrement line coverage |
### What problem does this PR solve? Issue Number: None Related PR: None Problem Summary: Stream load commit and rollback accepted invalid tokens because the return value of checkToken() was ignored. ### Release note None ### Check List (For Author) - Test: No need to test (small FE auth guard change; no completed automated test run in this environment) - Behavior changed: Yes (invalid token is now rejected for stream load commit/rollback) - Does this need documentation: No
Issue Number: None Related PR: apache#62111 Problem Summary: Reject invalid tokens in stream load rollback and transaction rollback paths, avoid echoing raw tokens in AuthenticationException messages, and add unit coverage for invalid-token commit and rollback requests. Invalid tokens are now rejected consistently for commit and rollback requests without exposing the token value in error messages. - Test: FE unit test - ./run-fe-ut.sh --run org.apache.doris.service.FrontendServiceImplTest#testLoadTxnCommitRejectsInvalidToken+testLoadTxnRollbackRejectsInvalidToken+testCommitTxnRejectsInvalidToken+testRollbackTxnRejectsInvalidToken - Behavior changed: Yes (invalid tokens now fail consistently on rollback and error messages no longer expose token values) - Does this need documentation: No
061a919 to
85da7e3
Compare
|
run buildall |
|
/review |
FE UT Coverage ReportIncrement line coverage |
|
OpenCode automated review failed and did not complete. Error: Review step was failure (possibly timeout or cancelled) Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
|
/review |
FE Regression Coverage ReportIncrement line coverage |
|
OpenCode automated review failed and did not complete. Error: Review step was failure (possibly timeout or cancelled) Please inspect the workflow logs and rerun the review after the underlying issue is resolved. |
|
/review |
There was a problem hiding this comment.
The token-only path is fixed, but I do not think this PR reaches its stated goal for the real commit/rollback request shapes that Doris currently sends.
Critical checkpoints:
- Goal: Not fully achieved.
loadTxnCommitImpl()/commitTxnImpl()/loadTxnRollbackImpl()/rollbackTxnImpl()only validate the token whenauth_codeis absent. Current BE callers still populate deprecatedauth_codeon these RPCs, so they continue to bypass the new check. - Minimality: The patch is small and focused.
- Concurrency: No new concurrency or locking risk in this change.
- Lifecycle / static init: Not applicable.
- Config: No config changes.
- Compatibility: No storage or protocol compatibility impact.
- Parallel code paths: Incomplete. The legacy
auth_codebranch remains an authentication bypass for the same commit/rollback RPCs. - Special checks:
checkTokenOrThrow()is the right local helper, but the surrounding condition still prevents it from running on current callers. - Test coverage: The new FE tests only exercise private
*Implmethods with token-only requests. They do not cover the public RPC path or requests that still carryauth_code, so they do not prove the production callers are fixed. - Test result changes: Added FE unit tests; I did not rerun them locally in this review.
- Observability: Existing logging / status propagation is sufficient.
- Transaction / persistence: No EditLog or persistence changes.
- Data writes / modifications: Unauthorized commit or rollback is still possible through the deprecated
auth_codepath. - FE-BE variable passing: No new variables.
- Performance: No meaningful impact.
- Other issues: None beyond the authentication bypass / missing coverage above.
Please either stop sending deprecated auth_code on these callers or make the FE handlers validate or reject it before treating the request as authenticated, then add coverage for the real request shape.
this is another problem, should be fixed in another pr.
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
…pache#62111) Problem Summary: Stream load commit and rollback accepted invalid tokens because the return value of checkToken() was ignored.
What problem does this PR solve?
Issue Number: None
Related PR: None
Problem Summary: Stream load commit and rollback accepted invalid tokens because the return value of checkToken() was ignored.
Release note
None
Check List (For Author)