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

[Security] Full local path included in output #28

Closed
jonpas opened this issue Jan 26, 2023 · 4 comments
Closed

[Security] Full local path included in output #28

jonpas opened this issue Jan 26, 2023 · 4 comments

Comments

@jonpas
Copy link
Contributor

jonpas commented Jan 26, 2023

This is a security issue and should be remedied.

Diff

@jonpas jonpas changed the title Full local path included in output [Security] Full local path included in output Jan 26, 2023
@jonpas
Copy link
Contributor Author

jonpas commented Jan 26, 2023

@PabstMirror @BrettMayson

@dedmen
Copy link
Owner

dedmen commented Feb 12, 2024

Not just security, this will also lead to incorrect in-game paths.
Arma 3 base files have the same issue, resulting in
/temp/bin/A3/Functions_F/Ambient/fn_ambientAnim.sqf
instead of
\A3\Functions_F\Ambient\fn_ambientAnim.sqf

@dedmen
Copy link
Owner

dedmen commented Feb 12, 2024

The problem is that the "root" what would often be a p-drive root. Is unknown.
We can try finding it by looking for PBOPREFIX, which might solve most cases (doesn't solve our vanilla A3 case)

Instead of that, I'll add "rootPathMapping" config entry.
They will map physical paths to virtual paths.

So in your case the root path might be
"C:/Users/username/Appdata/Local/Temp/hemtt/DEV_CBA_A3/asc/source" -> "\x\cba"
Such that your file instead of
/Users/username/Appdata/Local/Temp/hemtt/DEV_CBA_A3/asc/source/addons/common/fnc_test.sqf
will be translated to
\x\cba\addons/common/fnc_test.sqf

@dedmen
Copy link
Owner

dedmen commented Feb 13, 2024

Also important note on this, this changes how the outputPath is handled.
result file is outputPath/virtualPath.
Because the virtualPath was previously bugged, it would output to example
P:/Users/username/Appdata/Local/Temp/hemtt/DEV_CBA_A3/asc/source/addons/common/fnc_test.sqfc
But with the fix, it will now output to
P:\x\cba\addons/common/fnc_test.sqf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants