1
amudee
zmagazine 1.0 Print.PHP SQL Injection Vulnerability
  • 2009/1/4 19:45

  • amudee

  • Just popping in

  • Posts: 42

  • Since: 2007/8/8 1


Someone has recently exploited my website's zmagazine module, possibly using Print.PHP SQL Injection Vulnerability.

Is there any fix to this problem ?

So far i could not find any solution.

best regards,
amudee

2
trabis
Re: zmagazine 1.0 Print.PHP SQL Injection Vulnerability
  • 2009/1/4 21:19

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


in print.php use this instead:

PrintPage(intval($articleid));


3
Anonymous
Re: zmagazine 1.0 Print.PHP SQL Injection Vulnerability
  • 2009/1/4 21:41

  • Anonymous

  • Posts: 0

  • Since: 0


Edit zmagazine/print.php and replace:
le="color: #000000"><?php foreach ($HTTP_POST_VARS as $k => $v) { ${$k} = $v; } foreach ($HTTP_GET_VARS as $k => $v) { ${$k} = $v; } if ( empty($articleid) ) { redirect_header("index.php"); }

with:
le="color: #000000"><?php if ( isset($_GET['articleid']) ) { $articleid = intval( $_GET['articleid'] ); } else { redirect_header("index.php"); }


and replace:
le="color: #000000"><?php PrintPage($articleid);

at the end of file with:
le="color: #000000"><?php include_once XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->dirname() .'/include/groupaccess.php'; $article = new WfsArticle($articleid); if (checkAccess($article->groupid)) { PrintPage(intval($articleid));} else { redirect_header("index.php", 2, _NOPERM); exit(); }



This modification is based on xfsection module and trabis note.