<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tan Inn Fung on Medium]]></title>
        <description><![CDATA[Stories by Tan Inn Fung on Medium]]></description>
        <link>https://medium.com/@tan_inn_fung?source=rss-c05e2d5f2d85------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*kmtWlQPgADY6h7UcKfq0Ww.jpeg</url>
            <title>Stories by Tan Inn Fung on Medium</title>
            <link>https://medium.com/@tan_inn_fung?source=rss-c05e2d5f2d85------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 02:17:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tan_inn_fung/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Testing Enterprise Browsers: A Security Assessment of Prisma Access Browser]]></title>
            <link>https://medium.com/csg-govtech/testing-enterprise-browsers-a-security-assessment-of-prisma-access-browser-e5ad639c4924?source=rss-c05e2d5f2d85------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5ad639c4924</guid>
            <category><![CDATA[product-security]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[security-testing]]></category>
            <category><![CDATA[csg]]></category>
            <category><![CDATA[enterprise-software]]></category>
            <dc:creator><![CDATA[Tan Inn Fung]]></dc:creator>
            <pubDate>Mon, 03 Aug 2026 03:56:05 GMT</pubDate>
            <atom:updated>2026-09-02T09:30:41.240Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Enterprise browsers have emerged as a critical security control for organisations seeking to protect sensitive data and enforce security policies in cloud-first environments. As more organisations adopt them as a cornerstone of their security architecture, the question is not just about their operational capabilities, but how they withstand targeted scrutiny from a sophisticated, determined local attacker.</p><p>As part of our ongoing efforts to evaluate security solutions used within the Singapore Government, GovTech’s Cyber Security Group (CSG) conducted a security assessment of Palo Alto Networks’ Prisma Access Browser (PAB). Our goal was not simply to run automated scans or only rely on LLMs, but to think like an attacker — reasoning across system boundaries, chaining together observations, and probing the interactions between components that are easy to overlook. This kind of assessment requires curiosity, persistence, and a willingness to question assumptions.</p><h3>Executive Summary</h3><p>We identified several findings, five of which have since been acknowledged and addressed by Palo Alto Networks. Through these findings, we found that an attacker with access to a device with PAB installed could install unauthorised extensions, replay captured policy configurations to weaken security controls, and extract sensitive data. Note that the latest versions of Prisma Browser mitigate our findings when installed and deployed securely following PAB’s documentation at <a href="https://docs.paloaltonetworks.com/prisma-access-browser/administration/prisma-browser-self-protection-fpr-windows">Prisma Browser Self-Protection for Windows</a>.</p><p>These findings do not mean that enterprise browsers are ineffective as a security control. Rather, they highlight that no security solution should be treated as a silver bullet. Enterprise browsers require careful implementation, ongoing validation, and layered defences to ensure their protections hold up against determined attackers.</p><p>We are sharing these findings not only to disclose responsibly, but because we care about whether users and organisations are protected. At the end of each part of this series, we include recommendations on patching, secure configuration, and compensating controls where relevant. Following the resolution of these findings with Palo Alto Networks, we are now sharing them with the broader security community.</p><h3>Responsible Disclosure</h3><p>We thank Palo Alto Networks for responding professionally and promptly addressing the vulnerabilities identified through the responsible disclosure journey. Security advisories have been published for the resolved issues:</p><p>● <a href="https://security.paloaltonetworks.com/CVE-2025-0129">https://security.paloaltonetworks.com/CVE-2025-0129</a></p><p>● <a href="https://security.paloaltonetworks.com/CVE-2025-4233">https://security.paloaltonetworks.com/CVE-2025-4233</a></p><p>● <a href="https://security.paloaltonetworks.com/CVE-2025-4616">https://security.paloaltonetworks.com/CVE-2025-4616</a></p><p>● <a href="https://security.paloaltonetworks.com/CVE-2025-4617">https://security.paloaltonetworks.com/CVE-2025-4617</a></p><p>● <a href="https://security.paloaltonetworks.com/CVE-2025-4618">https://security.paloaltonetworks.com/CVE-2025-4618</a></p><h3>About This Series</h3><p>Given the breadth of our findings, we are publishing them across three parts:</p><p>● <strong>Part 1, Security control bypasses</strong> (this article): Policy bypass and signature replay attacks that circumvent PAB’s configured security policies.</p><p>● <strong>Part 2</strong>, <a href="https://medium.com/csg-govtech/testing-enterprise-browsers-part-2-6fe4b9282e4c"><strong>Environmental Exploitation</strong></a>: Operating system-level primitives for extracting secrets and bypassing data protection controls.</p><p>● <strong>Part 3, </strong><a href="https://medium.com/csg-govtech/testing-enterprise-browsers-part-3-d431a4bd0557"><strong>Logical Findings</strong></a>: Security considerations arising from design decisions, including version downgrade capabilities and availability of obfuscated extension code for analysis</p><p>We hope these findings contribute to the broader security community’s understanding of enterprise browser security and inform both vendors and organisations in strengthening their security postures.</p><p><strong>Finding 1: Bypassing security controls via partial policy bypass (CVE-2025–0129)</strong></p><p>We found that by manipulating certificate trust during the login flow, we could bypass the policy before security restrictions were applied. This policy bypass was relevant when a PAB policy to restrict extension installation was in place, and enabled an attacker to install Chrome extensions that persist beyond the restricted session. The extensions were not removed upon the next browser startup, allowing them to remain active in normal PAB sessions where they can be used to bypass browser security controls, exfiltrate sensitive data, or modify browser-handled information. Note that the extensions would be removed upon an additional browser restart when the extension restriction policy is active, hence the attacker likely has to re-exploit this vulnerability to consistently reap the benefits of the attacker-installed Chrome extensions.</p><p>The vulnerability was triggered by inducing a Chromium SSL/TLS verification failure during authentication. We intercepted the certificate installation flow using a proxy tool (such as PortSwigger’s Burp Suite) and intercepted traffic through to the initial login page. At this point, we removed the interceptor’s root certificate from the Trusted Root Certification Authorities store. After entering the email address and clicking Continue, the authentication flow produced a certificate error page that presented a “Back to safety” option in the browser UI, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*xtTEz_WAMXtPx2K877Y7tQ.png" /><figcaption><strong>Figure 1 — “Back to safety” option was presented in the browser’s page after altering the certificate trust</strong></figcaption></figure><p>Clicking the “Back to safety” option yielded a restricted PAB instance, which constitutes a policy bypass.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*XIlGqNhcKWpqCYxkeMI4_Q.png" /><figcaption><strong>Figure 2 — A restricted PAB browser instance was obtained after the “Back to safety” option was clicked</strong></figcaption></figure><p>The restricted PAB instance limits user capabilities significantly — context-menu actions (right-click), browser settings, and the address bar are all disabled. However, the initial “Google search” bar remains available for navigation. We discovered that this search bar, along with the Web Store shortcut on the PAB homepage, provides access to the Chrome Web Store, where extensions can be installed despite the restrictions.</p><p>To demonstrate the security impact, we installed a Chrome extension while in the restricted instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*NRF9cN1lq9fa2rOoJTVlvg.png" /><figcaption><strong>Figure 3 — Installing an extension through the Chrome Web Store</strong></figcaption></figure><p>After restarting PAB and logging in normally, we observed that the Chrome extension persisted in the fully functional PAB session. However, these Chrome extensions would be removed upon an additional browser restart when the extension restriction policy is active.</p><p>The persistence of an unauthorised extension in a normal PAB session undermines the trust model that enterprise browsers are built on. An organisation deploying PAB typically does so with the expectation that the browser environment is controlled and auditable — but a persisted, unauthorised extension breaks that assumption. Any security guarantee that depends on the integrity of that environment can no longer be relied upon, and the organisation may have no visibility into what the extension is doing or has done.</p><p>This finding has been addressed in the latest versions of Prisma Browser.</p><p><strong>Finding 2: Bypassing security controls via signature replay attack (CVE-2025–4616)</strong></p><p>To enforce its security control, PAB distributes a security policy to the client after the user successfully completes the login process. The policy is protected from tampering through a signature verification mechanism. However, we identified a flaw in the signature verification logic — the freshness check and the signature validation were performed separately. This allowed an attacker to substitute a different policy and its accompanying valid signature while reusing a captured freshness value, effectively bypassing the intended integrity protection, effectively bypassing the intended integrity protection. Nonetheless, carrying out this attack requires overcoming several obstacles.</p><p>Under normal circumstances, PAB’s use of certificate pinning prevents interception of policy downloads via proxy tools. However, during our testing, we observed that PAB could be launched with Chromium’s “--ignore-certificate-errors” command-line flag, which disables certificate validation and allows policy traffic to be intercepted.</p><p>Note: Latest versions of Prisma Browser block the “--ignore-certificate-errors” flag.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*ukgplI9Q0-BIVPyPYuVysA.png" /><figcaption><strong>Figure 4 — Launching PAB by ignoring the certificate errors</strong></figcaption></figure><p>With certificate validation disabled, we were able to capture the security policy from the server’s response after completing the login process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*o3hu3ydvAn5OgtK1-Vczqw.png" /><figcaption><strong>Figure 5 — Successfully captured the security policy from the server response</strong></figcaption></figure><p>Examining the response headers, we observed that integrity protection was implemented through two separate values: X-Talon-Freshness (ensuring policy currency) and X-Talon-Signature (verifying policy authenticity). The response body contained the security policy in JSON format. In our test environment, the policy restricted access to “developerTools” and “extensionsList” options.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/443/1*ou3Oi3AbmyHTcW65xHeZ-A.png" /><figcaption><strong>Figure 6 — The “Developer Tools” and “ExtensionsList” options were restricted in the PAB security policy</strong></figcaption></figure><p>We verified these restrictions by confirming that the current PAB instance blocked access to developer tools and prevented side-loading of extensions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/744/1*wkw9xcTHxUvpgbDrvYXUTg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*sVyQHNXM3OpHYz9ULj95kA.png" /><figcaption><strong>Figure 7 — PAB blocks users from accessing the developer tool and blocks side-loading extensions (no option to “Load unpacked extensions”) due to current PAB security policy</strong></figcaption></figure><p>To demonstrate the vulnerability, we use a previously captured PAB security policy that permits both developer tools and extension side-loading. This is a reasonable assumption — organisations often deploy less restrictive policies during a pilot phase before tightening controls for production. We substituted this permissive policy into the server response along with its valid signature (X-Talon-Signature), while retaining the freshness value (X-Talon-Freshness) from the original response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/904/1*x-2PaN_u4POn4JVP02IVyA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*LaXwqeWj5VlvEmtdxT53hw.png" /><figcaption><strong>Figure 8 — Key chunks of previously-captured PAB security policy that allows side-loading extensions and developer tools</strong></figcaption></figure><p>After launching PAB with the substituted policy, we confirmed that both developer tools and extension side-loading were successfully enabled. This demonstrated that an attacker could replay a previously valid policy to reinstate permissions that have since been revoked, bypassing the organisation’s current intended security restrictions. Note that this replay attack is constrained to policies previously assigned to the same user within the same tenant.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*SYUDsmN_-i7dcQOyVLDTuA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/944/1*P-_S5n9GB40pP-bIIGIY8A.png" /><figcaption><strong>Figure 9 — Both Developer Tools and side-loading extension options were enabled</strong></figcaption></figure><p>This vulnerability has been addressed in the latest versions of Prisma Browser.</p><h3>Recommendations</h3><p>For organisations deploying PAB, the findings in this part suggest several concrete actions.</p><p>The most immediate action is to update to the latest version of Prisma Browser and follow Palo Alto Networks’ secure deployment guidance at <a href="https://docs.paloaltonetworks.com/prisma-access-browser/administration/prisma-browser-self-protection-fpr-windows">Prisma Browser Self-Protection for Windows</a>. Both findings have been addressed in versions 142.15.2.60 and beyond, though some mitigations are version-dependent, so organisations running older versions remain exposed.</p><p>Beyond patching, Finding 1 highlights the importance of monitoring for unauthorised browser extensions. Even where PAB’s extension restriction policy is active, organisations should consider whether they have visibility into what extensions are present in user sessions. Endpoint detection tooling that can alert on unexpected extension installations would provide an additional layer of defence.</p><p>Finding 2 is a reminder that policy integrity controls are only as strong as their implementation. Organisations should not assume that a signed policy is tamper-proof without understanding how the signature and freshness checks interact. Where PAB is used to enforce critical security boundaries, periodic validation that the expected policies are actually in effect, rather than a previously-captured permissive version, is a worthwhile operational check.</p><p>More broadly, both findings required the attacker to have some degree of access to the device and the ability to intercept or manipulate traffic. Organisations should treat endpoint security and network monitoring as essential complements to PAB, not optional additions. An enterprise browser operating on a compromised or poorly managed endpoint provides weaker guarantees than its configuration might suggest.</p><h3>Conclusion</h3><p>The findings in Part 1 illustrate a recurring theme in security research: the most impactful vulnerabilities are often not found in isolation, but at the seams between components, where one system’s edge case becomes another system’s entry point. Bypassing a policy enforcement mechanism during initialisation, or replaying a valid signature with a stale policy, are not brute-force attacks. They require an attacker to understand how a system is designed, where its assumptions lie, and how those assumptions can be turned against it.</p><p>This is why independent validation matters. Security controls should not be assumed to work simply because they are configured — they should be tested against the kinds of reasoning an attacker would apply.</p><p><strong>Part 2: </strong><a href="https://medium.com/csg-govtech/testing-enterprise-browsers-part-2-6fe4b9282e4c"><strong>Environmental exploitation techniques for data extraction</strong></a></p><p>In <a href="https://medium.com/csg-govtech/testing-enterprise-browsers-part-2-6fe4b9282e4c">Part 2</a>, we turn to a different class of findings: techniques that exploit the operating environment itself to extract sensitive data, bypassing protections that the browser cannot fully control. These findings reveal how even a well-hardened browser can be undermined by the complexity of the systems it runs within.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5ad639c4924" width="1" height="1" alt=""><hr><p><a href="https://medium.com/csg-govtech/testing-enterprise-browsers-a-security-assessment-of-prisma-access-browser-e5ad639c4924">Testing Enterprise Browsers: A Security Assessment of Prisma Access Browser</a> was originally published in <a href="https://medium.com/csg-govtech">CSG @ GovTech Singapore</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Padding Oracle Hunter. A Burp Suite extension to tackle the padding oracle vulnerability]]></title>
            <link>https://medium.com/csg-govtech/padding-oracle-hunter-a-burp-suite-extension-to-tackle-the-padding-oracle-vulnerability-97647e7eb2ea?source=rss-c05e2d5f2d85------2</link>
            <guid isPermaLink="false">https://medium.com/p/97647e7eb2ea</guid>
            <category><![CDATA[web]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[csg]]></category>
            <category><![CDATA[burpsuite]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <dc:creator><![CDATA[Tan Inn Fung]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 03:11:33 GMT</pubDate>
            <atom:updated>2022-04-13T03:30:40.437Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KTY8tVB_-VcQjHAjlkJ8PQ.png" /></figure><h3>Background</h3><p>After several penetration testing engagements last year, I was surprised to find out that the padding oracle vulnerability was quite common in web applications. The vulnerability could be exploited easily, and the impact was significant. If successfully exploited, it allowed the plaintext to be recovered and modified by purely manipulating the ciphertext without needing the secret key. Attackers could create their own encrypted data to return to the server for decryption and processing. The server would usually implicitly trust this data, as it would not expect unintended parties to possess the secret key used for encryption and decryption. The two most common type of padding schemes that are subjected to the padding oracle vulnerability are PKCS#7 and PKCS#1 v1.5. This article will introduce the padding oracle vulnerability, how the newly developed extension (Padding Oracle Hunter) could be used to tackle the vulnerability and will conclude by highlighting some mitigation measures against the vulnerability.</p><h3>Introduction to PKCS#7 and PKCS#1 v1.5 padding</h3><p>PKCS#7 is normally used for block cipher encryptions, particularly in cipher block chaining (CBC) mode. The padding is required because the block cipher works based on its corresponding block size. The padding is added at the end of the last message block to ensure that its block length is equal to the block size. The value of each added byte is the number of bytes that need to be padded.</p><p>For example, let’s say a block size is 16 bytes and the plaintext to be sent for encryption is 15 bytes in hexadecimal: 43 53 47 20 69 73 20 74 68 65 20 62 65 73 74.</p><p>As the block size is 16 bytes, we will need to pad a byte 0x01 to the message so that it becomes 43 53 47 20 69 73 20 74 68 65 20 62 65 73 74 <strong>01</strong>.</p><p>If the plaintext’s length is more than 16 bytes, every 16 bytes from the start will be used to form a block. If the remaining data is less than 16 bytes, it will be padded with enough bytes so that the resulting block will be 16 bytes long. During the decryption process, the last message block will be decrypted first, followed by the padding and the rest of the blocks.</p><p>Unlike PKCS#7, the PKCS#1 v1.5 is a padding scheme used by RSA (Rivest-Shamir-Adleman) cryptosystem and is a common technique for asymmetric encryption. The padding is applied to the message to ensure the length of the message is the same as the modulus length in order to thwart a short message and small public exponent attack. The PKCS#1 v1.5 padding for a message <em>m</em> follows the format 0x0002 || <em>r</em> || 0x00 || <em>m</em><strong> </strong>where<strong> </strong><em>r</em> = random bytes.<strong> </strong>The length of the random bytes is<strong> </strong>|<em>r</em>| = |<em>n</em>| — |<em>m</em>| — 3 where <em>n</em> is the public modulus. Similar to PKCS#7, during decryption, the ciphertext will be decrypted first and the padding will be verified and removed before the plaintext is being returned.</p><h3>The Attack</h3><p>Unfortunately, both padding schemes suffer from the padding oracle attack if not properly utilized. If the server responds differently when the padding is correct/incorrect, the attacker can make use of this information to recover and modify the plaintext. The following two diagrams show the login authentication example for a server that is not vulnerable and a server that is vulnerable to a padding oracle attack.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TNSo8KJe-oZoMYHM-t3myQ.png" /><figcaption>Figure 1: Server that is not vulnerable to a padding oracle attack</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlWu3jZnp3Oif6T2BZ_Lww.png" /><figcaption>Figure 2: Server that is vulnerable to a padding oracle attack</figcaption></figure><p>For PKCS#7, once the attacker has identified the vulnerable server as shown in Figure 2, he will apply the divide and conquer approach to first recover one byte of the plaintext by continuously modifying a specific ciphertext’s byte and send it to the server until it returns the valid padding response. After a single byte of the plaintext has been recovered, the attacker will use it to recover the next plaintext byte with the same approach. It is worth mentioning that a similar approach can be used to modify the plaintext as well. More details about the attack can be found <a href="https://en.wikipedia.org/wiki/Padding_oracle_attack">here</a>.</p><p>For PKCS#1 v1.5, the attacker will perform the <a href="http://archiv.infsec.ethz.ch/education/fs08/secsem/bleichenbacher98.pdf">Blechienbacher attack</a> by exploiting the homomorphic property of the RSA algorithm. The attacker continuously multiplies the ciphertext with some chosen value(s) until the server responds with a valid padding. The attacker will then continue with the previous step to further reduce the boundary, until a single value (the plaintext) is found.</p><h3>Introducing the Padding Oracle Hunter</h3><p>Even though the vulnerability is easy to identify, it can still take a fair amount of time for a penetration tester to develop a working exploit that can be used to recover and modify the plaintext. For this reason, GovTech’s Cyber Security Group (CSG) has developed a Burp Suite extension named <a href="https://portswigger.net/bappstore/0efabfee59404068a8c4071fa18a2e00">Padding Oracle Hunter</a> which can help testers quickly identify and exploit this issue.</p><h3>Installation</h3><p>1. Download the release build of the Padding Oracle Hunter.</p><p>2. Launch the Burp Suite.</p><p>3. <a href="https://burpsuite.guide/runtimes/python/">Set up the Jython environment</a> if you haven’t done so.</p><p>4. Switch to the <strong>Extender</strong> tab which is located at the top row.</p><p>5. Under the Burp Extensions panel, click <strong>Add</strong></p><p>6. Under <strong>Extension Details</strong>, select <strong>python</strong> as the <strong>Extension type </strong>and click<strong> Select file </strong>to select the<strong> padding_oracle_hunter.py </strong>python<strong> </strong>script.</p><p>7. You should encounter no errors and see a new tab labelled <strong>Padding Oracle Hunter</strong> on the top row.</p><p>Alternatively, you can install it directly through <a href="https://portswigger.net/bappstore/0efabfee59404068a8c4071fa18a2e00">BurpSuite’s BApp Store</a></p><p>A test server was created to simulate the padding oracle vulnerability. To set up the server:</p><p>1. Clone this <a href="https://github.com/GovTech-CSG/PaddingOracleHunter.git">repository</a></p><p>2. Go inside the TestVulServer directory and run <strong>docker-compose up </strong>command</p><p>3. The server can be accessed through<strong> </strong><a href="http://serverip:8000/">http://ServerIP:8000</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XDNMzuLsPZzuTILNqKN1iQ.png" /><figcaption>Figure 3: Test server to simulate the padding oracle vulnerability</figcaption></figure><h3>Overview</h3><p>Currently, the extension consists of two separate tabs: <strong>PKCS#7</strong> and <strong>PKCS#1 v1.5</strong>, and they support the following functionalities:</p><h4>PKCS#7</h4><p>The following image breaks down Padding Oracle Hunter’s UI to identify and perform the padding oracle attack targeting the PKCS#7 padding scheme on a CBC block cipher. The attack allows plaintext recovery and modification without having the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*sYHCaSElkHZ61epVQB6JGg.png" /><figcaption>Figure 4: Padding Oracle Hunter PKCS#7 GUI</figcaption></figure><p>The components of the GUI (above) are as follows:</p><ol><li>Http request window.</li><li>Panel to select the payload and its format. To achieve full decryption, the payload is expected to be in the format of IV || ciphertext.</li><li>The number of threads used to perform the attack. With more threads, the computation is expected to be faster.</li><li>The block size of the encryption protocol.</li><li>The unique response from the server (partial or full) due to valid or invalid padding. This is only used during encryption and decryption operations.</li><li>The plaintext which will be used to compute the ciphertext. This is only used during an encryption operation.</li><li>Output window to display the results.</li><li>Test function to verify whether the server is vulnerable to the PKCS#7 padding oracle attack.</li><li>Encrypt function to compute the ciphertext from the given plaintext.</li><li>Decrypt function to recover the plaintext from the encrypted payload.</li><li>Stop function to halt all the current operations.</li></ol><h4>PKCS#1.5</h4><p>The following GUI can be used to identify and perform the padding oracle attack targeting the PKCS#1 v1.5 padding scheme on RSA Cryptosystem. The attack allows the plaintext to be recovered with only public key information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/939/1*xkdoRV6sJL7x4GP2Efcp-A.png" /><figcaption>Figure 5: Padding Oracle Hunter PKCS#1 v1.5 GUI</figcaption></figure><p>The components of the GUI (above) are as follows:</p><ol><li>Http request window.</li><li>Panel to select the payload and its format.</li><li>The RSA public exponent.</li><li>The RSA public modulus.</li><li>The unique response from the server (partial or full) due to valid or invalid padding. This is only used during a decryption operation.</li><li>Interval to update the decryption results.</li><li>Output window to display the results.</li><li>Test function to verify whether the server is vulnerable to PKCS#1 v1.5 padding oracle attack.</li><li>Decrypt function to recover the plaintext from the encrypted payload.</li><li>Stop function to halt all the current operations.</li></ol><h3><strong>Extension Usage</strong></h3><h4>PKCS#7</h4><p>The following steps show how the Padding Oracle Hunter can be used to identify and exploit the PKCS#7 padding oracle vulnerability in the test server.</p><ol><li>Copy the sample ciphertext for AES at <a href="http://serverip:8000/">http://ServerIP:8000</a> as shown in Figure 3. Go to the test server endpoint at <a href="http://serverip:8000/TestAesPKCS7">http://ServerIP:8000/TestAesPKCS7</a> with the following POST request and the copied ciphertext. Notice that we logged in as a normal user.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nSyu07hnEz_5kr-rYj42ZA.png" /><figcaption>Figure 6: PKCS#7 POST request to login as normal user</figcaption></figure><p>2. Pipe the request through <strong>Extensions -&gt; Padding Oracle Hunter -&gt; PKCS#7</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*SL79WzJTKM17dgIAVMzQmA.png" /><figcaption>Figure 7: Pipe the request to Padding Oracle Hunter -&gt; PKCS#7</figcaption></figure><p>3. Select the ciphertext value in the <strong>Request</strong> window, click <strong>Select Payload</strong> with <strong>Hex</strong> format, and uncheck <strong>Url Encoded</strong>. The payload will be enclosed within the § symbol.</p><p>4. Click the <strong>Test</strong> button and it will provide a summary which will indicate if the server is vulnerable to the padding oracle attack with its corresponding invalid/valid padding payload and response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dMcoSD9SBTfVx1IkyIvQTA.png" /><figcaption>Figure 8: Test function indicating the server is vulnerable to PKCS#7 padding oracle attack</figcaption></figure><p>5. Copy either part of the padding response, or the full padding response from the <strong>Output</strong> window and put it in the <strong>Padding Response</strong> textbox. You can choose to use either the valid or invalid padding response. Click the <strong>Decrypt</strong> button to recover the plaintext.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5eFdgNMzI_ws2nVRA7Mhw.png" /><figcaption>Figure 9: Decrypt function to recover the plaintext using the PKCS#7 invalid padding response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SBhWQjo4AzqRCehRbffIOA.png" /><figcaption>Figure 10: Decrypt function to recover the plaintext using the PKCS#7 valid padding response</figcaption></figure><p>6. To escalate to admin privileges, we will need to modify the plaintext to {“userid”:”100&quot;,”isAdmin”:”<strong>True</strong>”} and convert it to a hexadecimal value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*Iy3wCzoGTdeA5kZxBxfGOA.png" /><figcaption>Figure 11: Convert the modified plaintext to hexadecimal value</figcaption></figure><p>7. Copy the modified hexadecimal value to the <strong>Plaintext</strong> textbox and click the <strong>Encrypt</strong> button to compute the corresponding ciphertext.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z13tHHjowd-2kpk8WpePjg.png" /><figcaption>Figure 12: Encrypt function to compute the ciphertext from the modified plaintext</figcaption></figure><p>8. Update the http request with the newly computed ciphertext and send the request to the server. Notice that we are now logged in as an admin.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lNqvQqJ84ZxeA7GEm_hEHw.png" /><figcaption>Figure 13: Modify the PKCS#7 POST request to login as an admin</figcaption></figure><h4>PKCS#1 v1.5</h4><p>The following steps show how the Padding Oracle Hunter can be used to identify and exploit the PKCS#1 v1.5 padding oracle vulnerability in the test server.</p><ol><li>Copy the sample ciphertext for RSA at <a href="http://serverip:8000/">http://ServerIP:8000</a> as shown in Figure 3. Go to the test server endpoints at <a href="http://serverip:8000/TestRsaPKCS1_5">http://ServerIP:8000/TestRsaPKCS1_5</a> with the following POST request and the copied ciphertext.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iX2529-K7EIeIXdJFS6baQ.png" /><figcaption>Figure 14: PKCS#1 v1.5 Post request with ‘Success’ response</figcaption></figure><p>2. Pipe the request through Extensions -&gt; Padding Oracle Hunter -&gt; PKCS#1 v1.5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/615/1*QTvPxbjbiRGGK22FB8VFUg.png" /><figcaption>Figure 15: Pipe the request to Padding Oracle Hunter -&gt; PKCS#1 v1.5</figcaption></figure><p>3. Select the ciphertext value in the <strong>Request</strong> window, click <strong>Select Payload</strong> with <strong>Hex</strong> format, and uncheck <strong>Url Encoded</strong>. The payload will be enclosed within the § symbol.</p><p>4. Fill in the public key parameters with <strong>public exponent</strong>: 65537 and <strong>modulus</strong>: 91150209829916536965146520317827566881182630249923637533035630164622161072289</p><p>5. Click the <strong>Test</strong> button, and it will provide a summary which will indicate if the server is vulnerable to a padding oracle attack with its corresponding invalid/valid padding payload and response.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-mQAZ-zpIHZN6hBbdltQvg.png" /><figcaption>Figure 16: Test function indicating the server is vulnerable to PKCS#1 v1.5 padding oracle attack</figcaption></figure><p>6. Copy either part of the padding response, or the full padding response from the <strong>Output</strong> window and put it in the <strong>Padding Response</strong> textbox. You can choose to use either the valid or invalid padding response. Click the <strong>Decrypt</strong> button, and the plaintext will be recovered after about 50k requests.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xWgrwpAErZZWSuv0nbbOwA.png" /><figcaption>Figure 17: Decrypt function to recover the plaintext using the PKCS#1 v1.5 invalid padding response</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bacH_BNK_81XxPWJirVSXQ.png" /><figcaption>Figure 18: Decrypt function to recover the plaintext using the PKCS#1 v1.5 valid padding response</figcaption></figure><h3><strong>Conclusion</strong></h3><p>The padding oracle vulnerability has been made known for some time but can unfortunately still be found in many modern applications as it is easily overlooked when developers implement the padding algorithm or utilize the cryptographic functions. Furthermore, since the vulnerability only comes to light during runtime, static code analyses may not pick it up.</p><p>One of the simpler, yet effective mitigation is to always return the same response when decrypting packets with either valid or invalid padding. In this case, the attacker will not be able to make use of the side channel information to carry out the attack. Additionally, for PKCS#7, it is recommended to use the encrypt-then-MAC (Message Authentication Code) approach by first encrypting the message and then computing the MAC of the ciphertext. During the decryption operation, the MAC will be verified before the actual decryption take place. In this case, the system will be able to detect whether the ciphertext has been modified by the attacker. For RSA encryption, it is advisable to use the OAEP padding scheme instead of PKCS#1 v1.5 as it is less prone to vulnerabilities due to insecure implementation.</p><p>Padding Oracle Hunter is an <a href="https://github.com/GovTech-CSG/PaddingOracleHunter">open-source software</a>, and we welcome contributions to the community to further improve it. Together we can make the Padding Oracle Hunter more useful for the community.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=97647e7eb2ea" width="1" height="1" alt=""><hr><p><a href="https://medium.com/csg-govtech/padding-oracle-hunter-a-burp-suite-extension-to-tackle-the-padding-oracle-vulnerability-97647e7eb2ea">Padding Oracle Hunter. A Burp Suite extension to tackle the padding oracle vulnerability</a> was originally published in <a href="https://medium.com/csg-govtech">CSG @ GovTech Singapore</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are hackers ruining primary school math?]]></title>
            <link>https://medium.com/csg-govtech/are-hackers-ruining-primary-school-math-31676db5b05b?source=rss-c05e2d5f2d85------2</link>
            <guid isPermaLink="false">https://medium.com/p/31676db5b05b</guid>
            <category><![CDATA[csg]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[web]]></category>
            <category><![CDATA[govtech]]></category>
            <dc:creator><![CDATA[Tan Inn Fung]]></dc:creator>
            <pubDate>Wed, 29 Apr 2020 03:34:13 GMT</pubDate>
            <atom:updated>2020-04-29T03:34:13.752Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TL;DR</strong>: A third-party application developed to supplement online primary school mathematics lessons is found to be susceptible to parameter tampering, which resulted in ridiculously high scores on the application’s leaderboard. This article covers my investigation which led to the discovery of the security vulnerability.</p><p><strong>Background</strong></p><p>I have been secretly playing the Balloon Pop game while my son is asleep. I first encountered this game when I accompanied him on his first eLearning experience on a website recommended by his primary school teacher. Balloon Pop was one of the many third-party games used to deliver a richer learning experience on mathematics.</p><p>The game is rather addictive simple: you only need to count the number of objects inside the balloon and pop them in ascending order with your cursor. There are five levels in total, and you are scored by how fast you complete all five levels.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/626/1*85zIpK20Eo5LzHjGWmiPMg.png" /></figure><p><strong>It is not supposed to be this difficult</strong></p><p>It started when I saw my son struggling to get his name on the top score table. Being curious, I played the game to understand his struggle first-hand. After a few rounds of playing, I finally understood my son’s exasperation. I was only able to score 70930 points despite perfect accuracy with a rather fast timing. With my best score of 70930, I was only at 77th place and still 6500 points away from the top score!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*XuCaPbi3DpeweZhtKOeh5A.png" /></figure><p>At that moment, I began to suspect that these scores were too good to be true and are unlikely to be the scores of primary school children. I was crying foul by my third “perfect” attempt. Hence, I decided to investigate on the possibility of hackers ruining the fun with their ridiculously high scores.</p><p><strong>How it could have been hacked</strong></p><p>Initially, I attempted to score as poorly as I could to test the boundaries of the game. Realising that each time I clicked on a wrong balloon, I would get a negative score, I tried to test if the game was susceptible to an <em>integer underflow attack</em>. In this case, an <em>integer underflow may </em>happen if the resulting score is less than the minimum allowable value an integer can hold, resulting in a wraparound to a positive score close to the highest possible value an integer can hold. However, I figured that this was not the route to take because it required me to be very good at being a lousy player. This route would also likely cost me many sleepless nights.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/638/1*mO2UqvJF_J31ZFdmMtHmrg.png" /></figure><p>I then thought that the most straightforward way this game could be hacked was to intercept and modify the score before the http request was sent to the server (shown in image below).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/902/1*0p-zRFEbHmsbvl4CEn8DMg.png" /></figure><p>Fortunately, there was the option of removing encryption which made intercepting http requests easier. The site allows anyone to downgrade from an HTTPS:// connection to an HTTP:// connection since it accepts both HTTP and HTTPS traffic. <strong>As a side note, please do not allow this for your web applications.</strong></p><p>Having removed the encryption, I fired up burp suite and intercepted the HTTP GET request sent after the “submit score” button was pressed. From the intercepted result, I saw that the HTTP GET request was sent to hs_scores.php with the parameters id, player, score, email, rand and rand2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mrQsXP8lycyHRV_7GzXjMQ.png" /></figure><p>From my various attempts at the game, I noticed that the values of rand and rand2 would change with each submission while other parameter values like player, score, and email remained constant. From my experience, rand and rand2 likely dictated a valid submission. i.e. rand and rand2 were checksums to determine if a submission was legitimate or not.</p><p>I also noticed that the parameter rand2 looked like an MD5 hash since it was consistently 16 bytes long which was represented in hexadecimal. I thus assumed that the parameter rand was a salt value and that rand2 was the hash output of concatenating the score and the rand parameter. However, the MD5sum did not match up, no matter how I appended the parameters. I therefore concluded that the method of computation was definitely not MD5(score + rand).</p><p>Since all the computation was done before sending back to the server, I knew that I could rely on looking at the client-side code to resolve this problem. To analyse the client-side code, I uncovered the source of the flash binary by inspecting the elements on the page.</p><p>To obtain the source code from the binary file, I decompiled the binary using Sothink SWF Decompiler.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-0NFeVrvtB15X0CsGYNpCQ.png" /></figure><p>The binary decompiled successfully, and I was able to nail down how rand2 was generated. It was simply: rnd2 = calcMD5 (id + “-“ + score + “-“ + rand + “…you shall not pass”)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-V3Bc_XxSptd4QQa0HnviA.png" /></figure><p>Interestingly, the string “… you shall not pass” made it harder (if not impossible) for someone to deduce the algorithm without decompiling the binary file.</p><p>Now, all I needed to do was to generate an MD5 hash for the rnd2 variable by following the following “formula”: rand2 = calcMD5 (id + “-“ + score + “-“ + rand + “…you shall not pass”). This could be done using a simple echo command like this in order to score 77451 points.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*wX5FY9cgKwZ6lR1eiq-RYQ.png" /></figure><p>Once the rand2 value is obtained, you could potentially forward the request to the server using burp suite. I was quite sure this would work and it was how hackers could have submitted their ridiculously high scores. =)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a0YhqvJbKUlcAOB1Jtmzog.png" /></figure><p><strong>The Lesson</strong></p><p>The main takeaway from this is that the attacker could become the man in the middle and tamper the values if the connection is not secure. Hence, the website shouldn’t allow anyone to downgrade the connection from HTTPS to HTTP, and proper implementation such as SSL Pinning should be applied in order to prevent such attacks.</p><p>Besides that, an integer overflow/underflow vulnerability may lead to unexpected behaviour. Hence, bounds checking should always be performed to ensure that the value stay within the range.</p><p>Furthermore, since the game is running on the client side, the binary files should be properly obfuscated to make reverse engineering more difficult. Hosting the game on the server-side could be an alternative solution but it would likely be more expensive and could cause bad user experience due to performance issue.</p><p>In conclusion, I hope this article is able to help software developers gain insight on some basic security knowledge while developing their products. Security and performance always come with a trade-off; it is important to value the performance while not sacrificing the security.</p><p>P.S. In case anyone was wondering, I have reported these vulnerabilities to the software provider. For privacy reasons, I will not disclose their identity until they fix the vulnerabilities. I am looking forward to have a more robust scoring mechanism for our young ones.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31676db5b05b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/csg-govtech/are-hackers-ruining-primary-school-math-31676db5b05b">Are hackers ruining primary school math?</a> was originally published in <a href="https://medium.com/csg-govtech">CSG @ GovTech Singapore</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>