<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session in General Topics</title>
    <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/383709#M89987</link>
    <description>&lt;P&gt;This post is gold.&lt;/P&gt;</description>
    <pubDate>Wed, 03 Feb 2021 20:15:11 GMT</pubDate>
    <dc:creator>Sec101</dc:creator>
    <dc:date>2021-02-03T20:15:11Z</dc:date>
    <item>
      <title>SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233052#M66851</link>
      <description>&lt;P&gt;I have had this happen twice so far, I am wondering how others have solved for it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Host A -&amp;gt; Palo Alto -&amp;gt; Host B&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Host A,&amp;nbsp;cycles through its source ports frequently - every couple of minutes.&lt;/P&gt;&lt;P&gt;Host B has long&amp;nbsp; or no TCP keep alive timers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Host A:src port X connects to Host B on port 443.&lt;/P&gt;&lt;P&gt;Host A has an issue, reboots, lost power, app crashes, etc.&amp;nbsp; But it does NOT close the session.&amp;nbsp; Host B shows the connection in the netstat.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Host A:src port X tries to connect to host B on port 443.&amp;nbsp; Host B responds with an ACK, this is per RFC.&amp;nbsp; That ACK is passed back to host A, Host A responds to the ACK with a RST.&amp;nbsp; The firewall drops the reset, and the connection is stuck.&amp;nbsp; Every time the host cycles through that source port it never clears.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Looking on the firewall on the A side, all I see is&lt;/P&gt;&lt;P&gt;Syn -&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;- ACK&lt;/P&gt;&lt;P&gt;RST-&amp;gt;&lt;/P&gt;&lt;P&gt;For like 6 tries from the host on this source port, then is moves on until it gets back around to this port and it does it again and again.&amp;nbsp; No way to clear it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the B side, I see this&lt;/P&gt;&lt;P&gt;Syn -&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;lt;- ACK&lt;/P&gt;&lt;P&gt;No reset, the firewall is eating the reset.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried putting a deny rule in with reset in both directions, but it only resets on the A side.&lt;/P&gt;&lt;P&gt;Clearing the session in the session table does not work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to spoof reset packets and they are not getting through the firewall.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only thing I have been able to do is have the server guy either clear the session or reboot it if they dont have the capabliity to clear a stale session.&amp;nbsp; Ask them to turn on keepalives to try to prevent, but this does not seem right.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This site shows exactly what is happening.&lt;/P&gt;&lt;P&gt;&lt;A href="https://serverfault.com/questions/733681/server-sends-ack-in-response-to-syn-causing-a-reset-in-tcp-request-from-the-clie" target="_blank"&gt;https://serverfault.com/questions/733681/server-sends-ack-in-response-to-syn-causing-a-reset-in-tcp-request-from-the-clie&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I am reaching out to the Live forum for help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to generate a reset from the palo alto in this scenerio (an hping3 type command?)&lt;/P&gt;&lt;P&gt;Is there a way to allow that reset from host A through the firewall (maybe turn off state inspection).&amp;nbsp; Can you turn off state inspection for just one src/dst pair?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 22:51:33 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233052#M66851</guid>
      <dc:creator>william.dolbow</dc:creator>
      <dc:date>2018-09-28T22:51:33Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233242#M66898</link>
      <description>&lt;P&gt;What you're referring to is called a &lt;STRONG&gt;Challenge ACK&lt;/STRONG&gt;, described in RFC-5961 (Section 4).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a nutshell, it states that if a new SYN is received the server should respond with a new ACK with the most recently sent acknowledgement number as you see. The client will send the reset, which (if it makes it to the server) should free the socket on the server allowing another new SYN to be sent.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The RFC is explicit about this (4.2):&lt;/P&gt;&lt;PRE&gt;   1) If the SYN bit is set, irrespective of the sequence number, TCP
      MUST send an ACK (also referred to as challenge ACK) to the remote
      peer:

      &amp;lt;SEQ=SND.NXT&amp;gt;&amp;lt;ACK=RCV.NXT&amp;gt;&amp;lt;CTL=ACK&amp;gt;

      After sending the acknowledgment, TCP MUST drop the unacceptable
      segment and stop processing further.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dropping the RST is actually an intended behavior. While it breaks the Challenge ACK mechanism, it prevents out-of-band spoofed addresses from correctly guessing the 4-tupple and killing the connection prematurely.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Starting with PAN-OS 8.0.7 (and higher, also included in all versions of 8.1) you would need to enter the following commands:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;gt; configure
