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

OSC configuration file path traversal #118

Open
lyuma opened this issue Jun 2, 2023 · 0 comments
Open

OSC configuration file path traversal #118

lyuma opened this issue Jun 2, 2023 · 0 comments

Comments

@lyuma
Copy link
Owner

lyuma commented Jun 2, 2023

Functions in A3EOSCConfiguration are used to access the OSC configuration files from within the VRChat user directory. I do think it would be worth revisiting this code to make sure it is accessing these files at the appropriate time (only when OSC is enabled in the emulator) and using the correct paths / APIs.

Original feedback from vrchat-community/vpm-listing-curated#5

Runtime\Scripts\A3EOSCConfiguration.cs

/*???:*/	System.IO.Path.Combine() 

The Combine() function does not compensate for directory traversal and relies on System.IO.File and System.IO.Directory classes to handle traversal, which they do not do universally.

/*128:*/	return JsonUtility.FromJson<OuterJson>(System.IO.File.ReadAllText(full_file_path));

/*132:*/	System.IO.File.WriteAllLines(filename, System.Text.RegularExpressions.Regex.Replace("\ufeff" +

/*162:*/	System.IO.Directory.CreateDirectory(vrcOSCPath);

/*170:*/	foreach (string file in System.IO.Directory.GetDirectories(vrcOSCPath, "*", System.IO.SearchOption.TopDirectoryOnly)) {

/*172:*/	DateTime thisdt = System.IO.File.GetLastWriteTime(file);

/*187:*/	System.IO.Directory.CreateDirectory(avatarDirectory);

These functions do not compensate for directory traversal. While this is a small issue in the current implementation, it is unclear if future feature enhancements might be a problem.

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

1 participant