<div dir="ltr"><div>Steve,</div><div><br></div><div>I think we cannot avoid to be platform dependent in this regard. A single slash at the beginning on Windows systems should not be accepted, because it can specify a relative path, however a double back slash at the beginning is accepted (absolute path of a network share). Currently the single slash at the beginning is accepted in all platforms.</div><div>Applying environment variables might not be a trivial task in all run time environments, so I think the default behavior should work in that way which can do the right thing in most use cases.</div><div><br></div><div>Best regards,</div><div><br></div><div>Tamas</div><div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Steve Lime <<a href="mailto:sdlime@gmail.com">sdlime@gmail.com</a>> ezt írta (időpont: 2022. febr. 10., Cs, 15:48):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">The idea was to limit things to local paths with no back references by default. We're not distinguishing between OSes in setting that pattern. It's possible it's a bit overzealous so we could tweak the default if that makes sense across operating systems. It can be overridden by environment variable (or within the config file) and could be turned off completely with an expression that will never match.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 10, 2022 at 4:34 AM Tamas Szekeres <<a href="mailto:szekerest@gmail.com" target="_blank">szekerest@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="color:rgb(0,0,0)">Hi Developers,</span></div><span style="color:rgb(0,0,0)"><div><span style="color:rgb(0,0,0)"><br></span></div>I noticed that the double back slashes are excluded from the accepted mapfile pattern in one of the commits not too long ago according to security vulnerability reasons. The bad patten regex is now looking like:</span><br><div><span style="color:rgb(0,0,0)"><br></span></div>const char *ms_map_bad_pattern_default = "[/\\]{2}|[/\\]?\\.+[/\\]|,";<br><br><div>Do we have a specific reason why we don't accept the double back slashes at the beginning of the mapfile path? This normally refers to a network share which is considered to be an absolute path, and our use cases are working like that extensively. I guess we wanted to exclude the relative paths basically, but it seems not to be that case.</div><div>I'm also wondering if the double forward slashes at the beginning makes much sense to exclude, since I think that is treated as a single forward slash in the unix like systems which is normally accepted.</div><div><br></div><div>Thanks,</div><div><br></div><div>Tamas</div><div><br></div></div>
_______________________________________________<br>
MapServer-dev mailing list<br>
<a href="mailto:MapServer-dev@lists.osgeo.org" target="_blank">MapServer-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/mapserver-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/mapserver-dev</a><br>
</blockquote></div>
</blockquote></div></div>