Replies: 1 comment
-
We don't have a statement on security, but you can rely on Uproot being a naive library when it comes to security. It doesn't attempt to protect sensitive files from uproot.recreate("/etc/passwd") # effectively deletes /etc/passwd Thus, you'd want to design as much caution around Uproot as you would around a library like h5py or Python's os module. Despite the malicious example above, which can destroy files, it's hard to see how sensitive information could be revealed with There are various methods to pass security credentials to the XRootD and HTTPS handling, and I don't know how those would fare in a secured context. Will the users need to pass security credentials to the server, for the server to apply? Or would the server know the security credentials of the file-server that it's talking to? (Or does none of that matter, once you're in-network?)
I'm not familiar with the term. Uproot does use
Uproot doesn't give up until the file is read: that's part of its naivety. (If it wasn't naive, then a timeout on large files would be a disastrous surprise for other users.) Often XRootD does this itself, though: many of the reported errors in Uproot are instances where the remote XRootD server gives up or gets disconnected or something. It manifests as an exception in Uproot. Uproot never uses external commands (no As for general guidelines, this GitHub Discussion is the first conversation I've had about Uproot in server-side contexts. Well... ServiceX has an Uproot-Transformer that runs on a server; maybe some of the same issues apply there (but we've never talked about security). I think that ServiceX runs Uproot in some kind of sandbox, maybe a Docker container that has no access beyond its read-only function, which is easy to interrupt and reboot? Footnotes
|
Beta Was this translation helpful? Give feedback.
-
At EIC, we are considering running Uproot on a server where users can provide an URL, and the server executes
uproot.open('user-provided-input')
and then process TTree-s. We now are concerned about potential security implications of this setup and would like to discuss if there are any risks we should be aware of. Maybe developers thought of it already, maybe there are examples and best practices?To be more specific, here is our scenario:
Scenario:
uproot.open
to open the file, reads a TTree, and returns JSON data.Path Traversal Attacks - Imagine users try to access files like
/etc/passwd
or other sensitive system files. It seems uproot should fail to find a TTree in such files and raise an error. But we want to ensure that this does not expose any vulnerabilities. (There definitely should be validation and sanitization of local files access, but imagine it is dodged or failed, would uproot part considered safe and we are good?)Accessing Remote Files via xrootd and HTTP(S):
root://...
links, and possiblyhttp://
andhttps://
URLs.Execution of Malicious Code:
eval
or dynamic code execution that could result in malicious code being executed on the server when a specially crafted.root
file is processed?Denial of Service (DoS): - probably not uproot part, but one can imagine users providing URLs to extremely large files or files that could cause excessive resource consumption during parsing. Maybe there could be thoughts
and prayerson uproot side?5 Command Injection: - Does any part of the file handling involve shell commands (e.g., downloading files)? - probably no, but just asking...
Additional questions:
We appreciate any insights or recommendations you can provide!
P.S. I apologize if the information is available, I couldn't find in issues, discussions and documentation.
Beta Was this translation helpful? Give feedback.
All reactions