mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-04 06:48:38 +09:00
CSP should only check host (not including path) when performing frame ancestors checks.
This has been explicitly stated in the CSP-3 spec.
This commit is contained in:
parent
54cfba5b8f
commit
fd1bb58ea8
4 changed files with 19 additions and 0 deletions
|
|
@ -136,6 +136,7 @@ nsCSPParser::nsCSPParser(cspTokens& aTokens,
|
|||
, mUnsafeInlineKeywordSrc(nullptr)
|
||||
, mChildSrc(nullptr)
|
||||
, mFrameSrc(nullptr)
|
||||
, mParsingFrameAncestorsDir(false)
|
||||
, mTokens(aTokens)
|
||||
, mSelfURI(aSelfURI)
|
||||
, mPolicy(nullptr)
|
||||
|
|
@ -807,6 +808,7 @@ nsCSPParser::sourceExpression()
|
|||
if (nsCSPHostSrc *cspHost = hostSource()) {
|
||||
// Do not forget to set the parsed scheme.
|
||||
cspHost->setScheme(parsedScheme);
|
||||
cspHost->setWithinFrameAncestorsDir(mParsingFrameAncestorsDir);
|
||||
return cspHost;
|
||||
}
|
||||
// Error was reported in hostSource()
|
||||
|
|
@ -1209,6 +1211,9 @@ nsCSPParser::directive()
|
|||
mStrictDynamic = false;
|
||||
mUnsafeInlineKeywordSrc = nullptr;
|
||||
|
||||
mParsingFrameAncestorsDir =
|
||||
CSP_IsDirective(mCurDir[0], nsIContentSecurityPolicy::FRAME_ANCESTORS_DIRECTIVE);
|
||||
|
||||
// Try to parse all the srcs by handing the array off to directiveValue
|
||||
nsTArray<nsCSPBaseSrc*> srcs;
|
||||
directiveValue(srcs);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue