Shared security patch analysis results
AI Used: DEEPSEEK deepseek-chat--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html@@ -17,8 +17,8 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50);@@ -27,7 +27,7 @@ ctx.beginPath(); ctx.arc(50, 25, 50, 0, 0, false); ctx.stroke();-_assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255"); t.done(); });
After analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be purely variable renaming (from `offscreenCanvas` to `canvas`) and don't involve any security-related modifications. Here's the structured response: Vulnerability Existed: no [No security vulnerability found] [testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html] [Lines 17-27] [Old Code: var offscreenCanvas = new OffscreenCanvas(100, 50); ... _assertPixel(offscreenCanvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");] [Fixed Code: var canvas = new OffscreenCanvas(100, 50); ... _assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");] The changes are purely cosmetic/refactoring in nature and don't address any security issues. The functionality remains exactly the same, only the variable name has been changed for consistency or readability.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js@@ -13,8 +13,8 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50);@@ -41,7 +41,7 @@ ctx.clearRect(0, Infinity, Infinity, Infinity); ctx.clearRect(0, Infinity, 100, Infinity); ctx.clearRect(0, 0, Infinity, Infinity);-_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); t.done(); });
I'll analyze the provided code diff following the specified format. The changes appear to be primarily variable renaming, but I'll examine them for potential security implications. 1. Vulnerability Existed: no Variable Renaming [testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js] [Lines 13-14] Old Code: var offscreenCanvas = new OffscreenCanvas(100, 50); var ctx = offscreenCanvas.getContext('2d'); Fixed Code: var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); 2. Vulnerability Existed: no Variable Reference Update [testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js] [Line 41] Old Code: _assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); Fixed Code: _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); The changes appear to be purely cosmetic, renaming the variable from `offscreenCanvas` to `canvas` and updating all references to it. There don't appear to be any security vulnerabilities being fixed in this diff - it's simply a variable naming consistency improvement. The functionality remains exactly the same, just with a different variable name. No security vulnerabilities were identified in this diff. The changes are purely related to code style and maintainability rather than security fixes.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/layout/base/nsCSSFrameConstructor.cpp+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/layout/base/nsCSSFrameConstructor.cpp@@ -42,6 +42,7 @@ #include "nsAbsoluteContainingBlock.h" #include "nsCSSPseudoElements.h" #include "nsCheckboxRadioFrame.h"+#include "nsCRT.h" #include "nsAtom.h" #include "nsIFrameInlines.h" #include "nsGkAtoms.h"@@ -1435,7 +1436,7 @@ FrameCtorDebugFlags* flag = gFlags; FrameCtorDebugFlags* limit = gFlags + NUM_DEBUG_FLAGS; while (flag < limit) {- if (PL_strcasecmp(flag->name, flags) == 0) {+ if (nsCRT::strcasecmp(flag->name, flags) == 0) { *(flag->on) = true; printf("nsCSSFrameConstructor: setting %s debug flag on\n", flag->name);@@ -2911,33 +2912,8 @@ mPresShell->StyleSet()->ResolveInheritingAnonymousBoxStyle( PseudoStyleType::dropDownList, computedStyle);- // Create a listbox- nsListControlFrame* listFrame =- NS_NewListControlFrame(mPresShell, listStyle);-- // Notify the listbox that it is being used as a dropdown list.- listFrame->SetComboboxFrame(comboboxFrame);-- // Notify combobox that it should use the listbox as it's popup- comboboxFrame->SetDropDown(listFrame);-- NS_ASSERTION(!listFrame->IsAbsPosContainingBlock(),- "Ended up with positioned dropdown list somehow.");- NS_ASSERTION(!listFrame->IsFloating(),- "Ended up with floating dropdown list somehow.");- // child frames of combobox frame nsFrameList childList;-- // Initialize the scroll frame positioned. Note that it is NOT- // initialized as absolutely positioned.- nsContainerFrame* scrolledFrame =- NS_NewSelectsAreaFrame(mPresShell, computedStyle, flags);-- InitializeSelectFrame(aState, listFrame, scrolledFrame, content,- comboboxFrame, listStyle, true, childList);-- NS_ASSERTION(listFrame->GetView(), "ListFrame's view is nullptr"); // Create display and button frames from the combobox's anonymous content. // The anonymous content is appended to existing anonymous content for this@@ -2973,12 +2949,6 @@ comboboxFrame->SetInitialChildList(kPrincipalList, childList);- // Initialize the additional popup child list which contains the- // dropdown list frame.- nsFrameList popupList;- popupList.AppendFrame(nullptr, listFrame);- comboboxFrame->SetInitialChildList(nsIFrame::kSelectPopupList, popupList);- aState.mFrameState = historyState; if (aState.mFrameState) { // Restore frame state for the entire subtree of |comboboxFrame|.@@ -2997,22 +2967,17 @@ // ******* this code stolen from Initialze ScrollFrame ******** // please adjust this code to use BuildScrollFrame.- InitializeSelectFrame(aState, listFrame, scrolledFrame, content, aParentFrame,- computedStyle, false, aFrameList);+ InitializeListboxSelect(aState, listFrame, scrolledFrame, content,+ aParentFrame, computedStyle, aFrameList); return listFrame; }-/**- * Used to be InitializeScrollFrame but now it's only used for the select tag- * But the select tag should really be fixed to use GFX scrollbars that can- * be create with BuildScrollFrame.- */-void nsCSSFrameConstructor::InitializeSelectFrame(+void nsCSSFrameConstructor::InitializeListboxSelect( nsFrameConstructorState& aState, nsContainerFrame* scrollFrame, nsContainerFrame* scrolledFrame, nsIContent* aContent, nsContainerFrame* aParentFrame, ComputedStyle* aComputedStyle,- bool aBuildCombobox, nsFrameList& aFrameList) {+ nsFrameList& aFrameList) { // Initialize it nsContainerFrame* geometricParent = aState.GetGeometricParent(*aComputedStyle->StyleDisplay(), aParentFrame);@@ -3022,14 +2987,9 @@ // the scrollable view). So we have to split Init and Restore. scrollFrame->Init(aContent, geometricParent, nullptr);-- if (!aBuildCombobox) {- aState.AddChild(scrollFrame, aFrameList, aContent, aParentFrame);- }-+ aState.AddChild(scrollFrame, aFrameList, aContent, aParentFrame); BuildScrollFrame(aState, aContent, aComputedStyle, scrolledFrame, geometricParent, scrollFrame);- if (aState.mFrameState) { // Restore frame state for the scroll frame RestoreFrameStateFor(scrollFrame, aState.mFrameState);@@ -6438,7 +6398,10 @@ InsertionKind aInsertionKind) { for (nsIContent* child = aStartChild; child != aEndChild; child = child->GetNextSibling()) {- MOZ_ASSERT(!child->GetPrimaryFrame());+ // XXX the GetContent() != child check is needed due to bug 135040.+ // Remove it once that's fixed.+ MOZ_ASSERT(!child->GetPrimaryFrame() ||+ child->GetPrimaryFrame()->GetContent() != child); // Call ContentRangeInserted with this node. ContentRangeInserted(child, child->GetNextSibling(), aInsertionKind);
I'll analyze the code diff and provide the security fixes following the specified format. 1. Vulnerability Existed: yes Buffer Overflow/Insecure String Comparison [layout/base/nsCSSFrameConstructor.cpp] [Lines 1435] Old Code: `if (PL_strcasecmp(flag->name, flags) == 0) {` Fixed Code: `if (nsCRT::strcasecmp(flag->name, flags) == 0) {` Details: The change replaces the potentially unsafe PL_strcasecmp with nsCRT::strcasecmp, which is Mozilla's safer string comparison function. This helps prevent potential buffer overflows in string comparisons. 2. Vulnerability Existed: yes Memory Safety/Frame Initialization [layout/base/nsCSSFrameConstructor.cpp] [Lines 2911-2997] Old Code: Extensive frame initialization code for combobox dropdown lists Fixed Code: Removed frame initialization code for combobox dropdown lists Details: The removal of complex frame initialization code for combobox dropdown lists suggests a potential memory safety issue or race condition in the previous implementation. The simplified code reduces attack surface. 3. Vulnerability Existed: not sure Potential Null Pointer Dereference [layout/base/nsCSSFrameConstructor.cpp] [Lines 6438-6448] Old Code: `MOZ_ASSERT(!child->GetPrimaryFrame());` Fixed Code: Added additional check for primary frame content mismatch Details: The added check for `child->GetPrimaryFrame()->GetContent() != child` suggests a potential null pointer dereference or frame/content mismatch issue that was being addressed, though the exact vulnerability isn't clear from the diff. 4. Vulnerability Existed: yes Code Simplification/Reduced Attack Surface [layout/base/nsCSSFrameConstructor.cpp] [Lines 3022-3027] Old Code: Conditional frame addition based on aBuildCombobox flag Fixed Code: Unconditional frame addition Details: The removal of the conditional logic based on aBuildCombobox flag simplifies the code and reduces potential attack surface by removing a code path that could have had security implications. Note: The diff shows significant restructuring of frame initialization code, particularly around combobox and select elements, which often have complex security implications in browsers. While not all changes can be directly mapped to specific vulnerabilities, the overall trend appears to be reducing complexity and removing potentially unsafe code paths.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/parser/expat/lib/xmlparse.c+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/parser/expat/lib/xmlparse.c@@ -3213,18 +3213,54 @@ /* get the attributes from the tokenizer */ n = XmlGetAttributes(enc, attStr, attsSize, atts);++ /* Detect and prevent integer overflow */+ if (n > INT_MAX - nDefaultAtts) {+ return XML_ERROR_NO_MEMORY;+ }+ if (n + nDefaultAtts > attsSize) { int oldAttsSize = attsSize; ATTRIBUTE *temp; #ifdef XML_ATTR_INFO XML_AttrInfo *temp2; #endif++ /* Detect and prevent integer overflow */+ if ((nDefaultAtts > INT_MAX - INIT_ATTS_SIZE)+ || (n > INT_MAX - (nDefaultAtts + INIT_ATTS_SIZE))) {+ return XML_ERROR_NO_MEMORY;+ }+ attsSize = n + nDefaultAtts + INIT_ATTS_SIZE;++ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(ATTRIBUTE)) {+ parser->m_attsSize = oldAttsSize;+ return XML_ERROR_NO_MEMORY;+ }+#endif+ temp = (ATTRIBUTE *)REALLOC((void *)atts, attsSize * sizeof(ATTRIBUTE)); if (temp == NULL) return XML_ERROR_NO_MEMORY; atts = temp; #ifdef XML_ATTR_INFO+ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+# if UINT_MAX >= SIZE_MAX+ if ((unsigned)parser->m_attsSize > (size_t)(-1) / sizeof(XML_AttrInfo)) {+ parser->m_attsSize = oldAttsSize;+ return XML_ERROR_NO_MEMORY;+ }+# endif+ temp2 = (XML_AttrInfo *)REALLOC((void *)attInfo, attsSize * sizeof(XML_AttrInfo)); if (temp2 == NULL) return XML_ERROR_NO_MEMORY;@@ -3383,10 +3419,17 @@ /* END MOZILLA CHANGE */ int j; /* hash table index */ unsigned long version = nsAttsVersion;- int nsAttsSize = (int)1 << nsAttsPower;++ /* Detect and prevent invalid shift */+ if (parser->m_nsAttsPower >= sizeof(unsigned int) * 8 /* bits per byte */) {+ return XML_ERROR_NO_MEMORY;+ }++ unsigned int nsAttsSize = 1u << nsAttsPower; /* BEGIN MOZILLA CHANGE (Include xmlns attributes in attributes array) */ if (nPrefixes) { /* END MOZILLA CHANGE */+ unsigned char oldNsAttsPower = parser->m_nsAttsPower; /* size of hash table must be at least 2 * (# of prefixed attributes) */ if ((nPrefixes << 1) >> nsAttsPower) { /* true for nsAttsPower = 0 */ NS_ATT *temp;@@ -3394,7 +3437,28 @@ while (nPrefixes >> nsAttsPower++); if (nsAttsPower < 3) nsAttsPower = 3;- nsAttsSize = (int)1 << nsAttsPower;++ /* Detect and prevent invalid shift */+ if (parser->m_nsAttsPower >= sizeof(nsAttsSize) * 8 /* bits per byte */) {+ /* Restore actual size of memory in m_nsAtts */+ parser->m_nsAttsPower = oldNsAttsPower;+ return XML_ERROR_NO_MEMORY;+ }++ nsAttsSize = 1u << parser->m_nsAttsPower;++ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if (nsAttsSize > (size_t)(-1) / sizeof(NS_ATT)) {+ /* Restore actual size of memory in m_nsAtts */+ parser->m_nsAttsPower = oldNsAttsPower;+ return XML_ERROR_NO_MEMORY;+ }+#endif+ temp = (NS_ATT *)REALLOC(nsAtts, nsAttsSize * sizeof(NS_ATT)); if (!temp) return XML_ERROR_NO_MEMORY;@@ -3592,9 +3656,31 @@ tagNamePtr->prefixLen = prefixLen; for (i = 0; localPart[i++];) ; /* i includes null terminator */++ /* Detect and prevent integer overflow */+ if (binding->uriLen > INT_MAX - prefixLen+ || i > INT_MAX - (binding->uriLen + prefixLen)) {+ return XML_ERROR_NO_MEMORY;+ }+ n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { TAG *p;++ /* Detect and prevent integer overflow */+ if (n > INT_MAX - EXPAND_SPARE) {+ return XML_ERROR_NO_MEMORY;+ }+ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if ((unsigned)(n + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {+ return XML_ERROR_NO_MEMORY;+ }+#endif+ uri = (XML_Char *)MALLOC((n + EXPAND_SPARE) * sizeof(XML_Char)); if (!uri) return XML_ERROR_NO_MEMORY;@@ -3695,6 +3781,21 @@ if (freeBindingList) { b = freeBindingList; if (len > b->uriAlloc) {+ /* Detect and prevent integer overflow */+ if (len > INT_MAX - EXPAND_SPARE) {+ return XML_ERROR_NO_MEMORY;+ }++ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {+ return XML_ERROR_NO_MEMORY;+ }+#endif+ XML_Char *temp = (XML_Char *)REALLOC(b->uri, sizeof(XML_Char) * (len + EXPAND_SPARE)); if (temp == NULL)@@ -3708,6 +3809,21 @@ b = (BINDING *)MALLOC(sizeof(BINDING)); if (!b) return XML_ERROR_NO_MEMORY;++ /* Detect and prevent integer overflow */+ if (len > INT_MAX - EXPAND_SPARE) {+ return XML_ERROR_NO_MEMORY;+ }+ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if ((unsigned)(len + EXPAND_SPARE) > (size_t)(-1) / sizeof(XML_Char)) {+ return XML_ERROR_NO_MEMORY;+ }+#endif+ b->uri = (XML_Char *)MALLOC(sizeof(XML_Char) * (len + EXPAND_SPARE)); if (!b->uri) { FREE(b);@@ -5009,11 +5125,26 @@ case XML_ROLE_GROUP_OPEN: if (prologState.level >= groupSize) { if (groupSize) {+ /* Detect and prevent integer overflow */+ if (parser->m_groupSize > (unsigned int)(-1) / 2u) {+ return XML_ERROR_NO_MEMORY;+ }+ char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); if (temp == NULL) return XML_ERROR_NO_MEMORY; groupConnector = temp; if (dtd->scaffIndex) {+ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if (parser->m_groupSize > (size_t)(-1) / sizeof(int)) {+ return XML_ERROR_NO_MEMORY;+ }+#endif+ int *temp = (int *)REALLOC(dtd->scaffIndex, groupSize * sizeof(int)); if (temp == NULL)@@ -6003,7 +6134,24 @@ } else { DEFAULT_ATTRIBUTE *temp;++ /* Detect and prevent integer overflow */+ if (type->allocDefaultAtts > INT_MAX / 2) {+ return 0;+ }+ int count = type->allocDefaultAtts * 2;++ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if ((unsigned)count > (size_t)(-1) / sizeof(DEFAULT_ATTRIBUTE)) {+ return 0;+ }+#endif+ temp = (DEFAULT_ATTRIBUTE *) REALLOC(type->defaultAtts, (count * sizeof(DEFAULT_ATTRIBUTE))); if (temp == NULL)@@ -6654,8 +6802,20 @@ /* check for overflow (table is half full) */ if (table->used >> (table->power - 1)) { unsigned char newPower = table->power + 1;++ /* Detect and prevent invalid shift */+ if (newPower >= sizeof(unsigned long) * 8 /* bits per byte */) {+ return NULL;+ }+ size_t newSize = (size_t)1 << newPower; unsigned long newMask = (unsigned long)newSize - 1;++ /* Detect and prevent integer overflow */+ if (newSize > (size_t)(-1) / sizeof(NAMED *)) {+ return NULL;+ }+ size_t tsize = newSize * sizeof(NAMED *); NAMED **newV = (NAMED **)table->mem->malloc_fcn(tsize); if (!newV)@@ -6992,6 +7152,20 @@ if (dtd->scaffCount >= dtd->scaffSize) { CONTENT_SCAFFOLD *temp; if (dtd->scaffold) {+ /* Detect and prevent integer overflow */+ if (dtd->scaffSize > UINT_MAX / 2u) {+ return -1;+ }+ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if (dtd->scaffSize > (size_t)(-1) / 2u / sizeof(CONTENT_SCAFFOLD)) {+ return -1;+ }+#endif+ temp = (CONTENT_SCAFFOLD *) REALLOC(dtd->scaffold, dtd->scaffSize * 2 * sizeof(CONTENT_SCAFFOLD)); if (temp == NULL)@@ -7068,8 +7242,26 @@ XML_Content *ret; XML_Content *cpos; XML_Char * str;- int allocsize = (dtd->scaffCount * sizeof(XML_Content)- + (dtd->contentStringLen * sizeof(XML_Char)));++ /* Detect and prevent integer overflow.+ * The preprocessor guard addresses the "always false" warning+ * from -Wtype-limits on platforms where+ * sizeof(unsigned int) < sizeof(size_t), e.g. on x86_64. */+#if UINT_MAX >= SIZE_MAX+ if (dtd->scaffCount > (size_t)(-1) / sizeof(XML_Content)) {+ return NULL;+ }+ if (dtd->contentStringLen > (size_t)(-1) / sizeof(XML_Char)) {+ return NULL;+ }+#endif+ if (dtd->scaffCount * sizeof(XML_Content)+ > (size_t)(-1) - dtd->contentStringLen * sizeof(XML_Char)) {+ return NULL;+ }++ const size_t allocsize = (dtd->scaffCount * sizeof(XML_Content)+ + (dtd->contentStringLen * sizeof(XML_Char))); ret = (XML_Content *)MALLOC(allocsize); if (!ret)
Here's the analysis of the provided code diff for security fixes: 1. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 3213-3218] [Old Code] n = XmlGetAttributes(enc, attStr, attsSize, atts); if (n + nDefaultAtts > attsSize) { [Fixed Code] n = XmlGetAttributes(enc, attStr, attsSize, atts); if (n > INT_MAX - nDefaultAtts) { return XML_ERROR_NO_MEMORY; } if (n + nDefaultAtts > attsSize) { 2. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 3383-3389] [Old Code] int nsAttsSize = (int)1 << nsAttsPower; [Fixed Code] if (parser->m_nsAttsPower >= sizeof(unsigned int) * 8) { return XML_ERROR_NO_MEMORY; } unsigned int nsAttsSize = 1u << nsAttsPower; 3. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 3394-3445] [Old Code] nsAttsSize = (int)1 << nsAttsPower; [Fixed Code] if (parser->m_nsAttsPower >= sizeof(nsAttsSize) * 8) { parser->m_nsAttsPower = oldNsAttsPower; return XML_ERROR_NO_MEMORY; } nsAttsSize = 1u << parser->m_nsAttsPower; if (nsAttsSize > (size_t)(-1) / sizeof(NS_ATT)) { parser->m_nsAttsPower = oldNsAttsPower; return XML_ERROR_NO_MEMORY; } 4. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 3592-3603] [Old Code] n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { [Fixed Code] if (binding->uriLen > INT_MAX - prefixLen || i > INT_MAX - (binding->uriLen + prefixLen)) { return XML_ERROR_NO_MEMORY; } n = i + binding->uriLen + prefixLen; if (n > binding->uriAlloc) { 5. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 5009-5017] [Old Code] char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); [Fixed Code] if (parser->m_groupSize > (unsigned int)(-1) / 2u) { return XML_ERROR_NO_MEMORY; } char *temp = (char *)REALLOC(groupConnector, groupSize *= 2); 6. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 6654-6663] [Old Code] unsigned char newPower = table->power + 1; size_t newSize = (size_t)1 << newPower; [Fixed Code] if (newPower >= sizeof(unsigned long) * 8) { return NULL; } size_t newSize = (size_t)1 << newPower; if (newSize > (size_t)(-1) / sizeof(NAMED *)) { return NULL; } 7. Vulnerability Existed: yes Integer Overflow [File] parser/expat/lib/xmlparse.c [Lines 7068-7079] [Old Code] int allocsize = (dtd->scaffCount * sizeof(XML_Content) + (dtd->contentStringLen * sizeof(XML_Char))); [Fixed Code] if (dtd->scaffCount > (size_t)(-1) / sizeof(XML_Content)) { return NULL; } if (dtd->contentStringLen > (size_t)(-1) / sizeof(XML_Char)) { return NULL; } if (dtd->scaffCount * sizeof(XML_Content) > (size_t)(-1) - dtd->contentStringLen * sizeof(XML_Char)) { return NULL; } const size_t allocsize = (dtd->scaffCount * sizeof(XML_Content) + (dtd->contentStringLen * sizeof(XML_Char))); The diff shows multiple fixes for integer overflow vulnerabilities throughout the file. Each fix adds checks to prevent potential integer overflows during memory allocation and size calculations, which could lead to buffer overflows or memory corruption vulnerabilities. The fixes involve adding bounds checking before arithmetic operations and memory allocations.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/css/mediaqueries/mq-gamut-003.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/css/mediaqueries/mq-gamut-003.html@@ -6,7 +6,6 @@ <link rel="help" href="https://github.com/w3c/csswg-drafts/issues/276"> <link rel="match" href="../reference/ref-filled-green-100px-square.xht"> <meta name="assert" content="the dci-p3 (old name for p3) color-gamut is not syntactically supported">-<meta name="flags" content=""> <style> div { width: 100px;
Based on the provided code diff, I'll analyze it for potential security vulnerabilities: Vulnerability Existed: no No specific vulnerability found [File] testing/web-platform/tests/css/mediaqueries/mq-gamut-003.html [Lines] 6 [Old Code] <meta name="flags" content=""> [Fixed Code] (line removed) Additional Details: 1. The change simply removes an empty meta tag for "flags" which doesn't appear to have any security implications. 2. This appears to be a test file cleanup rather than a security fix. 3. No known vulnerability patterns are present in this change. 4. The modification doesn't affect any security-sensitive functionality. The change seems to be purely cosmetic/cleanup related, removing an unused or unnecessary meta tag from the test file. There's no indication this was fixing any security issue.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/third_party/rust/bumpalo/src/lib.rs+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/third_party/rust/bumpalo/src/lib.rs@@ -1,222 +1,4 @@-/*!--**A fast bump allocation arena for Rust.**--[](https://docs.rs/bumpalo/)-[](https://crates.io/crates/bumpalo)-[](https://crates.io/crates/bumpalo)-[](https://github.com/fitzgen/bumpalo/actions?query=workflow%3ARust)----## Bump Allocation--Bump allocation is a fast, but limited approach to allocation. We have a chunk-of memory, and we maintain a pointer within that memory. Whenever we allocate an-object, we do a quick test that we have enough capacity left in our chunk to-allocate the object and then update the pointer by the object's size. *That's-it!*--The disadvantage of bump allocation is that there is no general way to-deallocate individual objects or reclaim the memory region for a-no-longer-in-use object.--These trade offs make bump allocation well-suited for *phase-oriented*-allocations. That is, a group of objects that will all be allocated during the-same program phase, used, and then can all be deallocated together as a group.--## Deallocation en Masse, but No `Drop`--To deallocate all the objects in the arena at once, we can simply reset the bump-pointer back to the start of the arena's memory chunk. This makes mass-deallocation *extremely* fast, but allocated objects' `Drop` implementations are-not invoked.--> **However:** [`bumpalo::boxed::Box<T>`][crate::boxed::Box] can be used to wrap-> `T` values allocated in the `Bump` arena, and calls `T`'s `Drop`-> implementation when the `Box<T>` wrapper goes out of scope. This is similar to-> how [`std::boxed::Box`] works, except without deallocating its backing memory.--[`std::boxed::Box`]: https://doc.rust-lang.org/std/boxed/struct.Box.html--## What happens when the memory chunk is full?--This implementation will allocate a new memory chunk from the global allocator-and then start bump allocating into this new memory chunk.--## Example--```-use bumpalo::Bump;-use std::u64;--struct Doggo {- cuteness: u64,- age: u8,- scritches_required: bool,-}--// Create a new arena to bump allocate into.-let bump = Bump::new();--// Allocate values into the arena.-let scooter = bump.alloc(Doggo {- cuteness: u64::max_value(),- age: 8,- scritches_required: true,-});--// Exclusive, mutable references to the just-allocated value are returned.-assert!(scooter.scritches_required);-scooter.age += 1;-```--## Collections--When the `"collections"` cargo feature is enabled, a fork of some of the `std`-library's collections are available in the `collections` module. These-collection types are modified to allocate their space inside `bumpalo::Bump`-arenas.--```rust-# #[cfg(feature = "collections")]-# {-use bumpalo::{Bump, collections::Vec};--// Create a new bump arena.-let bump = Bump::new();--// Create a vector of integers whose storage is backed by the bump arena. The-// vector cannot outlive its backing arena, and this property is enforced with-// Rust's lifetime rules.-let mut v = Vec::new_in(&bump);--// Push a bunch of integers onto `v`!-for i in 0..100 {- v.push(i);-}-# }-```--Eventually [all `std` collection types will be parameterized by an-allocator](https://github.com/rust-lang/rust/issues/42774) and we can remove-this `collections` module and use the `std` versions.--For unstable, nightly-only support for custom allocators in `std`, see the-`allocator_api` section below.--## `bumpalo::boxed::Box`--When the `"boxed"` cargo feature is enabled, a fork of `std::boxed::Box` library-is available in the `boxed` module. This `Box` type is modified to allocate its-space inside `bumpalo::Bump` arenas.--**A `Box<T>` runs `T`'s drop implementation when the `Box<T>` is dropped.** You-can use this to work around the fact that `Bump` does not drop values allocated-in its space itself.--```rust-# #[cfg(feature = "boxed")]-# {-use bumpalo::{Bump, boxed::Box};-use std::sync::atomic::{AtomicUsize, Ordering};--static NUM_DROPPED: AtomicUsize = AtomicUsize::new(0);--struct CountDrops;--impl Drop for CountDrops {- fn drop(&mut self) {- NUM_DROPPED.fetch_add(1, Ordering::SeqCst);- }-}--// Create a new bump arena.-let bump = Bump::new();--// Create a `CountDrops` inside the bump arena.-let mut c = Box::new_in(CountDrops, &bump);--// No `CountDrops` have been dropped yet.-assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 0);--// Drop our `Box<CountDrops>`.-drop(c);--// Its `Drop` implementation was run, and so `NUM_DROPS` has been incremented.-assert_eq!(NUM_DROPPED.load(Ordering::SeqCst), 1);-# }-```--## `#![no_std]` Support--Bumpalo is a `no_std` crate. It depends only on the `alloc` and `core` crates.--## Thread support--The `Bump` is `!Sync`, which makes it hard to use in certain situations around threads ‒ for-example in `rayon`.--The [`bumpalo-herd`](https://crates.io/crates/bumpalo-herd) crate provides a pool of `Bump`-allocators for use in such situations.--## Nightly Rust `feature(allocator_api)` Support--The unstable, nightly-only Rust `allocator_api` feature defines an `Allocator`-trait and exposes custom allocators for `std` types. Bumpalo has a matching-`allocator_api` cargo feature to enable implementing `Allocator` and using-`Bump` with `std` collections. Note that, as `feature(allocator_api)` is-unstable and only in nightly Rust, Bumpalo's matching `allocator_api` cargo-feature should be considered unstable, and will not follow the semver-conventions that the rest of the crate does.--First, enable the `allocator_api` feature in your `Cargo.toml`:--```toml-[dependencies]-bumpalo = { version = "3.4.0", features = ["allocator_api"] }-```--Next, enable the `allocator_api` nightly Rust feature in your `src/lib.rs` or `src/main.rs`:--```rust-# #[cfg(feature = "allocator_api")]-# {-#![feature(allocator_api)]-# }-```--Finally, use `std` collections with `Bump`, so that their internal heap-allocations are made within the given bump arena:--```-# #![cfg_attr(feature = "allocator_api", feature(allocator_api))]-# #[cfg(feature = "allocator_api")]-# {-#![feature(allocator_api)]-use bumpalo::Bump;--// Create a new bump arena.-let bump = Bump::new();--// Create a `Vec` whose elements are allocated within the bump arena.-let mut v = Vec::new_in(&bump);-v.push(0);-v.push(1);-v.push(2);-# }-```--### Minimum Supported Rust Version (MSRV)--This crate is guaranteed to compile on stable Rust 1.44 and up. It might compile-with older versions but that may change in any new patch release.--We reserve the right to increment the MSRV on minor releases, however we will strive-to only do it deliberately and for good reasons.-- */-+#![doc = include_str!("../README.md")] #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![no_std]@@ -420,7 +202,7 @@ /// /// Even when optimizations are on, these functions do not **guarantee** that /// the value is constructed on the heap. To the best of our knowledge no such-/// guarantee can be made in stable Rust as of 1.44.+/// guarantee can be made in stable Rust as of 1.51. /// /// ### Fallible Initialization: The `_try_with` Method Suffix ///
After analyzing the diff, I don't see any security vulnerabilities being fixed. The changes appear to be primarily documentation-related and version updates. Here's the analysis: 1. Vulnerability Existed: no The diff shows a major documentation restructuring where the entire module documentation was replaced with a single include directive (`#![doc = include_str!("../README.md")]`). No security-related changes were made. 2. Vulnerability Existed: no The only other change was updating the minimum supported Rust version comment from 1.44 to 1.51 (`// guarantee can be made in stable Rust as of 1.44` to `// guarantee can be made in stable Rust as of 1.51`). This is a version update, not a security fix. The diff doesn't show any code changes that would indicate security vulnerabilities being fixed - it's primarily documentation reorganization and version updates. The actual allocation and memory management code remains unchanged in the visible portion of the diff.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/browser/components/newtab/content-src/components/Base/Base.jsx+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/browser/components/newtab/content-src/components/Base/Base.jsx@@ -178,6 +178,7 @@ filteredSections.filter(section => section.enabled).length === 0; const searchHandoffEnabled = prefs["improvesearch.handoffToAwesomebar"]; const showCustomizationMenu = this.state.customizeMenuVisible;+ const showColorwayCloset = prefs["colorway-closet.enabled"]; const enabledSections = { topSitesEnabled: prefs["feeds.topsites"], pocketEnabled: prefs["feeds.section.topstories"],@@ -220,6 +221,7 @@ pocketRegion={pocketRegion} mayHaveSponsoredTopSites={mayHaveSponsoredTopSites} showing={showCustomizationMenu}+ showColorwayCloset={showColorwayCloset} /> {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions*/} <div className={outerClassName} onClick={this.closeCustomizationMenu}>
Based on the provided code diff, I don't see any clear security vulnerabilities being fixed. The changes appear to be feature-related additions rather than security patches. Here's the analysis: Vulnerability Existed: no [No security vulnerability found] [browser/components/newtab/content-src/components/Base/Base.jsx] [Lines 178-221] [Old Code] [No security-related changes were made in this diff] The changes in the diff are: 1. Adding a new pref check for "colorway-closet.enabled" 2. Passing this new prop to the component These changes appear to be related to feature functionality (likely adding support for color themes/customization) rather than addressing any security issues. There are no: - Input validation changes - Security-related API changes - Vulnerability mitigations - Security-related logic changes - Dangerous function removals The changes are purely additive and don't modify any existing security-sensitive code paths.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/third_party/rust/glow/.cargo-checksum.json+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/third_party/rust/glow/.cargo-checksum.json@@ -1 +1 @@-{"files":{".github/FUNDING.yml":"c4bfbf64e3a1139bab67f2f6d04b3cd33bf587d7102ad52896cbbac4cb9a960f",".github/workflows/ci.yml":"fe1cfbdc70be5d6df7029894e49c66ce2f4700560b9dab11d159f613f8797b38","Cargo.toml":"8a98d52a54c933b84a7aeb50fc379fb2b8845a6ae484bfeaece1dee65820c1d9","LICENSE-APACHE":"769f80b5bcb42ed0af4e4d2fd74e1ac9bf843cb80c5a29219d1ef3544428a6bb","LICENSE-MIT":"30fefc3a7d6a0041541858293bcbea2dde4caa4c0a5802f996a7f7e8c0085652","README.md":"964d3a8155cb7b60102f5a5b34cf0376a81cca0a0aa8592a430e18e389553722","bors.toml":"06209f3018713efa5d526970d51676ab8cd618e05d01e56474539b6778406565","clippy.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/gl46.rs":"2c9fa79c1c0686ee5268af950f294b56acc57fd86857d6dff5e870f48ee59f43","src/lib.rs":"d4391649f2cb788238f2d91bb71d7d5a2f45fda6b2e8ef9f4f43f5d16053d3f0","src/native.rs":"64c45e9d3ecbac0ec75ce300ae844fe659e44e7a06683543d22a67e4fc053b73","src/version.rs":"4adcda91205727be9b984f40e1c5e7b23c7502e7c49b2606c373d3fa4f7679e7","src/web_sys.rs":"294e8646e4a83e14226b6bdbeda3aff2d84fee8e180ea12cfd5f0ad145eab254"},"package":null}+{"files":{"Cargo.toml":"2ff6da0f7927418e38b605f804303d65b2fe9e47826a4ea812db7a8b166dcd96","LICENSE-APACHE":"b8601fc79bdf8d8088f0938bea861ffc63ed0eebbedf25f44ab2cf2e85bd7edc","LICENSE-MIT":"cdbd06e25b8c9c5d6019949d2de8123f56d29cee4166396423d2ba8c81700845","README.md":"2ac1eb0ed3d808c5e55e1dd47c893c32ed6975b3285c016c518b117979d9f282","bors.toml":"1a13121a179fff004a1b8b9b507eee1834c7a0c6ffdd99d94e9fc74defd8fa02","clippy.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/gl46.rs":"3fda7232f6dbea4e63361eb5ed12220c3c2fb6cda3fa77f19e9320cb77e85802","src/lib.rs":"3a2e3f258a78ec5e6c4f3a175425f7c77d35036a0d7d71b15d6a9fcb0d340702","src/native.rs":"c8d63076655ab6cde4f2ae63f064b0c2c0482163d1f5c488bb13f91a7c74016c","src/version.rs":"0c2694e3897170b8f22d8e615ca862e169cd8b28c8f15cc1180f0da29c92905a","src/web_sys.rs":"75bc06897931a4b1fcee136658e31e87610c9af164a6ac64fc0654a231fbefd7"},"package":"d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919"}=========testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html========--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html@@ -17,14 +17,14 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); ctx.fillStyle = '#f00'; ctx.fillStyle = 'rgb(0, 255, 0, 20%)'; ctx.fillRect(0, 0, 100, 50);-_assertPixel(offscreenCanvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51");+_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); t.done(); });
After analyzing the provided code diff, I don't find any clear security vulnerabilities. The changes appear to be either file checksum updates or minor variable renaming in test code. Here's the structured analysis: 1. For the cargo-checksum.json changes: Vulnerability Existed: no [No security vulnerability found] [third_party/rust/glow/.cargo-checksum.json] [All lines] [Old checksums and package info] [Updated checksums and package info] (Note: Checksum updates are normal maintenance and don't indicate security fixes) 2. For the HTML test file changes: Vulnerability Existed: no [No security vulnerability found] [testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html] [Lines 17-27] [Old variable name 'offscreenCanvas'] [New variable name 'canvas'] (Note: This is just a variable renaming in test code with no security implications) The changes don't appear to address any security vulnerabilities but rather represent routine updates and code maintenance. No CVE or specific vulnerability patterns are evident in these changes.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html@@ -17,8 +17,8 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); ctx.fillStyle = '#0f0'; ctx.fillRect(0, 0, 100, 50);@@ -27,11 +27,11 @@ ctx.beginPath(); ctx.arc(0, 50, 50, 0, -Math.PI/2, false); ctx.stroke();-_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");-_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");-_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");-_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");-_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); t.done(); });
After analyzing the provided code diff, I don't find any security vulnerabilities. The changes appear to be purely cosmetic, renaming a variable from `offscreenCanvas` to `canvas` and updating the corresponding references. Here's the analysis following your requested format: Vulnerability Existed: no [No security vulnerability found] [testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html] [Lines 17-27] [Old Code: var offscreenCanvas = new OffscreenCanvas(100, 50); ... _assertPixel(offscreenCanvas, ...)] [Fixed Code: var canvas = new OffscreenCanvas(100, 50); ... _assertPixel(canvas, ...)] This change doesn't affect security but rather improves code consistency or readability by using a shorter variable name. The functionality remains exactly the same, just with a different variable name.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/gfx/wr/webrender/src/hit_test.rs+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/gfx/wr/webrender/src/hit_test.rs@@ -391,51 +391,52 @@ } // Only consider hit tests on transformable layers.- if let Some(point_in_layer) = point_in_layer {- // If the item's rect or clip rect don't contain this point,- // it's not a valid hit.- if !item.rect.contains(point_in_layer) {- continue;- }- if !item.clip_rect.contains(point_in_layer) {- continue;- }-- // See if any of the clips for this primitive cull out the item.- let mut is_valid = true;- let clip_nodes = &self.scene.clip_nodes[item.clip_nodes_range.start.0 as usize .. item.clip_nodes_range.end.0 as usize];- for clip_node in clip_nodes {- let transform = self- .spatial_nodes[&clip_node.spatial_node_index]- .world_content_transform;- let transformed_point = match transform- .inverse()- .and_then(|inverted| inverted.transform_point2d(test.point))- {- Some(point) => point,- None => {- continue;- }- };- if !clip_node.region.contains(&transformed_point) {- is_valid = false;- break;- }- }- if !is_valid {- continue;- }-- // Don't hit items with backface-visibility:hidden if they are facing the back.- if !item.is_backface_visible && scroll_node.world_content_transform.is_backface_visible() {- continue;- }-- result.items.push(HitTestItem {- pipeline: pipeline_id,- tag: item.tag,- });- }+ let point_in_layer = match point_in_layer {+ Some(p) => p,+ None => continue,+ };++ // If the item's rect or clip rect don't contain this point, it's+ // not a valid hit.+ if !item.rect.contains(point_in_layer) {+ continue;+ }++ if !item.clip_rect.contains(point_in_layer) {+ continue;+ }++ // See if any of the clips for this primitive cull out the item.+ let clip_nodes = &self.scene.clip_nodes[item.clip_nodes_range.start.0 as usize .. item.clip_nodes_range.end.0 as usize];+ let is_valid = clip_nodes.iter().all(|clip_node| {+ let transform = self+ .spatial_nodes[&clip_node.spatial_node_index]+ .world_content_transform;+ let transformed_point = match transform+ .inverse()+ .and_then(|inverted| inverted.transform_point2d(test.point))+ {+ Some(point) => point,+ // XXX This `return true` is a bit sketchy, but matches+ // pre-existing behavior.+ None => return true,+ };+ clip_node.region.contains(&transformed_point)+ });++ if !is_valid {+ continue;+ }++ // Don't hit items with backface-visibility:hidden if they are facing the back.+ if !item.is_backface_visible && scroll_node.world_content_transform.is_backface_visible() {+ continue;+ }++ result.items.push(HitTestItem {+ pipeline: pipeline_id,+ tag: item.tag,+ }); } result.items.dedup();
Let me analyze the code diff for potential security vulnerabilities: 1. Vulnerability Existed: not sure Potential Logic Error in Clip Node Validation [gfx/wr/webrender/src/hit_test.rs] [Lines 391-439] Old Code: ```rust let mut is_valid = true; for clip_node in clip_nodes { let transform = self .spatial_nodes[&clip_node.spatial_node_index] .world_content_transform; let transformed_point = match transform .inverse() .and_then(|inverted| inverted.transform_point2d(test.point)) { Some(point) => point, None => { continue; } }; if !clip_node.region.contains(&transformed_point) { is_valid = false; break; } } ``` Fixed Code: ```rust let is_valid = clip_nodes.iter().all(|clip_node| { let transform = self .spatial_nodes[&clip_node.spatial_node_index] .world_content_transform; let transformed_point = match transform .inverse() .and_then(|inverted| inverted.transform_point2d(test.point)) { Some(point) => point, None => return true, }; clip_node.region.contains(&transformed_point) }); ``` The main change here is in how clip node validation is handled. The old code would skip nodes where the transform couldn't be inverted, while the new code treats them as valid (returning true). This could potentially affect security if it changes which items are considered hittable, but I'm not sure if this constitutes a security vulnerability. 2. Vulnerability Existed: no Code Refactoring (No Security Impact) [gfx/wr/webrender/src/hit_test.rs] [Lines 391-439] The rest of the changes appear to be code refactoring (changing if-let to match, using iterator.all() instead of manual loop) without any security implications. The logic remains functionally equivalent except for the clip node validation change noted above.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/accessible/generic/HyperTextAccessible.cpp+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/accessible/generic/HyperTextAccessible.cpp@@ -206,22 +206,22 @@ return states; }-nsIntRect HyperTextAccessible::GetBoundsInFrame(nsIFrame* aFrame,- uint32_t aStartRenderedOffset,- uint32_t aEndRenderedOffset) {+LayoutDeviceIntRect HyperTextAccessible::GetBoundsInFrame(+ nsIFrame* aFrame, uint32_t aStartRenderedOffset,+ uint32_t aEndRenderedOffset) { nsPresContext* presContext = mDoc->PresContext(); if (!aFrame->IsTextFrame()) {- return aFrame->GetScreenRectInAppUnits().ToNearestPixels(- presContext->AppUnitsPerDevPixel());+ return LayoutDeviceIntRect::FromAppUnitsToNearest(+ aFrame->GetScreenRectInAppUnits(), presContext->AppUnitsPerDevPixel()); } // Substring must be entirely within the same text node. int32_t startContentOffset, endContentOffset; nsresult rv = RenderedToContentOffset(aFrame, aStartRenderedOffset, &startContentOffset);- NS_ENSURE_SUCCESS(rv, nsIntRect());+ NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); rv = RenderedToContentOffset(aFrame, aEndRenderedOffset, &endContentOffset);- NS_ENSURE_SUCCESS(rv, nsIntRect());+ NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); nsIFrame* frame; int32_t startContentOffsetInFrame;@@ -229,7 +229,7 @@ // the primary frame passed in rv = aFrame->GetChildFrameContainingOffset( startContentOffset, false, &startContentOffsetInFrame, &frame);- NS_ENSURE_SUCCESS(rv, nsIntRect());+ NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); nsRect screenRect; while (frame && startContentOffset < endContentOffset) {@@ -248,13 +248,13 @@ // Add the point where the string starts to the frameScreenRect nsPoint frameTextStartPoint; rv = frame->GetPointFromOffset(startContentOffset, &frameTextStartPoint);- NS_ENSURE_SUCCESS(rv, nsIntRect());+ NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); // Use the point for the end offset to calculate the width nsPoint frameTextEndPoint; rv = frame->GetPointFromOffset(startContentOffset + frameSubStringLength, &frameTextEndPoint);- NS_ENSURE_SUCCESS(rv, nsIntRect());+ NS_ENSURE_SUCCESS(rv, LayoutDeviceIntRect()); frameScreenRect.SetRectX( frameScreenRect.X() +@@ -269,7 +269,8 @@ frame = frame->GetNextContinuation(); }- return screenRect.ToNearestPixels(presContext->AppUnitsPerDevPixel());+ return LayoutDeviceIntRect::FromAppUnitsToNearest(+ screenRect, presContext->AppUnitsPerDevPixel()); } uint32_t HyperTextAccessible::DOMPointToOffset(nsINode* aNode,@@ -919,6 +920,16 @@ int32_t* aStartOffset, int32_t* aEndOffset, nsAString& aText) {+ if (StaticPrefs::accessibility_cache_enabled_AtStartup() &&+ (aBoundaryType == nsIAccessibleText::BOUNDARY_WORD_START ||+ aBoundaryType == nsIAccessibleText::BOUNDARY_LINE_START)) {+ // This isn't strictly related to caching, but this new text implementation+ // is being developed to make caching feasible. We put it behind this pref+ // to make it easy to test while it's still under development.+ return HyperTextAccessibleBase::TextBeforeOffset(+ aOffset, aBoundaryType, aStartOffset, aEndOffset, aText);+ }+ *aStartOffset = *aEndOffset = 0; aText.Truncate();@@ -1095,6 +1106,16 @@ int32_t* aStartOffset, int32_t* aEndOffset, nsAString& aText) {+ if (StaticPrefs::accessibility_cache_enabled_AtStartup() &&+ (aBoundaryType == nsIAccessibleText::BOUNDARY_WORD_START ||+ aBoundaryType == nsIAccessibleText::BOUNDARY_LINE_START)) {+ // This isn't strictly related to caching, but this new text implementation+ // is being developed to make caching feasible. We put it behind this pref+ // to make it easy to test while it's still under development.+ return HyperTextAccessibleBase::TextAfterOffset(+ aOffset, aBoundaryType, aStartOffset, aEndOffset, aText);+ }+ *aStartOffset = *aEndOffset = 0; aText.Truncate();@@ -1424,12 +1445,12 @@ nsIFrame* hyperFrame = GetFrame(); if (!hyperFrame) return -1;- nsIntPoint coords =+ LayoutDeviceIntPoint coords = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordType, this); nsPresContext* presContext = mDoc->PresContext();- nsPoint coordsInAppUnits =- ToAppUnits(coords, presContext->AppUnitsPerDevPixel());+ nsPoint coordsInAppUnits = LayoutDeviceIntPoint::ToAppUnits(+ coords, presContext->AppUnitsPerDevPixel()); nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits(); if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y)) {@@ -1485,15 +1506,15 @@ return -1; // Not found }-nsIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset,- int32_t aEndOffset,- uint32_t aCoordType) {+LayoutDeviceIntRect HyperTextAccessible::TextBounds(int32_t aStartOffset,+ int32_t aEndOffset,+ uint32_t aCoordType) { index_t startOffset = ConvertMagicOffset(aStartOffset); index_t endOffset = ConvertMagicOffset(aEndOffset); if (!startOffset.IsValid() || !endOffset.IsValid() || startOffset > endOffset || endOffset > CharacterCount()) { NS_ERROR("Wrong in offset");- return nsIntRect();+ return LayoutDeviceIntRect(); } if (CharacterCount() == 0) {@@ -1501,16 +1522,16 @@ // Empty content, use our own bound to at least get x,y coordinates nsIFrame* frame = GetFrame(); if (!frame) {- return nsIntRect();- }- return frame->GetScreenRectInAppUnits().ToNearestPixels(- presContext->AppUnitsPerDevPixel());+ return LayoutDeviceIntRect();+ }+ return LayoutDeviceIntRect::FromAppUnitsToNearest(+ frame->GetScreenRectInAppUnits(), presContext->AppUnitsPerDevPixel()); } int32_t childIdx = GetChildIndexAtOffset(startOffset);- if (childIdx == -1) return nsIntRect();-- nsIntRect bounds;+ if (childIdx == -1) return LayoutDeviceIntRect();++ LayoutDeviceIntRect bounds; int32_t prevOffset = GetChildOffset(childIdx); int32_t offset1 = startOffset - prevOffset;@@ -1540,8 +1561,9 @@ // screen coordinates. nsPresContext* presContext = mDoc->PresContext(); nsIFrame* rootFrame = presContext->PresShell()->GetRootFrame();- nsIntRect orgRectPixels =- rootFrame->GetScreenRectInAppUnits().ToNearestPixels(+ LayoutDeviceIntRect orgRectPixels =+ LayoutDeviceIntRect::FromAppUnitsToNearest(+ rootFrame->GetScreenRectInAppUnits(), presContext->AppUnitsPerDevPixel()); bounds.MoveBy(-orgRectPixels.X(), -orgRectPixels.Y()); bounds.ScaleRoundOut(presContext->PresShell()->GetResolution());@@ -1803,7 +1825,7 @@ // focus. return LayoutDeviceIntRect(); }- nsIntRect charRect = CharBounds(+ LayoutDeviceIntRect charRect = CharBounds( caretOffset, nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE); if (!charRect.IsEmpty()) { caretRect.SetTopEdge(charRect.Y());@@ -1945,7 +1967,7 @@ nsIFrame* frame = GetFrame(); if (!frame) return;- nsIntPoint coords =+ LayoutDeviceIntPoint coords = nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this); RefPtr<nsRange> domRange = nsRange::Create(mContent);@@ -1955,8 +1977,8 @@ } nsPresContext* presContext = frame->PresContext();- nsPoint coordsInAppUnits =- ToAppUnits(coords, presContext->AppUnitsPerDevPixel());+ nsPoint coordsInAppUnits = LayoutDeviceIntPoint::ToAppUnits(+ coords, presContext->AppUnitsPerDevPixel()); bool initialScrolled = false; nsIFrame* parentFrame = frame;
Here's the analysis of the provided code diff: 1. Vulnerability Existed: no Type Conversion Improvement [HyperTextAccessible.cpp] [206-269] Old Code: Using nsIntRect and direct pixel conversion Fixed Code: Using LayoutDeviceIntRect with proper conversion methods 2. Vulnerability Existed: no Boundary Check Improvement [HyperTextAccessible.cpp] [919-920, 1095-1096] Old Code: Missing boundary type checks for text operations Fixed Code: Added boundary type checks with accessibility_cache_enabled pref 3. Vulnerability Existed: no Coordinate System Improvement [HyperTextAccessible.cpp] [1424-1425, 1485-1486, 1803-1804, 1945-1946] Old Code: Using nsIntPoint for coordinates Fixed Code: Using LayoutDeviceIntPoint for more precise coordinate handling 4. Vulnerability Existed: no Return Type Consistency [HyperTextAccessible.cpp] [1485-1506] Old Code: Returning nsIntRect for text bounds Fixed Code: Returning LayoutDeviceIntRect for consistent coordinate handling The changes appear to be primarily about improving type safety and consistency in coordinate handling rather than fixing security vulnerabilities. The modifications involve: 1. Switching from nsIntRect to LayoutDeviceIntRect 2. Adding boundary checks for text operations 3. Improving coordinate system handling 4. Making return types more consistent These changes are more about code quality and maintainability than security fixes. No specific security vulnerabilities are being addressed in this diff.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/remote/doc/marionette/PythonTests.md+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/remote/doc/marionette/PythonTests.md@@ -13,8 +13,8 @@ You can additionally define [`setUp`] and [`tearDown`] instance methods to execute code before and after child tests, and [`setUpClass`]/[`tearDownClass`] for the parent test. When you use-these, it is important to remember calling the [`MarionetteTestCase`]-superclass’ own `setUp`/`tearDown` methods since they handle+these, it is important to remember calling the `MarionetteTestCase`+superclass’ own [`setUp`]/[`tearDown`] methods since they handle setup/cleanup of the session. The test structure is illustrated here:@@ -36,12 +36,12 @@ # code to execute after all tests are run MarionetteTestCase.tearDown(self)-[remote protocol]: Protocol.html-[unittest]: https://docs.python.org/2.7/library/unittest.html-[`setUp`]: https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.setUp-[`setUpClass`]: https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.setUpClass-[`tearDown`]: https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.tearDown-[`tearDownClass`]: https://docs.python.org/2.7/library/unittest.html#unittest.TestCase.tearDownClass+[remote protocol]: Protocol.md+[unittest]: https://docs.python.org/3/library/unittest.html+[`setUp`]: https://docs.python.org/3/library/unittest.html#unittest.TestCase.setUp+[`setUpClass`]: https://docs.python.org/3/library/unittest.html#unittest.TestCase.setUpClass+[`tearDown`]: https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDown+[`tearDownClass`]: https://docs.python.org/3/library/unittest.html#unittest.TestCase.tearDownClass Test assertions@@ -67,5 +67,5 @@ * [`Marionette`]: client that speaks to Firefox.-[here]: ../../../python/marionette_driver.html-[`Marionette`]: ../../../python/marionette_driver.html#marionette_driver.marionette.Marionette+[here]: /python/marionette_driver.rst+[`Marionette`]: /python/marionette_driver.rst#marionette_driver.marionette.Marionette
After analyzing the provided code diff, I don't find any security vulnerabilities. The changes appear to be documentation updates and link corrections. Here's the analysis: 1. Vulnerability Existed: no Documentation Update [File: remote/doc/marionette/PythonTests.md] [Lines: 13-14, 36-41, 67-68] Old Code: References to Python 2.7 documentation and old file paths Fixed Code: Updated to Python 3 documentation and corrected file paths The changes include: - Changing references from Python 2.7 to Python 3 documentation - Updating file paths from .html to .md/.rst extensions - Minor formatting changes in method references These are all documentation improvements with no security implications. The changes don't affect any actual code execution or introduce/remove any security-related functionality. No security vulnerabilities were identified in this documentation-only diff.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/devtools/client/debugger/src/selectors/breakpointSources.js+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/devtools/client/debugger/src/selectors/breakpointSources.js@@ -3,11 +3,11 @@ * file, You can obtain one at <http://mozilla.org/MPL/2.0/>. */ import { createSelector } from "reselect";-import { getBreakpointsList, getSelectedSource } from "../selectors";+import { getSelectedSource, getSourceFromId } from "../selectors/sources";+import { getBreakpointsList } from "../selectors/breakpoints"; import { getFilename } from "../utils/source"; import { getSelectedLocation } from "../utils/selected-location"; import { sortSelectedBreakpoints } from "../utils/breakpoint";-import { getSourceFromId } from "../reducers/sources"; function getBreakpointsForSource(source, selectedSource, breakpoints) { return sortSelectedBreakpoints(breakpoints, selectedSource)
Let me analyze the code diff for security fixes: 1. Vulnerability Existed: not sure [Potential Import Restructuring] [devtools/client/debugger/src/selectors/breakpointSources.js] [Lines 3-8] [Old Code] import { createSelector } from "reselect"; import { getBreakpointsList, getSelectedSource } from "../selectors"; import { getFilename } from "../utils/source"; import { getSelectedLocation } from "../utils/selected-location"; import { sortSelectedBreakpoints } from "../utils/breakpoint"; import { getSourceFromId } from "../reducers/sources"; [Fixed Code] import { createSelector } from "reselect"; import { getSelectedSource, getSourceFromId } from "../selectors/sources"; import { getBreakpointsList } from "../selectors/breakpoints"; import { getFilename } from "../utils/source"; import { getSelectedLocation } from "../utils/selected-location"; import { sortSelectedBreakpoints } from "../utils/breakpoint"; Note: While this appears to be primarily a code organization change (moving imports to more specific files), it could potentially address: 1. Circular dependency issues 2. Better separation of concerns 3. More maintainable import structure However, I cannot definitively identify a specific security vulnerability being fixed here. The changes seem more related to code organization than security fixes.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html@@ -17,8 +17,8 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); let fonts = (self.fonts ? self.fonts : document.fonts);@@ -30,10 +30,10 @@ ctx.fillRect(0, 0, 100, 50); ctx.fillStyle = '#0f0'; ctx.fillText('DD', 0, 37.5, 100);- _assertPixelApprox(offscreenCanvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);- _assertPixelApprox(offscreenCanvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);- _assertPixelApprox(offscreenCanvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);- _assertPixelApprox(offscreenCanvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); }).then(t_pass, t_fail); });
Analysis of the provided code diff: 1. Vulnerability Existed: no Variable Renaming [File: testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html] [Lines: 17-18, 30-33] Old Code: var offscreenCanvas = new OffscreenCanvas(100, 50); var ctx = offscreenCanvas.getContext('2d'); _assertPixelApprox(offscreenCanvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2); _assertPixelApprox(offscreenCanvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2); _assertPixelApprox(offscreenCanvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); _assertPixelApprox(offscreenCanvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); Fixed Code: var canvas = new OffscreenCanvas(100, 50); var ctx = canvas.getContext('2d'); _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2); _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2); _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); Additional Details: - The changes appear to be purely cosmetic, renaming the variable `offscreenCanvas` to `canvas` for consistency or clarity. - No security vulnerabilities are introduced or fixed by this change. - The functionality remains identical, just with a different variable name. - The assertions and canvas operations remain unchanged in their behavior.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/third_party/rust/darling_core/src/options/from_type_param.rs+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/third_party/rust/darling_core/src/options/from_type_param.rs@@ -1,10 +1,10 @@ use proc_macro2::TokenStream; use quote::ToTokens;-use syn::{self, Ident};+use syn::Ident;-use codegen::FromTypeParamImpl;-use options::{OuterFrom, ParseAttribute, ParseData};-use Result;+use crate::codegen::FromTypeParamImpl;+use crate::options::{OuterFrom, ParseAttribute, ParseData};+use crate::Result; #[derive(Debug)] pub struct FromTypeParamOptions {@@ -16,7 +16,7 @@ impl FromTypeParamOptions { pub fn new(di: &syn::DeriveInput) -> Result<Self> { (FromTypeParamOptions {- base: OuterFrom::start(di),+ base: OuterFrom::start(di)?, bounds: None, default: None, })
Analyzing the provided code diff for security fixes: 1. Vulnerability Existed: no No specific vulnerability found [File] [Lines 1-10] [Old Code] use proc_macro2::TokenStream; use quote::ToTokens; use syn::{self, Ident}; use codegen::FromTypeParamImpl; use options::{OuterFrom, ParseAttribute, ParseData}; use Result; [Fixed Code] use proc_macro2::TokenStream; use quote::ToTokens; use syn::Ident; use crate::codegen::FromTypeParamImpl; use crate::options::{OuterFrom, ParseAttribute, ParseData}; use crate::Result; 2. Vulnerability Existed: not sure Potential error handling improvement [File] [Lines 16-20] [Old Code] base: OuterFrom::start(di), [Fixed Code] base: OuterFrom::start(di)?, The changes appear to be primarily: 1. Import path cleanup (changing relative imports to absolute crate:: paths) 2. Adding error propagation (?) operator to OuterFrom::start call No clear security vulnerabilities were fixed, though the error handling change might relate to robustness improvements. The import changes are purely organizational with no security impact.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html@@ -17,8 +17,8 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d'); ctx.fillStyle = '#f00'; ctx.fillRect(0, 0, 100, 50);@@ -31,10 +31,10 @@ ctx.lineTo(200, 200); ctx.lineTo(1000, 201); ctx.stroke();-_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");-_assertPixel(offscreenCanvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");-_assertPixel(offscreenCanvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");-_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); t.done(); });
After analyzing the provided code diff, I don't find any security vulnerabilities being fixed. The changes appear to be purely variable renaming (from `offscreenCanvas` to `canvas`) and corresponding updates to the variable name in the assertions. There are no security-related changes in this diff. Vulnerability Existed: no No security vulnerability found in this diff. The changes are purely cosmetic/refactoring in nature. The diff shows: 1. Variable name change from `offscreenCanvas` to `canvas` 2. Corresponding updates to the variable name in `_assertPixel` calls 3. No changes to security-sensitive operations or security-related logic
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/js/src/jit/Ion.cpp+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/js/src/jit/Ion.cpp@@ -141,10 +141,9 @@ JitSpew(JitSpew_Codegen, "# Emitting bailout tail stub"); generateBailoutTailStub(masm, &bailoutTail);- if (JitOptions.supportsFloatingPoint) {+ { JitSpew(JitSpew_Codegen, "# Emitting bailout tables");- // Initialize some Ion-only stubs that require floating-point support. BailoutTableVector& bailoutTables = bailoutTables_.writeRef(); if (!bailoutTables.reserve(FrameSizeClass::ClassLimit().classId())) { return false;@@ -159,13 +158,13 @@ bailoutTables.infallibleAppend( generateBailoutTable(masm, &bailoutTail, id)); }-- JitSpew(JitSpew_Codegen, "# Emitting bailout handler");- generateBailoutHandler(masm, &bailoutTail);-- JitSpew(JitSpew_Codegen, "# Emitting invalidator");- generateInvalidator(masm, &bailoutTail);- }+ }++ JitSpew(JitSpew_Codegen, "# Emitting bailout handler");+ generateBailoutHandler(masm, &bailoutTail);++ JitSpew(JitSpew_Codegen, "# Emitting invalidator");+ generateInvalidator(masm, &bailoutTail); // The arguments rectifier has to use the same frame layout as the function // frames it rectifies.
Analyzing the provided code diff for security fixes: 1. Vulnerability Existed: not sure [Potential Logic Error] [js/src/jit/Ion.cpp] [Lines 141-159] [Old Code] ```cpp if (JitOptions.supportsFloatingPoint) { JitSpew(JitSpew_Codegen, "# Emitting bailout tables"); // Initialize some Ion-only stubs that require floating-point support. BailoutTableVector& bailoutTables = bailoutTables_.writeRef(); if (!bailoutTables.reserve(FrameSizeClass::ClassLimit().classId())) { return false; } for (uint32_t id = 0; id < FrameSizeClass::ClassLimit().classId(); id++) { bailoutTables.infallibleAppend( generateBailoutTable(masm, &bailoutTail, id)); } JitSpew(JitSpew_Codegen, "# Emitting bailout handler"); generateBailoutHandler(masm, &bailoutTail); JitSpew(JitSpew_Codegen, "# Emitting invalidator"); generateInvalidator(masm, &bailoutTail); } ``` [Fixed Code] ```cpp { JitSpew(JitSpew_Codegen, "# Emitting bailout tables"); BailoutTableVector& bailoutTables = bailoutTables_.writeRef(); if (!bailoutTables.reserve(FrameSizeClass::ClassLimit().classId())) { return false; } for (uint32_t id = 0; id < FrameSizeClass::ClassLimit().classId(); id++) { bailoutTables.infallibleAppend( generateBailoutTable(masm, &bailoutTail, id)); } } JitSpew(JitSpew_Codegen, "# Emitting bailout handler"); generateBailoutHandler(masm, &bailoutTail); JitSpew(JitSpew_Codegen, "# Emitting invalidator"); generateInvalidator(masm, &bailoutTail); ``` Additional Details: The change removes the floating-point support check and unconditionally executes the bailout table generation, while moving the bailout handler and invalidator generation outside the block. This could potentially fix a logic error where critical bailout functionality was being skipped when floating-point support was disabled. However, without more context about the intended behavior, it's unclear if this was an actual security vulnerability.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/python/mozbuild/mozbuild/test/configure/test_checks_configure.py+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/python/mozbuild/mozbuild/test/configure/test_checks_configure.py@@ -596,7 +596,7 @@ javac = mozpath.abspath("/usr/bin/javac") paths = {java: None, javac: None} expected_error_message = (- "ERROR: Could not locate Java at /mozbuild/jdk/jdk8u312-b07/bin, "+ "ERROR: Could not locate Java at /mozbuild/jdk/jdk-17.0.1+12/bin, " "please run ./mach bootstrap --no-system-changes\n" )
Analyzing the provided code diff, here's the security analysis: Vulnerability Existed: no [Java Path Update] [python/mozbuild/mozbuild/test/configure/test_checks_configure.py] [Lines 596] [Old Code] "ERROR: Could not locate Java at /mozbuild/jdk/jdk8u312-b07/bin, " [Fixed Code] "ERROR: Could not locate Java at /mozbuild/jdk/jdk-17.0.1+12/bin, " Additional Details: - This appears to be a simple version update of the Java JDK path from version 8 to version 17 in an error message - The change doesn't indicate any security vulnerability being fixed, but rather a maintenance update - The modification is in a test file's expected error message, not in actual production code - No security-related patterns (like input validation, sanitization, etc.) were modified
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/dom/canvas/ImageBitmapRenderingContext.h+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/dom/canvas/ImageBitmapRenderingContext.h@@ -93,8 +93,12 @@ virtual void DidRefresh() override;- virtual void MarkContextCleanForFrameCapture() override;- virtual bool IsContextCleanForFrameCapture() override;+ void MarkContextCleanForFrameCapture() override {+ mFrameCaptureState = FrameCaptureState::CLEAN;+ }+ Watchable<FrameCaptureState>* GetFrameCaptureState() override {+ return &mFrameCaptureState;+ } protected: already_AddRefed<gfx::DataSourceSurface> MatchWithIntrinsicSize();@@ -109,7 +113,7 @@ * case when the canvas is not currently being drawn into and not rendered * but canvas capturing is still ongoing. */- bool mIsCapturedFrameInvalid;+ Watchable<FrameCaptureState> mFrameCaptureState; }; } // namespace dom
Here's the analysis of the provided code diff: 1. Vulnerability Existed: not sure Potential State Management Vulnerability [dom/canvas/ImageBitmapRenderingContext.h] [Lines 93-98, 113] Old Code: ```cpp virtual void MarkContextCleanForFrameCapture() override; virtual bool IsContextCleanForFrameCapture() override; bool mIsCapturedFrameInvalid; ``` Fixed Code: ```cpp void MarkContextCleanForFrameCapture() override { mFrameCaptureState = FrameCaptureState::CLEAN; } Watchable<FrameCaptureState>* GetFrameCaptureState() override { return &mFrameCaptureState; } Watchable<FrameCaptureState> mFrameCaptureState; ``` Additional Details: The change replaces a simple boolean flag with a more sophisticated state management system (Watchable<FrameCaptureState>). While this might indicate a fix for a race condition or synchronization issue, without more context about the FrameCaptureState enum and Watchable implementation, we can't be certain if this was fixing a specific vulnerability. 2. Vulnerability Existed: not sure Potential Information Leak Vulnerability [dom/canvas/ImageBitmapRenderingContext.h] [Lines 93-98] Old Code: ```cpp virtual void MarkContextCleanForFrameCapture() override; virtual bool IsContextCleanForFrameCapture() override; ``` Fixed Code: ```cpp void MarkContextCleanForFrameCapture() override { mFrameCaptureState = FrameCaptureState::CLEAN; } Watchable<FrameCaptureState>* GetFrameCaptureState() override { return &mFrameCaptureState; } ``` Additional Details: The removal of IsContextCleanForFrameCapture() and addition of GetFrameCaptureState() suggests a change in how frame capture state is monitored. This could potentially relate to fixing an information leak or timing issue, but without more context about the frame capture mechanism, we can't be certain. Note: The changes appear to be related to improving frame capture state management, possibly addressing synchronization or state consistency issues, but without more context about the specific vulnerabilities they might be addressing, we can only speculate about the security implications.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.
--- /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_97_END/firefox-FIREFOX_RELEASE_97_END/testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js+++ /root/PatchLeaks-main/products/firefox_downloads/FIREFOX_RELEASE_98_END/firefox-FIREFOX_RELEASE_98_END/testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js@@ -13,19 +13,19 @@ }); t.step(function() {-var offscreenCanvas = new OffscreenCanvas(100, 50);-var ctx = offscreenCanvas.getContext('2d');+var canvas = new OffscreenCanvas(100, 50);+var ctx = canvas.getContext('2d');-offscreenCanvas.width = 50;+canvas.width = 50; var g = ctx.createLinearGradient(0, 0, 100, 0); g.addColorStop(0, '#0f0'); g.addColorStop(1, '#0f0');-offscreenCanvas.width = 100;+canvas.width = 100; ctx.fillStyle = '#f00'; ctx.fillRect(0, 0, 100, 50); ctx.fillStyle = g; ctx.fillRect(0, 0, 100, 50);-_assertPixel(offscreenCanvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); t.done(); });
After analyzing the provided code diff, I don't see any security vulnerabilities being fixed. The changes appear to be purely variable renaming and don't involve any security-related modifications. Here's the analysis: Vulnerability Existed: no No security vulnerability found File: testing/web-platform/tests/html/canvas/offscreen/the-offscreen-canvas/initial.reset.gradient.worker.js Lines: 13-26 The changes only involve renaming the variable 'offscreenCanvas' to 'canvas' throughout the file, which doesn't affect security. The diff shows: 1. Variable renaming from 'offscreenCanvas' to 'canvas' 2. All operations remain the same, just using the new variable name 3. The canvas operations and assertions are identical in functionality This appears to be a code style/readability change rather than a security fix. No security vulnerabilities are addressed in this diff.
If an attacker could control the contents of an iframe sandboxed with <code>allow-popups</code> but not <code>allow-scripts</code>, they were able to craft a link that, when clicked, would lead to JavaScript execution in violation of the sandbox. This vulnerability affects Firefox < 98, Firefox ESR < 91.7, and Thunderbird < 91.7.