Re: [PATCH] Permit a wider range of repository names in jgit daemon requests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



måndag 05 januari 2009 03:46:22 skrev Shawn O. Pearce:
> The earlier restriction was too narrow for some applications, for
> example repositories named "jgit.dev" and "jgit.test" are perfectly
> valid Git repositories and should still be able to be served by
> the daemon.
> 
> By blocking out only uses of ".." as a path component and Windows
> UNC paths (by blocking "\") we can reasonably prevent the client
> from escaping the base dirctories configured in the daemon.
> 
> +		if (name.startsWith("../") || name.contains("/../")
> +				|| name.contains("\\"))

//host/share also works as UNC path (even the DOS commands support it, provided
you quote the paths) and if you block // shuldn't '/', and '[A-Z]:' also be blocked? 
\\ is a UNC-prefix only at the beginning of a path so if / need not be filtered, nor 
does //. Inside a path \\ is the same as \ AFAIK (except directly after the drive letter.
This should probablybe factored out into a utilty so we can have a simple unit test for it.

-- robin



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux