MolyX Board 2.81 Forum db_base.php Page SQL Injection Vulnerability

Source: Internet
Author: User

Affected Versions:
MolyX Board 2.81

Vulnerability description:
MolyX Board is one of the Magic Series of Web application software products. MolyX Studios, after years of market technology research and research, based on the advantages of many Forum program technologies and practices, we have developed a forum system with powerful functions, fast speed, outstanding performance, and extremely high security for Chinese users.

Includes/db/db_base.php Injection
 

1. function insert ($ table, $ array, $ type = INSERT, $ func = query_unbuffered)
2.
3. if ($ SQL = $ this-> SQL _insert ($ table, $ array, $ type )))
4 .{
5. return $ this-> $ func ($ SQL );
6 .}
7. return false;

Next, let's look at the SQL _insert () function.
 

1. function SQL _insert ($ table, $ array, $ type = INSERT, $ prefix = INSERT)
2.
3. if (! Is_array ($ array) | emptyempty ($ array ))
4 .{
5. return false;
6 .}
7. return "$ prefix INTO $ table". $ this-> SQL _clause ($ type, $ array );

Let's look at the SQL _clause () function.
 

1. function SQL _clause ($ query, $ array)
2 .{
3. if (! Is_array ($ array ))
4 .{
5. return false;
6 .}
7.
8. $ query = strtoupper ($ query );
9. $ fields = $ values =;
10. if ($ query = INSERT | $ query = INSERT_SELECT)
11 .{
12. foreach ($ array as $ key => $ var)
13 .{
14. $ fields. =, '. $ key .';
15.
16. if (is_array ($ var) & is_string ($ var [0])
17 .{
18. // INSERT SELECT
19. $ values. =,. $ var [0];
20 .}
21. else
22 .{
23. $ values. =,. $ this-> validate ($ var );
24 .}
25 .}
26. $ fields = substr ($ fields, 2 );
27. $ values = substr ($ values, 2 );
28. $ query = ($ query = INSERT )? (. $ Fields.) VALUES (. $ values.): (. $ fields.) SELECT. $ values .;
29 .}
30 ........................................ omit irrelevant code

$ Values. =,. $ var [0]; The variable $ var [0] is not enclosed in single quotes. The problem arises !!
 
Note that the init_input () function in global. php performs array (& #032;, <! --, -->,>, <,",!, "", "", $, "") Is filtered into array (, & #60; & #33; --, -- & #62;, & gt;, & lt ;, & quot;, & #33;, & #39;, <br/>, & #036;,) <* Reference
Http://hi.baidu.com/mr_xhming
*>
Test method:

The Program (method) provided on this site may be offensive and only used for security research and teaching. You are at your own risk!
Find $ DB-> insert (), and check whether the second parameter of the database has any variables that we can use, and then construct and submit the data with the data flow.
For example: $ aa [] = 0, (select + password + from + mxb_user + where + id = 1), 0, 0) % 23SEBUG Security suggestions:
Vendor patch:
MolyX Board
--------
Currently, the vendor does not provide patches or upgrade programs. We recommend that users who use the software follow the vendor's homepage to obtain the latest version:
Http://www.molyx.com/

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.