<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to 23: buffer overflow</title><link>https://sourceforge.net/p/libmms/bugs/23/</link><description>Recent changes to 23: buffer overflow</description><atom:link href="https://sourceforge.net/p/libmms/bugs/23/feed.rss" rel="self"/><language>en</language><lastBuildDate>Tue, 24 Jan 2023 23:40:19 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/libmms/bugs/23/feed.rss" rel="self" type="application/rss+xml"/><item><title>#23 buffer overflow</title><link>https://sourceforge.net/p/libmms/bugs/23/?limit=25#4d0d</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;I should add that I notified Søren today! (Jan 24, 2023) Thanks Søren!&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Donovan Jasper</dc:creator><pubDate>Tue, 24 Jan 2023 23:40:19 -0000</pubDate><guid>https://sourceforge.netb07a28f01740673417fb4faaf8360ceba02e1a07</guid></item><item><title>buffer overflow</title><link>https://sourceforge.net/p/libmms/bugs/23/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Searching through the LibMMS library, the mms.c file contains the following code at line 775:&lt;/p&gt;
&lt;p&gt;sprintf(this-&amp;gt;str, "NSPlayer/7.0.0.1956; {%s}; Host: %s", this-&amp;gt;guid,    this-&amp;gt;connect_host);&lt;/p&gt;
&lt;p&gt;If we look at where this-&amp;gt;str is declared we will see that it is declared as follows:&lt;/p&gt;
&lt;p&gt;char str&lt;span&gt;[1024]&lt;/span&gt;; /&lt;em&gt; scratch buffer to built strings &lt;/em&gt;/&lt;/p&gt;
&lt;p&gt;So this-&amp;gt;str is assigned a value using sprintf. &lt;/p&gt;
&lt;p&gt;If we look around a bit, we can determine that we have control over the value that is stored in  this-&amp;gt;guid that influences the value sprintf assigns to this-&amp;gt;str.  &lt;/p&gt;
&lt;p&gt;Following a chain, we see that the url input to the mms_connect function:&lt;/p&gt;
&lt;p&gt;mms_t &lt;em&gt;mms_connect (mms_io_t &lt;/em&gt;io, void &lt;em&gt;data, const char &lt;/em&gt;url, int bandwidth)&lt;/p&gt;
&lt;p&gt;Is duplicated into ​​this-&amp;gt;url:&lt;/p&gt;
&lt;p&gt;this-&amp;gt;url= strdup (url);&lt;/p&gt;
&lt;p&gt;this-&amp;gt;url is then used as a variable for gnet_uri_new:&lt;/p&gt;
&lt;p&gt;this-&amp;gt;guri = gnet_uri_new(this-&amp;gt;url);&lt;/p&gt;
&lt;p&gt;Which after reformatting the url, returns a value “guri.”&lt;/p&gt;
&lt;p&gt;By giving a large input for url, we should be able to overflow the allotted 1024 bytes.  If we overflow by a lot, the program will likely crash because important information has been overwritten.&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Donovan Jasper</dc:creator><pubDate>Tue, 24 Jan 2023 23:37:30 -0000</pubDate><guid>https://sourceforge.net595b48999ac85e7443234c609a3a24731479ff42</guid></item></channel></rss>