mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-08 00:38:39 +09:00
[places] Prevent some abuse of smart queries.
This commit is contained in:
parent
257e674bde
commit
b3deb955e9
2 changed files with 14 additions and 4 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include "mozilla/dom/OSFileSystem.h"
|
||||
#include "mozilla/dom/Promise.h"
|
||||
#include "nsNetUtil.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
|
@ -644,6 +645,13 @@ DataTransfer::PrincipalMaySetData(const nsAString& aType,
|
|||
NS_WARNING("Disallowing adding x-moz-file or x-moz-file-promize types to DataTransfer");
|
||||
return false;
|
||||
}
|
||||
|
||||
// Disallow content from creating x-moz-place flavors, so that it cannot
|
||||
// create fake Places smart queries exposing user data.
|
||||
if (StringBeginsWith(aType, NS_LITERAL_STRING("text/x-moz-place"))) {
|
||||
NS_WARNING("Disallowing adding moz-place types to DataTransfer");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue