Caideyipi commented on PR #19029:
URL: https://github.com/apache/iotdb/pull/19029#issuecomment-6459770623

   Here is a design concern about the security boundary of this change.
   
   The security invariant should be that every remote Pipe LOAD is executed 
with an identity authenticated and resolved by the receiver, and that the same 
identity is carried through the asynchronous handoff, active loader, and 
type-mismatch conversion. The current implementation still makes this 
conditional through the two default-disabled switches 
(`pipe_receiver_require_user_identity` and `load_require_user_identity`) and 
falls back to `AuthorityChecker.SUPER_USER` when no identity reaches the 
relevant path. This leaves the privilege boundary dependent on configuration 
and allows legacy or incomplete handoffs to retain a privileged fallback.
   
   I recommend separating the two sources at the API boundary:
   
   - A Pipe receiver handoff must carry a receiver-created identity. Missing, 
expired, or deleted identities should fail closed; the sender-supplied user id 
should never be trusted. The worker should re-resolve the user at execution 
time and use that identity for schema authorization, data writes, and type 
conversion.
   - A file placed directly in the local active-listening directory can keep 
the existing default-user behavior, including recognized LOAD-option 
subdirectories. This local path should be identified explicitly rather than 
inferred from the presence or absence of a `user` attribute.
   
   The identity should be represented as one immutable receiver-side context 
passed through the whole async pipeline, rather than being reconstructed 
independently by `IoTDBDataNodeReceiver`, `LoadUtil`, `ActiveLoadTsFileLoader`, 
and `LoadTsFileDataTypeConverter`. This would make it impossible for one stage 
to silently fall back to root while another stage uses the authenticated 
account.
   
   The asynchronous acknowledgement semantics also need to be documented and 
tested: a successful seal response currently means that the file was accepted 
into the background queue, not that authorization and loading succeeded. The 
task status, retry behavior, and the effect of permissions revoked after 
enqueue should be explicit. I would add coverage for table-model loads, 
type-mismatch conversion, missing/deleted users, permission revocation after 
enqueue, and both identity switches in combination with local file drops.
   


-- 
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]

Reply via email to