<?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 Phonlawat Khunphet on Medium]]></title>
        <description><![CDATA[Stories by Phonlawat Khunphet on Medium]]></description>
        <link>https://medium.com/@khunphet.p?source=rss-cff4f710b023------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Phonlawat Khunphet on Medium</title>
            <link>https://medium.com/@khunphet.p?source=rss-cff4f710b023------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 20:16:01 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@khunphet.p/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[Insecure Deserialization]]></title>
            <link>https://medium.com/blog-blog/insecure-deserialization-e5398e83defe?source=rss-cff4f710b023------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5398e83defe</guid>
            <category><![CDATA[owasp-top-10]]></category>
            <category><![CDATA[owasp]]></category>
            <dc:creator><![CDATA[Phonlawat Khunphet]]></dc:creator>
            <pubDate>Sun, 24 Mar 2019 15:43:11 GMT</pubDate>
            <atom:updated>2019-03-27T07:30:17.980Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*VOLUB_ekmPpRD6q8oGWh7A.jpeg" /><figcaption><a href="https://www.htbridge.com/images/blog/owasp8-insecure-deserialization.jpg">https://www.htbridge.com/images/blog/owasp8-insecure-deserialization.jpg</a></figcaption></figure><h3><strong>Introduction</strong></h3><p>Today, Developing web applications sometimes require to transfer data for storing, communication, logging, etc. They have to prepare and send data each other so data are quite important especially financial, health and so on.</p><p>Applications should transfer data with the same data format, it makes the application to convert to standard from own data format before sending data and vice-versa, converting standard into own data format after receiving data that it effect with insecure deserialization.</p><blockquote><strong>What is insecure Deserialization ?</strong><br>insecure deserialization that is vulnerability when receive untrusted data may be used to damage, stolen or any violation without sufficient data verification.</blockquote><h3><strong>Serialization and Deserialization</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zJJ65xk8agiQXlqd7nYUw.jpeg" /><figcaption>Serialization and Deserialization diagram</figcaption></figure><p>Before we describe about insecure Deserialization, let’s talk about these 2 words below.</p><blockquote><strong>Serialization</strong> is process that convert object into specific structure data format <br> such as convert Java Entity class to JSON format for sending via communication with other services or clients.</blockquote><blockquote><strong>Deserialization</strong> is process that convert data format into object <br> such as client sends requests as JSON data format and back end service convert it to Java Entity Class.</blockquote><blockquote>For an example of serialization/deserialization that may be used<br> -<strong>HTTP Params (ViewState), Cookies, Ajax Components, etc</strong>.<br> -<strong>XML</strong>: <br> HTTP Body: “&lt;username&gt;test&lt;/username&lt;password&gt;test&lt;/password&gt;” <br> -<strong>JSON</strong>: <br>HTTP Body: {“username”: “&lt;username&gt;”, “password”: “&lt;password&gt;”}<br> -<strong>Database, Messaging Queue, etc</strong>.</blockquote><h3><strong>How do know your application is vulnerable ?</strong></h3><p>The vulnerability of applications always occurs from below<br> — read data from untrusted sources.<br> — read data without verification such as digital signature, unsafe classes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*CcrlJKHAZjTqY7lstfa-7g.jpeg" /><figcaption>Vulnerability Flow Diagram</figcaption></figure><p>There is an example of scenario (Java language) as shown below<br>1) We created User Java class as depicted below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/1*Z3B2eMxV_t5wzL_YRwfCKQ.jpeg" /><figcaption>User class contains username and password.</figcaption></figure><p>2) We write User (username=test,password=test) object into user.txt</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/503/1*zV8V4c5g-Y9h63GsWpGg5w.jpeg" /><figcaption>Serialize user object into file.</figcaption></figure><p>3) We read user.txt as steam of byte then deserialize it by converting into user class.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/578/1*nK8JcacpZTHvxO2L8bRbCw.jpeg" /><figcaption>Deserialize data into user class</figcaption></figure><blockquote>The problem is program try to deserialize data without any verification, it tends to attacker can simulate serialized data and send to application to take any violence action.</blockquote><h3>How to prevent Insecure of deserialization</h3><p>The key is application should always check about receiving data and <br> don’t accept serialized object from untrusted sources as shown below</p><ul><li>Integrate checksums or digital signatures to ensure trusted sources.</li><li>Allow deserialize data for existing class in applications by custom ObjectInputStream with specific class.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/623/1*KybD7pFaHnxJQKH3mhZCaA.jpeg" /><figcaption><a href="https://www.ibm.com/developerworks/library/se-lookahead/index.html">https://www.ibm.com/developerworks/library/se-lookahead/index.html</a></figcaption></figure><ul><li>To use <a href="https://github.com/ikkisoft/SerialKiller">Java Serial killer</a> instead of ObjectInputStream (There are a lot of configuration to prevent attackers)</li><li>Logging deserialization, always check about exception from deserialize failures</li><li>Monitoring deserialization, alert if application try to deserialize constantly.</li></ul><h3><strong>Conclusion</strong></h3><p>Insecure deserialization is 1 of 10 OWASP that we should aware about this problem which it effects with data and application. The important things is to always verify data with any sources before using it to prevent attacker.</p><p><strong>Thank you for your attention.</strong></p><p>Reference:</p><p><a href="https://www.owasp.org/index.php/Top_10-2017_A8-Insecure_Deserialization">https://www.owasp.org/index.php/Top_10-2017_A8-Insecure_Deserialization</a></p><p><a href="https://iacquaint.blogspot.com/2015/12/look-out-java-deserialization.html">https://iacquaint.blogspot.com/2015/12/look-out-java-deserialization.html</a></p><ul><li><a href="https://www.ibm.com/developerworks/library/se-lookahead/index.html">Look-ahead Java deserialization</a></li><li><a href="https://blog.detectify.com/2018/03/21/owasp-top-10-insecure-deserialization/">OWASP TOP 10: Insecure Deserialization | Detectify Blog</a></li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.slideshare.net%2Fslideshow%2Fembed_code%2Fkey%2FxEFWMxVBmOHVqp&amp;url=https%3A%2F%2Fwww.slideshare.net%2Fjoaomatosf_%2Fan-overview-of-deserialization-vulnerabilities-in-the-java-virtual-machine-jvm-h2hc-2017&amp;image=https%3A%2F%2Fcdn.slidesharecdn.com%2Fss_thumbnails%2Fh2hc2017joaomatosfjavadeser-171025200215-thumbnail-4.jpg%3Fcb%3D1508963584&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=slideshare" width="600" height="500" frameborder="0" scrolling="no"><a href="https://medium.com/media/58dd71be3de029306aee7a7a780dd0bb/href">https://medium.com/media/58dd71be3de029306aee7a7a780dd0bb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5398e83defe" width="1" height="1" alt=""><hr><p><a href="https://medium.com/blog-blog/insecure-deserialization-e5398e83defe">Insecure Deserialization</a> was originally published in <a href="https://medium.com/blog-blog">blog blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>