Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

artifact filename mangling might break valid unix file paths #565

Open
lukpueh opened this issue Mar 22, 2023 · 0 comments
Open

artifact filename mangling might break valid unix file paths #565

lukpueh opened this issue Mar 22, 2023 · 0 comments
Labels
X41 Informational findings from X41 source code audit

Comments

@lukpueh
Copy link
Member

lukpueh commented Mar 22, 2023

[based on X41 source code audit informational note]

in_toto.runlib.record_artifacts_as_dict mangles file names to provide consistency between different operating systems. But replacing a backslash with a slash, can break valid Unix file paths:

in-toto/in_toto/runlib.py

Lines 260 to 263 in fe5ec9a

# FIXME: this is necessary to provide consisency between windows
# filepaths and *nix filepaths. A better solution may be in order
# though...
artifact = artifact.replace('\\', '/')

Solution Advice

X41 recommends to normalize file paths by d by using file:// URLs that are handled the same on all supported operating systems.

ITE-4 defines the necessary specification change, and #536 provides a implementation.

@lukpueh lukpueh changed the title Broken Filename Mangling artifact filename mangling might break valid unix file paths Mar 22, 2023
@lukpueh lukpueh added the X41 Informational findings from X41 source code audit label Mar 30, 2023
@lukpueh lukpueh mentioned this issue May 16, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
X41 Informational findings from X41 source code audit
Projects
None yet
Development

No branches or pull requests

1 participant