<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>MP4Box on Arzedlab 🪵</title><link>https://arzedlab.github.io/tags/mp4box/</link><description>Recent content in MP4Box on Arzedlab 🪵</description><generator>Hugo</generator><language>en-us</language><copyright>© Ravshan</copyright><lastBuildDate>Tue, 04 Apr 2023 00:00:00 +0000</lastBuildDate><atom:link href="https://arzedlab.github.io/tags/mp4box/index.xml" rel="self" type="application/rss+xml"/><item><title>CVE-2021-36414: heap-buffer-overflow MP4Box</title><link>https://arzedlab.github.io/posts/cve-2021-36414-1cb3648c0bf480a3b897cfdfea0a9efc/</link><pubDate>Tue, 04 Apr 2023 00:00:00 +0000</pubDate><guid>https://arzedlab.github.io/posts/cve-2021-36414-1cb3648c0bf480a3b897cfdfea0a9efc/</guid><description>&lt;h1 id="cve-2021-36414">CVE-2021-36414&lt;/h1>
&lt;p>A heap-buffer-overflow has occurred when running program MP4Box,which leads to a Deny of Service caused by dividing zero without sanity check,this can reproduce on the lattest commit.&lt;/p>
&lt;p>Here: the main problem is dividing into zero&lt;/p>
&lt;p>&lt;img src="image.png" alt="image.png">&lt;/p>
&lt;p>&lt;strong>Assigning &lt;code>block_size&lt;/code>:&lt;/strong>&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-c" data-lang="c">&lt;span style="display:flex;">&lt;span>block_size &lt;span style="color:#ff79c6">=&lt;/span> ent &lt;span style="color:#ff79c6">?&lt;/span> ent&lt;span style="color:#ff79c6">-&amp;gt;&lt;/span>&lt;span style="color:#8be9fd;font-style:italic">sampleDelta&lt;/span> : &lt;span style="color:#bd93f9">160&lt;/span>;
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>This line uses the conditional (ternary) operator to assign a value to &lt;code>block_size&lt;/code>.&lt;/li>
&lt;li>It checks if &lt;code>ent&lt;/code> is not &lt;code>NULL&lt;/code>.
&lt;ul>
&lt;li>If &lt;code>ent&lt;/code> is valid (i.e., not &lt;code>NULL&lt;/code>), &lt;code>block_size&lt;/code> is assigned the value of &lt;code>ent-&amp;gt;sampleDelta&lt;/code>.&lt;/li>
&lt;li>If &lt;code>ent&lt;/code> is &lt;code>NULL&lt;/code>, &lt;code>block_size&lt;/code> is assigned a default value of &lt;code>160&lt;/code>.&lt;/li>
&lt;/ul>
&lt;/li>
&lt;/ul>
&lt;h2 id="fix">Fix&lt;/h2>
&lt;p>&lt;img src="image%201.png" alt="image.png">&lt;/p></description></item></channel></rss>