<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>246858</bug_id>
          
          <creation_ts>2022-10-21 08:09:37 -0700</creation_ts>
          <short_desc>[SOUP] http/tests/security/cookies/cookie-theft-with-javascript-doc.html crashing</short_desc>
          <delta_ts>2022-11-09 13:16:32 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=247658</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Claudio Saavedra">csaavedra</reporter>
          <assigned_to name="Claudio Saavedra">csaavedra</assigned_to>
          <cc>achristensen</cc>
    
    <cc>bugs-noreply</cc>
    
    <cc>fujii</cc>
    
    <cc>mcatanzaro</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1907306</commentid>
    <comment_count>0</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2022-10-21 08:09:37 -0700</bug_when>
    <thetext>Since https://github.com/WebKit/WebKit/commit/361f64fcdd4b6aa17aaafcc55ebc88ab89acfc89 landed, http/tests/security/cookies/cookie-theft-with-javascript-doc.html has been crashing pretty consistently. 

ASSERTION FAILED: result
/app/webkit/Source/WebKit/NetworkProcess/NetworkProcess.cpp(434) : bool WebKit::NetworkProcess::allowsFirstPartyForCookies(WebCore::ProcessIdentifier, const WTF::URL&amp;)
1   0x7fe547a47b63 WTFCrash

[Thread debugging using libthread_db enabled]
Using host libthread_db library &quot;/usr/lib/x86_64-linux-gnu/libthread_db.so.1&quot;.
Core was generated by `/app/webkit/WebKitBuild/Debug/bin/WebKitNetworkProcess 10 9&apos;.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  WTFCrash () at /app/webkit/Source/WTF/wtf/Assertions.cpp:327
327	    *(int *)(uintptr_t)0xbbadbeef = 0;
[Current thread is 1 (Thread 0x7fe53e8be540 (LWP 44))]

Thread 1 (Thread 0x7fe53e8be540 (LWP 44)):
#0  WTFCrash() () at /app/webkit/Source/WTF/wtf/Assertions.cpp:327
#1  0x00007fe5512070f5 in WTFCrashWithInfo(int, char const*, char const*, int) () at /app/webkit/WebKitBuild/Debug/WTF/Headers/wtf/Assertions.h:754
#2  0x00007fe551a6886b in WebKit::NetworkProcess::allowsFirstPartyForCookies(WTF::ObjectIdentifier&lt;WebCore::ProcessIdentifierType&gt;, WTF::URL const&amp;) (this=0x7fe535034240, processIdentifier=..., firstParty=...) at /app/webkit/Source/WebKit/NetworkProcess/NetworkProcess.cpp:434
#3  0x00007fe551a08f14 in WebKit::NetworkConnectionToWebProcess::cookiesForDOM(WTF::URL const&amp;, WebCore::SameSiteInfo const&amp;, WTF::URL const&amp;, WebCore::ProcessQualified&lt;WTF::ObjectIdentifier&lt;WebCore::FrameIdentifierType&gt; &gt;, WTF::ObjectIdentifier&lt;WebCore::PageIdentifierType&gt;, WebCore::IncludeSecureCookies, WebCore::ShouldAskITP, WebCore::ShouldRelaxThirdPartyCookieBlocking, WTF::CompletionHandler&lt;void (WTF::String, bool)&gt;&amp;&amp;) (this=0x7fe535094340, firstParty=..., sameSiteInfo=..., url=..., frameID=..., pageID=..., includeSecureCookies=WebCore::IncludeSecureCookies::No, shouldAskITP=WebCore::ShouldAskITP::No, shouldRelaxThirdPartyCookieBlocking=WebCore::ShouldRelaxThirdPartyCookieBlocking::No, completionHandler=...) at /app/webkit/Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:773</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1907307</commentid>
    <comment_count>1</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2022-10-21 08:20:11 -0700</bug_when>
    <thetext>There are two web processes (due to the iframe in the test), one with identifier 7 and the other 12. One of them is adding &apos;nullOrigin&apos; to the &quot;allowedFirstPartyForCookies&quot; list, not the other. When the other receives a call to get the cookies for the DOM, the check of whether &apos;nullOrigin&apos; is an allowed first party for cookies fails, and the assertion with it:

NetworkProcess::addAllowedFirstPartyForCookies(identifier: 7, firstPartyForCookies: nullOrigin)

NetworkProcess::addAllowedFirstPartyForCookies(identifier: 12, firstPartyForCookies: 127.0.0.1)

NetworkProcess::allowsFirstPartyForCookies(identifier: 12, firstPartyForCookies: 127.0.0.1)

NetworkProcess::allowsFirstPartyForCookies(identifier: 12, firstPartyForCookies: 127.0.0.1)

NetworkProcess::allowsFirstPartyForCookies(identifier: 12, firstPartyForCookies: nullOrigin)
  --&gt; ASSERTION FAILED: result


The crash doesn&apos;t happen always for me, so this might be a timing issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911184</commentid>
    <comment_count>2</comment_count>
    <who name="Fujii Hironori">fujii</who>
    <bug_when>2022-11-08 23:54:07 -0800</bug_when>
    <thetext>See also bug#247658. I&apos;m proposing a patch there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911347</commentid>
    <comment_count>3</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2022-11-09 13:06:29 -0800</bug_when>
    <thetext>This seems to have been fixed already with https://commits.webkit.org/256065@main</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911348</commentid>
    <comment_count>4</comment_count>
    <who name="Claudio Saavedra">csaavedra</who>
    <bug_when>2022-11-09 13:13:14 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/6317</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1911349</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2022-11-09 13:16:27 -0800</bug_when>
    <thetext>Committed 256498@main (4cd9a03152f0): &lt;https://commits.webkit.org/256498@main&gt;

Reviewed commits have been landed. Closing PR #6317 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>