#&amp;nbsp;set deviceconfig setting tcp allow-challenge-ack yes&amp;nbsp;
# commit&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;That is a global setting, so you can't apply it for just one set of devices. Keep in mind that it also removes the mitigation for a spoofed RST in the current TCP receive window, but that is a pretty tough thing to guess.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 22:00:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233242#M66898</guid>
      <dc:creator>gwesson</dc:creator>
      <dc:date>2018-10-01T22:00:19Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233261#M66902</link>
      <description>&lt;P&gt;Thank you, that is exactly what I needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would not do this on a permiter firewall, but something internal, the risk - benifit seems reasonable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 01 Oct 2018 23:44:25 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233261#M66902</guid>
      <dc:creator>william.dolbow</dc:creator>
      <dc:date>2018-10-01T23:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233370#M66931</link>
      <description>&lt;P&gt;&lt;SPAN&gt;One follow up questions:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You mentioned:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"That is a global setting, so you can't apply it for just one set of devices. Keep in mind that it also removes the mitigation for a spoofed RST in the current TCP receive window, but that is a pretty tough thing to guess."&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can you expand on this just a bit.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;It is my understanding if the Palo Alto has an established connection in its session table, a spoofed TCP reset -&amp;nbsp; 4 Tuple with a sequence number within the TCP window, and window size equal to or smaller then sessions used,&amp;nbsp; will make it through the Palo Alto and reset the connection.&amp;nbsp; Can you confirm this is correct.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000CllyCAC" target="_self"&gt;https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000CllyCAC&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The Challange ack change setting seems like it would allow a reset crafted to make it through the firewall when there is NOT an established&amp;nbsp; connection in the session table, assuming that 4 Tuple and sequence number/window is in line with the ACK it just saw.&amp;nbsp; Which seems pretty unlikley.&amp;nbsp;&amp;nbsp;In summary, I am thinking this feature allows the RESET to make it through during the session start phase of the connection, while the ability to spoof resets on an established connection is inherent risk stated above always exists.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 15:15:20 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233370#M66931</guid>
      <dc:creator>william.dolbow</dc:creator>
      <dc:date>2018-10-02T15:15:20Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233391#M66935</link>
      <description>&lt;P&gt;&amp;gt; I&lt;SPAN&gt;t is my understanding if the Palo Alto has an established connection in its session table, a spoofed TCP reset -&amp;nbsp; 4 Tuple with a sequence &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt; number within the TCP window, and window size equal to or smaller then sessions used,&amp;nbsp; will make it through the Palo Alto and reset the &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt; connection.&amp;nbsp; Can you confirm this is correct.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes, you are correct. There is no mitigation for that, regardless of the challenge-ack setting I described earlier. Sorry about the confusion.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;nbsp;The Challange ack change setting seems like it would allow a reset crafted to make it through the firewall when there is NOT an &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt; established&amp;nbsp; connection in the session table, assuming that 4 Tuple and sequence number/window is in line with the ACK it just saw.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is also correct. You stated it much more plainly (and correctly) than I had &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Oct 2018 18:44:51 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/233391#M66935</guid>
      <dc:creator>gwesson</dc:creator>
      <dc:date>2018-10-02T18:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/383709#M89987</link>
      <description>&lt;P&gt;This post is gold.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Feb 2021 20:15:11 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/383709#M89987</guid>
      <dc:creator>Sec101</dc:creator>
      <dc:date>2021-02-03T20:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: SYN ACK RST Loop on inside and SYN ACK only - source port re-use - hung session</title>
      <link>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/384004#M90007</link>
      <description>&lt;P&gt;I run into this exact same issue a few weeks ago.&amp;nbsp; There is a very good read on this:&amp;nbsp; &lt;A href="https://www.networkdefenseblog.com/post/wireshark-tcp-challenge-ack" target="_blank"&gt;https://www.networkdefenseblog.com/post/wireshark-tcp-challenge-ack&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Feb 2021 23:42:47 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/general-topics/syn-ack-rst-loop-on-inside-and-syn-ack-only-source-port-re-use/m-p/384004#M90007</guid>
      <dc:creator>dtran</dc:creator>
      <dc:date>2021-02-04T23:42:47Z</dc:date>
    </item>
  </channel>
</rss>

