⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283952 in webkit


Ignore:
Timestamp:
Oct 11, 2021, 5:05:35 PM (5 years ago)
Author:
Chris Dumez
Message:

[COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
https://bugs.webkit.org/show_bug.cgi?id=231537
<rdar://83530643>

Reviewed by Geoffrey Garen.

Source/WebCore:

Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
contains more than one endpoint URL for a given group.

The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
endpoint URL (since we don't currently support having several URLs for a given group).
The crash was due to a use-after-move of the |group|.

Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html

  • loader/ReportingEndpointsCache.cpp:

(WebCore::ReportingEndpointsCache::addEndpointFromDictionary):

LayoutTests:

Add layout test coverage.

  • http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
  • http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
  • http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r283950 r283952  
     12021-10-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     4        https://bugs.webkit.org/show_bug.cgi?id=231537
     5        <rdar://83530643>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Add layout test coverage.
     10
     11        * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints-expected.txt: Added.
     12        * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html: Added.
     13        * http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html.headers: Added.
     14
    1152021-10-11  Ayumi Kojima  <ayumi_kojima@apple.com>
    216
  • trunk/Source/WebCore/ChangeLog

    r283941 r283952  
     12021-10-11  Chris Dumez  <cdumez@apple.com>
     2
     3        [COOP] Crash under ReportingEndpointsCache::addEndpointFromDictionary()
     4        https://bugs.webkit.org/show_bug.cgi?id=231537
     5        <rdar://83530643>
     6
     7        Reviewed by Geoffrey Garen.
     8
     9        Make sure we don't crash under addEndpointFromDictionary() when the Report-To HTTP header
     10        contains more than one endpoint URL for a given group.
     11
     12        The loop inside addEndpointFromDictionary() should bail as soon as we find a viable
     13        endpoint URL (since we don't currently support having several URLs for a given group).
     14        The crash was due to a use-after-move of the |group|.
     15
     16        Test: http/wpt/cross-origin-opener-policy/report-to-multiple-endpoints.html
     17
     18        * loader/ReportingEndpointsCache.cpp:
     19        (WebCore::ReportingEndpointsCache::addEndpointFromDictionary):
     20
    1212021-10-11  Wenson Hsieh  <wenson_hsieh@apple.com>
    222
  • trunk/Source/WebCore/loader/ReportingEndpointsCache.cpp

    r283179 r283952  
    158158        }).iterator->value;
    159159        endpointsForOrigin.add(WTFMove(group), Endpoint(WTFMove(endpointURL), Seconds { static_cast<double>(*maxAge) }));
     160        return;
    160161    }
    161162}
Note: See TracChangeset for help on using the changeset viewer.