mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-06 07:48:38 +09:00
Add extra check for path traversal sanity.
This commit is contained in:
parent
39e63a6981
commit
01de5bc76a
1 changed files with 6 additions and 0 deletions
|
|
@ -238,6 +238,12 @@ nsChromeRegistry::Canonify(nsIURL* aChromeURL)
|
|||
// path is already unescaped once, but uris can get unescaped twice
|
||||
const char* pos = path.BeginReading();
|
||||
const char* end = path.EndReading();
|
||||
// Must start with [a-zA-Z0-9].
|
||||
if (!('a' <= *pos && *pos <= 'z') &&
|
||||
!('A' <= *pos && *pos <= 'Z') &&
|
||||
!('0' <= *pos && *pos <= '9')) {
|
||||
return NS_ERROR_DOM_BAD_URI;
|
||||
}
|
||||
while (pos < end) {
|
||||
switch (*pos) {
|
||||
case ':':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue