The path separator"\"with"/"in the Web of induced vulnerability-vulnerability warning-the black bar safety net

2011-05-29T00:00:00
ID MYHACK58:62201130648
Type myhack58
Reporter 佚名
Modified 2011-05-29T00:00:00

Description

Whether is under windows the path separator"\"or linux"/", this is not a serious problem, but in the web of the upper surface of the opening will appear a lot of"bugs", if the web Developer did not consider this issue, then may appear very serious bug.

In the VC code\ \ \is an escape character, and he expressed a\, LIKE\n represents a carriage return. So the C in the path name: D:\test\test.txt

Should be:

CString filename=_T("D:\\test\\test.txt");

Or

CString filename=_T("D:/test/test.txt");

"./ "Plus not all the same,is refers to the current directory

"../ "Represents the current directory's parent directory,i.e. the current parent directory. The forward slash, also known as the left of the slash symbol"/"; the backslash, also known as the right of the slash symbol"\"is.

In Unix/Linux, the path separator use a slash"/", such as"/home/test"; on Windows, paths are separated using a backslash"\", such as"C:\Windows\System" it.

Sometimes we will see this path of writing,"C:\\Windows\\System"that is, use two backslashes to separate the path, this wording in networking or programming, often see, in fact, above this path can be used"C:/Windows/System"instead, won't go wrong. But if written as"C:\Windows\System"that may be appeared all sorts of strange errors. In fact, this is the escape character to mess with things.

If the web in the processing on the use of"/", then you can use"\"for processing bypassed. Otherwise and Vice versa. Currently a lot of code in"certain"places and did not fully consider this case, so the resulting number of loopholes or less.

Today found the fck editor vulnerability is due to path processing issues, can be uploaded to any writable location for the resolved directory is not a permissions issue, if the latest ck is also used in the previous manner, then the vulnerability still exists. Specifically everyone may be their own to dig.