Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Tainting Preferences #184

Merged
5 commits merged into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dom/base/DOMParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "nsJSUtils.h"
#include "nsError.h"
#include "nsPIDOMWindow.h"
#include "nsTaintingUtils.h"
#include "mozilla/BasePrincipal.h"
#include "mozilla/LoadInfo.h"
#include "mozilla/NullPrincipal.h"
Expand Down
1 change: 1 addition & 0 deletions dom/base/Document.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,6 +418,7 @@
#include "nsStringIterator.h"
#include "nsStyleSheetService.h"
#include "nsStyleStruct.h"
#include "nsTaintingUtils.h"
#include "nsTextNode.h"
#include "nsUnicharUtils.h"
#include "nsWrapperCache.h"
Expand Down
13 changes: 5 additions & 8 deletions dom/base/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@
#include "nsStyleStruct.h"
#include "nsStyledElement.h"
#include "nsTArray.h"
#include "nsTaintingUtils.h"
#include "nsTextNode.h"
#include "nsThreadUtils.h"
#include "nsViewManager.h"
Expand Down Expand Up @@ -3919,9 +3920,7 @@ void Element::SetInnerHTML(const nsAString& aInnerHTML,
ErrorResult& aError) {

// TaintFox: innerHTML sink.
nsAutoString id;
this->GetId(id);
ReportTaintSink(aInnerHTML, "innerHTML", id);
ReportTaintSink(aInnerHTML, "innerHTML", this);

SetInnerHTMLInternal(aInnerHTML, aError);
}
Expand All @@ -3943,9 +3942,7 @@ void Element::SetOuterHTML(const nsAString& aOuterHTML, ErrorResult& aError) {
}

// TaintFox: outerHTML sink.
nsAutoString id;
this->GetId(id);
ReportTaintSink(aOuterHTML, "outerHTML", id);
ReportTaintSink(aOuterHTML, "outerHTML", this);

if (OwnerDoc()->IsHTMLDocument()) {
nsAtom* localName;
Expand Down Expand Up @@ -3995,7 +3992,7 @@ enum nsAdjacentPosition { eBeforeBegin, eAfterBegin, eBeforeEnd, eAfterEnd };
void Element::InsertAdjacentHTML(const nsAString& aPosition,
const nsAString& aText, ErrorResult& aError) {
// TaintFox: insertAdjacentHTML sink
ReportTaintSink(aText, "insertAdjacentHTML");
ReportTaintSink(aText, "insertAdjacentHTML", this);

nsAdjacentPosition position;
if (aPosition.LowerCaseEqualsLiteral("beforebegin")) {
Expand Down Expand Up @@ -4126,7 +4123,7 @@ void Element::InsertAdjacentText(const nsAString& aWhere,
RefPtr<nsTextNode> textNode = OwnerDoc()->CreateTextNode(aData);

// TaintFox: insertAdjacentHTML sink
ReportTaintSink(aData, "insertAdjacentText");
ReportTaintSink(aData, "insertAdjacentText", this);

InsertAdjacent(aWhere, textNode, aError);
}
Expand Down
1 change: 1 addition & 0 deletions dom/base/Location.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
#include "nsDocShell.h"
#include "nsGlobalWindowOuter.h"
#include "nsPIDOMWindowInlines.h"
#include "nsTaintingUtils.h"
#include "mozilla/Likely.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/BasePrincipal.h"
Expand Down
1 change: 1 addition & 0 deletions dom/base/Navigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
#include "MediaManager.h"

#include "nsJSUtils.h"
#include "nsTaintingUtils.h"

#include "mozilla/dom/Promise.h"

Expand Down
1 change: 1 addition & 0 deletions dom/base/nsContentUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
#include "nsTLiteralString.h"
#include "nsTPromiseFlatString.h"
#include "nsTStringRepr.h"
#include "nsTaintingUtils.h"
#include "nsTextFragment.h"
#include "nsTextNode.h"
#include "nsThreadManager.h"
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsGlobalWindowInner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@
#include "nsTLiteralString.h"
#include "nsTObserverArray.h"
#include "nsTStringRepr.h"
#include "nsTaintingUtils.h"
#include "nsThreadUtils.h"
#include "nsWeakReference.h"
#include "nsWindowMemoryReporter.h"
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsGlobalWindowOuter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@

// Helper Classes
#include "nsJSUtils.h"
#include "nsTaintingUtils.h"
#include "jsapi.h"
#include "jsfriendapi.h"
#include "js/CallAndConstruct.h" // JS::Call
Expand Down
1 change: 1 addition & 0 deletions dom/base/nsINode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
#include "nsRange.h"
#include "nsString.h"
#include "nsStyleConsts.h"
#include "nsTaintingUtils.h"
#include "nsTextNode.h"
#include "nsUnicharUtils.h"
#include "nsWindowSizes.h"
Expand Down
Loading
Loading