code
stringlengths
12
2.05k
label
int64
0
1
programming_language
stringclasses
9 values
cwe_id
stringlengths
6
14
cwe_name
stringlengths
5
103
description
stringlengths
36
1.23k
url
stringlengths
36
48
label_name
stringclasses
2 values
public function run(){ if (Yii::app()->user->isGuest) { Yii::app()->controller->redirect(Yii::app()->controller->createUrl('/site/login')); } if (Yii::app()->request->getRequestType () === 'GET') { $_POST = $_GET; } if (isset ($_POST['passConfirm']) && $_POST['passConfirm']) { MassAction::superMassActionPasswordConfirmation (); return; } if (!isset ($_POST['massAction']) || ((!isset ($_POST['superCheckAll']) || !$_POST['superCheckAll']) && (!isset ($_POST['gvSelection']) || !is_array ($_POST['gvSelection'])))) { /**/AuxLib::debugLogR ('run error'); throw new CHttpException (400, Yii::t('app', 'Bad Request')); } $massAction = $_POST['massAction']; $massActionInstance = $this->getInstanceFor ($massAction); if (isset ($_POST['superCheckAll']) && $_POST['superCheckAll']) { $uid = $_POST['uid']; $idChecksum = $_POST['idChecksum']; $totalItemCount = intval ($_POST['totalItemCount']); $massActionInstance->superExecute ($uid, $totalItemCount, $idChecksum); } else { $gvSelection = $_POST['gvSelection']; $massActionInstance->beforeExecute (); $massActionInstance->execute ($gvSelection); $massActionInstance::echoFlashes (); } }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function getValue() { return $this->value; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function showall() { expHistory::set('viewable', $this->params); // figure out if should limit the results if (isset($this->params['limit'])) { $limit = $this->params['limit'] == 'none' ? null : $this->params['limit']; } else { $limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10; } $order = isset($this->config['order']) ? $this->config['order'] : 'publish DESC'; // pull the news posts from the database $items = $this->news->find('all', $this->aggregateWhereClause(), $order); // merge in any RSS news and perform the sort and limit the number of posts we return to the configured amount. if (!empty($this->config['pull_rss'])) $items = $this->mergeRssData($items); // setup the pagination object to paginate the news stories. $page = new expPaginator(array( 'records'=>$items, 'limit'=>$limit, 'order'=>$order, 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->params['controller'], 'action'=>$this->params['action'], 'src'=>$this->loc->src, 'view'=>empty($this->params['view']) ? null : $this->params['view'] )); assign_to_template(array( 'page'=>$page, 'items'=>$page->records, 'rank'=>($order==='rank')?1:0, 'params'=>$this->params, )); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function testWithProtocolVersion() { $r = (new Response())->withProtocolVersion('1000'); $this->assertSame('1000', $r->getProtocolVersion()); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function actionGetItems($modelType){ $sql = 'SELECT id, name as value FROM x2_campaigns WHERE name LIKE :qterm ORDER BY name ASC'; $command = Yii::app()->db->createCommand($sql); $qterm = '%'.$_GET['term'].'%'; $command->bindParam(":qterm", $qterm, PDO::PARAM_STR); $result = $command->queryAll(); echo CJSON::encode($result); exit; }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
public static function totalUser() { $posts = Db::result("SELECT `id` FROM `user` WHERE `group` > '0' "); $npost = Db::$num_rows; return $npost; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function find($code) { global $DB; global $website; $DB->query(' SELECT * FROM nv_coupons WHERE website = '.protect($website->id).' AND code = '.protect($code), 'object' ); $rs = $DB->result(); $out = false; if(!empty($rs)) { $coupon = new coupon(); $coupon->load_from_resultset($rs); $out = $coupon; } return $out; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function save_user() { if ( empty( $_POST['user_id'] ) ) { return false; } $user_id = $_POST['user_id']; if ( !is_numeric( $user_id ) ) { return $user_id; } if ( !current_user_can( 'edit_user', $user_id ) ) { return $user_id; } return $this->save_posted_object_location( $user_id ); }
0
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
$section = new section(intval($page)); if ($section) { // self::deleteLevel($section->id); $section->delete(); } } }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
$va[] = [$k2 => $m[$v2]];
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function update($data) { if ($this->securityController->isWikiHibernated()) { throw new \Exception(_t('WIKI_IN_HIBERNATION')); } return $this->dbService->query('UPDATE' . $this->dbService->prefixTable('nature') . 'SET ' . '`bn_label_nature`="' . addslashes(_convert($data['bn_label_nature'], YW_CHARSET, true)) . '" ,' . '`bn_template`="' . addslashes(_convert($data['bn_template'], YW_CHARSET, true)) . '" ,' . '`bn_description`="' . addslashes(_convert($data['bn_description'], YW_CHARSET, true)) . '" ,' . '`bn_sem_context`="' . addslashes(_convert($data['bn_sem_context'], YW_CHARSET, true)) . '" ,' . '`bn_sem_type`="' . addslashes(_convert($data['bn_sem_type'], YW_CHARSET, true)) . '" ,' . '`bn_sem_use_template`=' . (isset($data['bn_sem_use_template']) ? '1' : '0') . ' ,' . '`bn_condition`="' . addslashes(_convert($data['bn_condition'], YW_CHARSET, true)) . '"' . ' WHERE `bn_id_nature`=' . $data['bn_id_nature']);
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function dropdown($vars) { return Categories::dropdown($vars); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function remove() { $this->checkCSRFParam(); $project = $this->getProject(); $action = $this->getAction($project); if (! empty($action) && $this->actionModel->remove($action['id'])) { $this->flash->success(t('Action removed successfully.')); } else { $this->flash->failure(t('Unable to remove this action.')); } $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id']))); }
1
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
safe
static function displayname() { return "Events"; }
0
PHP
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
static function isSearchable() { return true; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function downloadFiles() { App()->loadLibrary('admin.pclzip'); $folder = basename(Yii::app()->request->getPost('folder', 'global')); $files = Yii::app()->request->getPost('files'); $tempdir = Yii::app()->getConfig('tempdir'); $randomizedFileName = $folder.'_'.substr(md5(time()),3,13).'.zip'; $zipfile = $tempdir.DIRECTORY_SEPARATOR.$randomizedFileName; $arrayOfFiles = array_map( function($file){ return $file['path']; }, $files); $archive = new PclZip($zipfile); $checkFileCreate = $archive->create($arrayOfFiles, PCLZIP_OPT_REMOVE_ALL_PATH); $urlFormat = Yii::app()->getUrlManager()->getUrlFormat(); $getFileLink = Yii::app()->createUrl('admin/filemanager/sa/getZipFile'); if($urlFormat == 'path') { $getFileLink .= '?path='.$zipfile; } else { $getFileLink .= '&path='.$zipfile; } $this->_printJsonResponse( [ 'success' => true, 'message' => sprintf(gT("Files are ready for download in archive %s."), $randomizedFileName), 'downloadLink' => $getFileLink , ] ); }
0
PHP
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
https://cwe.mitre.org/data/definitions/22.html
vulnerable
public function isAllowedFilename($filename){ $allow_array = array( '.jpg','.jpeg','.png','.bmp','.gif','.ico','.webp', '.mp3','.wav','.m4a','.ogg','.webma','.mp4','.flv', '.mov','.webmv','.flac','.mkv', '.zip','.tar','.gz','.tgz','.ipa','.apk','.rar','.iso','.bz2','.epub', '.pdf','.ofd','.swf','.epub','.xps', '.doc','.docx','.odt','.rtf','.docm','.dotm','.dot','.dotx','.wps', '.ppt','.pptx','.xls','.xlsx','.txt','.psd','.csv', '.cer','.ppt','.pub','.properties','.json','.css', ) ; $ext = strtolower(substr($filename,strripos($filename,'.')) ); //获取文件扩展名(转为小写后) if(in_array( $ext , $allow_array ) ){ return true ; } return false; }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
public function setArticles($articles) { $return = $this->setOneToMany($articles, Article::class, 'articles', 'container'); $this->setType('ctArticles'); return $return; }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function hasChildren($i) { global $sections; if (($i + 1) >= count($sections)) return false; return ($sections[$i]->depth < $sections[$i + 1]->depth) ? true : false; }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
function form_selectable_ecell($contents, $id, $width = '', $style_or_class = '', $title = '') { form_selectable_cell(html_escape($contents), $id, $width, $style_or_class, $title); }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function redirect($url) { if (trim($url) == '') { return false; } $url = str_ireplace('Location:', '', $url); $url = trim($url); $redirectUrl = site_url(); $parseUrl = parse_url($url); if (isset($parseUrl['host'])) { if(isset($parseUrl['user']) and $parseUrl['user']){ return \Redirect::to(site_url()); } if(isset($parseUrl['pass']) and $parseUrl['pass']){ return \Redirect::to(site_url()); } if ($parseUrl['host'] == site_hostname()) { $redirectUrl = $url; } } $redirectUrl = str_replace("\r", "", $redirectUrl); $redirectUrl = str_replace("\n", "", $redirectUrl); $clearInput = new HTMLClean(); $redirectUrl = $clearInput->clean($redirectUrl); if (headers_sent()) { echo '<meta http-equiv="refresh" content="0;url=' . $redirectUrl . '">'; } else { return \Redirect::to($redirectUrl); } }
1
PHP
CWE-601
URL Redirection to Untrusted Site ('Open Redirect')
A web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a Redirect. This simplifies phishing attacks.
https://cwe.mitre.org/data/definitions/601.html
safe
private function resize_gd($src, $width, $height, $quality, $srcImgInfo) { switch ($srcImgInfo['mime']) { case 'image/gif': if (@imagetypes() & IMG_GIF) { $oSrcImg = @imagecreatefromgif($src); } else { $ermsg = 'GIF images are not supported'; } break; case 'image/jpeg': if (@imagetypes() & IMG_JPG) { $oSrcImg = @imagecreatefromjpeg($src) ; } else { $ermsg = 'JPEG images are not supported'; } break; case 'image/png': if (@imagetypes() & IMG_PNG) { $oSrcImg = @imagecreatefrompng($src) ; } else { $ermsg = 'PNG images are not supported'; } break; case 'image/wbmp': if (@imagetypes() & IMG_WBMP) { $oSrcImg = @imagecreatefromwbmp($src); } else { $ermsg = 'WBMP images are not supported'; } break; default: $oSrcImg = false; $ermsg = $srcImgInfo['mime'].' images are not supported'; break; } if ($oSrcImg && false != ($tmp = imagecreatetruecolor($width, $height))) { if (!imagecopyresampled($tmp, $oSrcImg, 0, 0, 0, 0, $width, $height, $srcImgInfo[0], $srcImgInfo[1])) { return false; } switch ($srcImgInfo['mime']) { case 'image/gif': imagegif($tmp, $src); break; case 'image/jpeg': imagejpeg($tmp, $src, $quality); break; case 'image/png': if (function_exists('imagesavealpha') && function_exists('imagealphablending')) { imagealphablending($tmp, false); imagesavealpha($tmp, true); } imagepng($tmp, $src); break; case 'image/wbmp': imagewbmp($tmp, $src); break; } imagedestroy($oSrcImg); imagedestroy($tmp); return true; } return false; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function testOpenTrue() { $this->mock->expects($this->once()) ->method('open') ->will($this->returnValue(true)); $this->assertFalse($this->proxy->isActive()); $this->proxy->open('name', 'id'); $this->assertFalse($this->proxy->isActive()); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
function edit_option_master() { expHistory::set('editable', $this->params); $params = isset($this->params['id']) ? $this->params['id'] : $this->params; $record = new option_master($params); assign_to_template(array( 'record'=>$record )); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function go($input, $path, $allowed='', $uniq=false, $size='', $width = '', $height = ''){ $filename = Typo::cleanX($_FILES[$input]['name']); $filename = str_replace(' ', '_', $filename); if(isset($_FILES[$input]) && $_FILES[$input]['error'] == 0){ if($uniq == true){ $uniqfile = sha1(microtime().$filename); }else{ $uniqfile = ''; } $extension = pathinfo($_FILES[$input]['name'], PATHINFO_EXTENSION); $filetmp = $_FILES[$input]['tmp_name']; $filepath = GX_PATH.$path.$uniqfile.$filename; if(!in_array(strtolower($extension), $allowed)){ $result['error'] = 'File not allowed'; }else{ if(move_uploaded_file( $filetmp, $filepath) ){ $result['filesize'] = filesize($filepath); $result['filename'] = $uniqfile.$filename; $result['path'] = $path.$uniqfile.$filename; $result['filepath'] = $filepath; $result['fileurl'] = Site::$url.$path.$uniqfile.$filename; }else{ $result['error'] = 'Cannot upload to directory, please check if directory is exist or You had permission to write it.'; } } }else{ //$result['error'] = $_FILES[$input]['error']; $result['error'] = ''; } return $result; }
1
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
protected function filter($tokens, $config, $context) { $allowed = $config->get('Attr.AllowedClasses'); $forbidden = $config->get('Attr.ForbiddenClasses'); $ret = array(); foreach ($tokens as $token) { if ( ($allowed === null || isset($allowed[$token])) && !isset($forbidden[$token]) && // We need this O(n) check because of PHP's array // implementation that casts -0 to 0. !in_array($token, $ret, true) ) { $ret[] = $token; } } return $ret; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
private function drain( StreamInterface $source, StreamInterface $sink, $contentLength ) { // If a content-length header is provided, then stop reading once // that number of bytes has been read. This can prevent infinitely // reading from a stream when dealing with servers that do not honor // Connection: Close headers. Psr7\copy_to_stream( $source, $sink, strlen($contentLength) > 0 ? (int) $contentLength : -1 ); $sink->seek(0); $source->close(); return $sink; }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function testCalendarPages () { $this->visitPages ($this->getPages ('^calendar')); }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
foreach ($events as $event) { $extevents[$date][] = $event; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function startup(Event $event) { $controller = $event->subject(); $request = $controller->request; $response = $controller->response; $cookieName = $this->_config['cookieName']; $cookieData = $request->cookie($cookieName); if ($cookieData) { $request->params['_csrfToken'] = $cookieData; } if ($request->is('requested')) { return; } if ($request->is('get') && $cookieData === null) { $this->_setCookie($request, $response); } if (!$request->is(['head', 'get', 'options'])) { $this->_validateToken($request); unset($request->data[$this->_config['field']]); } }
1
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
function update_optiongroup_master() { global $db; $id = empty($this->params['id']) ? null : $this->params['id']; $og = new optiongroup_master($id); $oldtitle = $og->title; $og->update($this->params); // if the title of the master changed we should update the option groups that are already using it. if ($oldtitle != $og->title) { $db->sql('UPDATE '.$db->prefix.'optiongroup SET title="'.$og->title.'" WHERE title="'.$oldtitle.'"'); } expHistory::back(); }
0
PHP
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public function getSection() { global $db; if (expTheme::inAction()) { if (isset($_REQUEST['section'])) { $section = $this->url_style=="sef" ? $this->getPageByName($_REQUEST['section'])->id : intval($_REQUEST['section']) ; } else { $section = (expSession::is_set('last_section') ? expSession::get('last_section') : SITE_DEFAULT_SECTION); } } else { $section = (isset($_REQUEST['section']) ? intval($_REQUEST['section']) : SITE_DEFAULT_SECTION); } $testsection = $db->selectObject('section','id='.$section); if (empty($testsection)) { $section = SITE_DEFAULT_SECTION; } return $section; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
protected function _fopen($path, $mode='rb') { // try ftp stream wrapper if ($this->options['mode'] == 'passive' && ini_get('allow_url_fopen')) { $url = 'ftp://'.$this->options['user'].':'.$this->options['pass'].'@'.$this->options['host'].':'.$this->options['port'].$path; if (strtolower($mode[0]) === 'w') { $context = stream_context_create(array('ftp' => array('overwrite' => true))); $fp = fopen($url, $mode, false, $context); } else { $fp = fopen($url, $mode); } if ($fp) { return $fp; } } if ($this->tmp) { $local = $this->getTempFile($path); $fp = fopen($local, 'wb'); if (ftp_fget($this->connect, $fp, $path, FTP_BINARY)) { fclose($fp); $fp = fopen($local, $mode); return $fp; } fclose($fp); is_file($local) && unlink($local); } return false; }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
static function convertXMLFeedSafeChar($str) { $str = str_replace("<br>","",$str); $str = str_replace("</br>","",$str); $str = str_replace("<br/>","",$str); $str = str_replace("<br />","",$str); $str = str_replace("&quot;",'"',$str); $str = str_replace("&#39;","'",$str); $str = str_replace("&rsquo;","'",$str); $str = str_replace("&lsquo;","'",$str); $str = str_replace("&#174;","",$str); $str = str_replace("�","-", $str); $str = str_replace("�","-", $str); $str = str_replace("�", '"', $str); $str = str_replace("&rdquo;",'"', $str); $str = str_replace("�", '"', $str); $str = str_replace("&ldquo;",'"', $str); $str = str_replace("\r\n"," ",$str); $str = str_replace("�"," 1/4",$str); $str = str_replace("&#188;"," 1/4", $str); $str = str_replace("�"," 1/2",$str); $str = str_replace("&#189;"," 1/2",$str); $str = str_replace("�"," 3/4",$str); $str = str_replace("&#190;"," 3/4",$str); $str = str_replace("�", "(TM)", $str); $str = str_replace("&trade;","(TM)", $str); $str = str_replace("&reg;","(R)", $str); $str = str_replace("�","(R)",$str); $str = str_replace("&","&amp;",$str); $str = str_replace(">","&gt;",$str); return trim($str); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function searchCategory() { return gt('Event'); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function escape_command($command) { return preg_replace("/(\\\$|`)/", "", $command); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function getLastMessageID() { return $this->lastMessageID; }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
public static function mb_decode_mimeheader($s) { return iconv_mime_decode($s, 2, self::$internalEncoding); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
$text = preg_replace( $skipPat, '', $text ); } if ( self::open( $parser, $part1 ) ) { //Handle recursion here, so we can break cycles. if ( $recursionCheck == false ) { $text = $parser->preprocess( $text, $parser->mTitle, $parser->mOptions ); self::close( $parser, $part1 ); } if ( $maxLength > 0 ) { $text = self::limitTranscludedText( $text, $maxLength, $link ); } if ( $trim ) { return trim( $text ); } else { return $text; } } else { return "[[" . $title->getPrefixedText() . "]]" . "<!-- WARNING: LST loop detected -->"; } }
0
PHP
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
https://cwe.mitre.org/data/definitions/400.html
vulnerable
protected function prepareExport($model) { $this->openX2 ('/admin/exportModels?model='.ucfirst($model)); }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
public function testDuplicateAction() { $client = $this->getClientForAuthenticatedUser(User::ROLE_ADMIN); $this->request($client, '/admin/teams/1/duplicate'); $this->assertIsRedirect($client, '/edit'); $client->followRedirect(); $node = $client->getCrawler()->filter('#team_edit_form_name'); self::assertEquals(1, $node->count()); self::assertEquals('Test team [COPY]', $node->attr('value')); }
0
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
vulnerable
public static function error ($vars="") { if( isset($vars) && $vars != "" ) { include(GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php'); }else{ include(GX_PATH.'/inc/lib/Control/Error/404.control.php'); } }
0
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
vulnerable
function searchName() { return gt('Webpage'); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public static function parseAndTrimExport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-", $str); $str = str_replace("�", "&#151;", $str); $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); $str = str_replace("\t", " ", $str); $str = str_replace(",", "\,", $str); $str = str_replace("�", "&#188;", $str); $str = str_replace("�", "&#189;", $str); $str = str_replace("�", "&#190;", $str); if (!$isHTML) { $str = str_replace('\"', "&quot;", $str); $str = str_replace('"', "&quot;", $str); } else { $str = str_replace('"', '""', $str); } //$str = htmlspecialchars($str); //$str = utf8_encode($str); $str = trim(str_replace("�", "&trade;", $str)); //echo "2<br>"; eDebug($str,die); return $str; }
0
PHP
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
function import() { $pullable_modules = expModules::listInstalledControllers($this->baseclassname); $modules = new expPaginator(array( 'records' => $pullable_modules, 'controller' => $this->loc->mod, 'action' => $this->params['action'], 'order' => isset($this->params['order']) ? $this->params['order'] : 'section', 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '', 'page' => (isset($this->params['page']) ? $this->params['page'] : 1), 'columns' => array( gt('Title') => 'title', gt('Page') => 'section' ), )); assign_to_template(array( 'modules' => $modules, )); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function manage() { expHistory::set('manageable',$this->params); $gc = new geoCountry(); $countries = $gc->find('all'); $gr = new geoRegion(); $regions = $gr->find('all',null,'rank asc,name asc'); assign_to_template(array( 'countries'=>$countries, 'regions'=>$regions )); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function make($string) { return clone $this->clone; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public static function endReset( &$parser, $text ) { if ( !self::$createdLinks['resetdone'] ) { self::$createdLinks['resetdone'] = true; foreach ( $parser->getOutput()->mCategories as $key => $val ) { if ( array_key_exists( $key, self::$fixedCategories ) ) { self::$fixedCategories[$key] = $val; } } // $text .= self::dumpParsedRefs($parser,"before final reset"); if ( self::$createdLinks['resetLinks'] ) { $parser->getOutput()->mLinks = []; } if ( self::$createdLinks['resetCategories'] ) { $parser->getOutput()->mCategories = self::$fixedCategories; } if ( self::$createdLinks['resetTemplates'] ) { $parser->getOutput()->mTemplates = []; } if ( self::$createdLinks['resetImages'] ) { $parser->getOutput()->mImages = []; } // $text .= self::dumpParsedRefs( $parser, 'after final reset' ); self::$fixedCategories = []; } return true; }
0
PHP
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
https://cwe.mitre.org/data/definitions/400.html
vulnerable
foreach ($days as $value) { $regitem[] = $value; }
0
PHP
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
function edit_externalalias() { $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); if ($section->parent == -1) { notfoundController::handle_not_found(); exit; } // doesn't work for standalone pages if (empty($section->id)) { $section->public = 1; if (!isset($section->parent)) { // This is another precaution. The parent attribute // should ALWAYS be set by the caller. //FJD - if that's the case, then we should die. notfoundController::handle_not_authorized(); exit; //$section->parent = 0; } } assign_to_template(array( 'section' => $section, 'glyphs' => self::get_glyphs(), )); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function test_invite_set_password() { Notification::fake(); $user = $this->getViewer(); $inviteService = app(UserInviteService::class); $inviteService->sendInvitation($user); $token = DB::table('user_invites')->where('user_id', '=', $user->id)->first()->token; $setPasswordPageResp = $this->get('/register/invite/' . $token); $setPasswordPageResp->assertSuccessful(); $setPasswordPageResp->assertSee('Welcome to BookStack!'); $setPasswordPageResp->assertSee('Password'); $setPasswordPageResp->assertSee('Confirm Password'); $setPasswordResp = $this->followingRedirects()->post('/register/invite/' . $token, [ 'password' => 'my test password', ]); $setPasswordResp->assertSee('Password set, you now have access to BookStack!'); $newPasswordValid = auth()->validate([ 'email' => $user->email, 'password' => 'my test password', ]); $this->assertTrue($newPasswordValid); $this->assertDatabaseMissing('user_invites', [ 'user_id' => $user->id, ]); }
0
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
vulnerable
public static function lang($vars) { $file = GX_PATH.'/inc/lang/'.$vars.'.lang.php'; if (file_exists($file)) { include $file; } }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function getCodeDefinition() { return $this->codeDefinition; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function isOld($key, $config) { if (substr_count($key, ',') < 2) return true; list($version, $hash, $revision) = explode(',', $key, 3); $compare = version_compare($version, $config->version); // version mismatch, is always old if ($compare != 0) return true; // versions match, ids match, check revision number if ( $hash == $config->getBatchSerial($this->type) && $revision < $config->get($this->type . '.DefinitionRev') ) return true; return false; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
$db->updateObject($value, 'section'); } $db->updateObject($moveSec, 'section'); //handle re-ranking of previous parent $oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank"); $rerank = 1; foreach ($oldSiblings as $value) { if ($value->id != $moveSec->id) { $value->rank = $rerank; $db->updateObject($value, 'section'); $rerank++; } } if ($oldParent != $moveSec->parent) { //we need to re-rank the children of the parent that the moving section has just left $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { $childOfLastMove[$i]->rank = $i; $db->updateObject($childOfLastMove[$i], 'section'); } } } } self::checkForSectionalAdmins($move); expSession::clearAllUsersSessionCache('navigation'); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function updateObject($object, $table, $where=null, $identifier='id', $is_revisioned=false) { if ($is_revisioned) { $object->revision_id++; //if ($table=="text") eDebug($object); $res = $this->insertObject($object, $table); //if ($table=="text") eDebug($object,true); $this->trim_revisions($table, $object->$identifier, WORKFLOW_REVISION_LIMIT); return $res; } $sql = "UPDATE " . $this->prefix . "$table SET "; foreach (get_object_vars($object) as $var => $val) { //We do not want to save any fields that start with an '_' //if($is_revisioned && $var=='revision_id') $val++; if ($var{0} != '_') { if (is_array($val) || is_object($val)) { $val = serialize($val); $sql .= "`$var`='".$val."',"; } else { $sql .= "`$var`='" . $this->escapeString($val) . "',"; } } } $sql = substr($sql, 0, -1) . " WHERE "; if ($where != null) $sql .= $this->injectProof($where); else $sql .= "`" . $identifier . "`=" . $object->$identifier; //if ($table == 'text') eDebug($sql,true); $res = (@mysqli_query($this->connection, $sql) != false); return $res; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function saveConfig() { if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) { if ($this->params['order'] == 'rank ASC') { expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->params); } } parent::saveConfig(); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function attorn(){ $login_user = $this->checkLogin(); $username = I("username"); $item_id = I("item_id/d"); $password = I("password"); $item = D("Item")->where("item_id = '$item_id' ")->find(); if(!$this->checkItemManage($login_user['uid'] , $item['item_id'])){ $this->sendError(10303); return ; } if(! D("User")-> checkLogin($item['username'],$password)){ $this->sendError(10208); return ; } $member = D("User")->where(" username = '%s' ",array($username))->find(); if (!$member) { $this->sendError(10209); return ; } $data['username'] = $member['username'] ; $data['uid'] = $member['uid'] ; $id = D("Item")->where(" item_id = '$item_id' ")->save($data); $return = D("Item")->where("item_id = '$item_id' ")->find(); if (!$return) { $this->sendError(10101); } $this->sendResult($return); }
0
PHP
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
vulnerable
$name = ucfirst($module->name); if (in_array($name, $skipModules)) { continue; } if($name != 'Document'){ $controllerName = $name.'Controller'; if(file_exists( 'protected/modules/'.$module->name.'/controllers/'.$controllerName.'.php')){ Yii::import("application.modules.$module->name.controllers.$controllerName"); $controller = new $controllerName($controllerName); $model = $controller->modelClass; if(class_exists($model)){ $moduleList[$model] = Yii::t('app', $module->title); } } } } return $moduleList; }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
fwrite(STDERR, sprintf("%2d %s ==> %s\n", $i + 1, $test, var_export($result, true)));
0
PHP
CWE-330
Use of Insufficiently Random Values
The software uses insufficiently random numbers or values in a security context that depends on unpredictable numbers.
https://cwe.mitre.org/data/definitions/330.html
vulnerable
public function getList($location, $features, $etag, $mediatypes) { $featuresArray = explode(';', $features); $mediaTypesArray = explode(';', $mediatypes); try { return $this->getFilesAndAlbums($location, $featuresArray, $etag, $mediaTypesArray); } catch (\Exception $exception) { return $this->jsonError($exception); } }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
unset($options[$key]); } return $options; }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
$keys = array_keys($value); // print_r($keys); if ($keys[0] == $lang) { $lang = $multilang[$key][$lang]; return $lang; } } } }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function confirm() { $project = $this->getProject(); $this->response->html($this->helper->layout->project('column/remove', array( 'column' => $this->columnModel->getById($this->request->getIntegerParam('column_id')), 'project' => $project, ))); }
0
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
vulnerable
function unlockTables() { $sql = "UNLOCK TABLES"; $res = mysqli_query($this->connection, $sql); return $res; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
private function invertedSection($nodes, $id, $filters, $level) { $method = $this->getFindMethod($id); $id = var_export($id, true); $filters = $this->getFilters($filters, $level); return sprintf($this->prepare(self::INVERTED_SECTION, $level), $id, $method, $id, $filters, $this->walk($nodes, $level)); }
0
PHP
CWE-1336
Improper Neutralization of Special Elements Used in a Template Engine
The product uses a template engine to insert or process externally-influenced input, but it does not neutralize or incorrectly neutralizes special elements or syntax that can be interpreted as template expressions or other code directives when processed by the engine.
https://cwe.mitre.org/data/definitions/1336.html
vulnerable
public function params() { $project = $this->getProject(); $values = $this->request->getValues(); $values['project_id'] = $project['id']; if (empty($values['action_name']) || empty($values['event_name'])) { $this->create(); return; } $action = $this->actionManager->getAction($values['action_name']); $action_params = $action->getActionRequiredParameters(); if (empty($action_params)) { $this->doCreation($project, $values + array('params' => array())); } $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); unset($projects_list[$project['id']]); $this->response->html($this->template->render('action_creation/params', array( 'values' => $values, 'action_params' => $action_params, 'columns_list' => $this->columnModel->getList($project['id']), 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']), 'projects_list' => $projects_list, 'colors_list' => $this->colorModel->getList(), 'categories_list' => $this->categoryModel->getList($project['id']), 'links_list' => $this->linkModel->getList(0, false), 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project), 'project' => $project, 'available_actions' => $this->actionManager->getAvailableActions(), 'swimlane_list' => $this->swimlaneModel->getList($project['id']), 'events' => $this->actionManager->getCompatibleEvents($values['action_name']), ))); }
1
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
safe
public function __construct() { $this->smtp_conn = 0; $this->error = null; $this->helo_rply = null; $this->do_debug = 0; }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
function getErrorCode() { return $this->error->code; }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
function get_allowed_mime_types( $user = null ) { $t = wp_get_mime_types(); unset( $t['swf'], $t['exe'] ); if ( function_exists( 'current_user_can' ) ) $unfiltered = $user ? user_can( $user, 'unfiltered_html' ) : current_user_can( 'unfiltered_html' ); if ( empty( $unfiltered ) ) { unset( $t['htm|html'], $t['js'] ); } /** * Filters list of allowed mime types and file extensions. * * @since 2.0.0 * * @param array $t Mime types keyed by the file extension regex corresponding to * those types. 'swf' and 'exe' removed from full list. 'htm|html' also * removed depending on '$user' capabilities. * @param int|WP_User|null $user User ID, User object or null if not provided (indicates current user). */ return apply_filters( 'upload_mimes', $t, $user ); }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function getFilePath($fileName = null) { if ($fileName === null) { $fileName = $this->fileName; } // Limit paths to those under the assets directory $directory = $this->theme->getPath() . '/' . $this->dirName . '/'; $path = realpath($directory . $fileName); if (!starts_with($path, $directory)) { return false; } return $path; }
1
PHP
CWE-829
Inclusion of Functionality from Untrusted Control Sphere
The software imports, requires, or includes executable functionality (such as a library) from a source that is outside of the intended control sphere.
https://cwe.mitre.org/data/definitions/829.html
safe
public function confirm() { $project = $this->getProject(); $filter = $this->customFilterModel->getById($this->request->getIntegerParam('filter_id')); $this->response->html($this->helper->layout->project('custom_filter/remove', array( 'project' => $project, 'filter' => $filter, 'title' => t('Remove a custom filter') ))); }
0
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
vulnerable
public function params() { $project = $this->getProject(); $values = $this->request->getValues(); if (empty($values['action_name']) || empty($values['project_id']) || empty($values['event_name'])) { $this->create(); return; } $action = $this->actionManager->getAction($values['action_name']); $action_params = $action->getActionRequiredParameters(); if (empty($action_params)) { $this->doCreation($project, $values + array('params' => array())); } $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); unset($projects_list[$project['id']]); $this->response->html($this->template->render('action_creation/params', array( 'values' => $values, 'action_params' => $action_params, 'columns_list' => $this->columnModel->getList($project['id']), 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']), 'projects_list' => $projects_list, 'colors_list' => $this->colorModel->getList(), 'categories_list' => $this->categoryModel->getList($project['id']), 'links_list' => $this->linkModel->getList(0, false), 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project), 'project' => $project, 'available_actions' => $this->actionManager->getAvailableActions(), 'swimlane_list' => $this->swimlaneModel->getList($project['id']), 'events' => $this->actionManager->getCompatibleEvents($values['action_name']), ))); }
0
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
vulnerable
foreach ($days as $value) { $regitem[] = $value; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function process_subsections($parent_section, $subtpl) { global $db, $router; $section = new stdClass(); $section->parent = $parent_section->id; $section->name = $subtpl->name; $section->sef_name = $router->encode($section->name); $section->subtheme = $subtpl->subtheme; $section->active = $subtpl->active; $section->public = $subtpl->public; $section->rank = $subtpl->rank; $section->page_title = $subtpl->page_title; $section->keywords = $subtpl->keywords; $section->description = $subtpl->description; $section->id = $db->insertObject($section, 'section'); self::process_section($section, $subtpl); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
private static function executeTag( $input, array $args, Parser $parser, PPFrame $frame ) { // entry point for user tag <dpl> or <DynamicPageList> // create list and do a recursive parse of the output $parse = new \DPL\Parse(); if ( \DPL\Config::getSetting( 'recursiveTagParse' ) ) { $input = $parser->recursiveTagParse( $input, $frame ); } $text = $parse->parse( $input, $parser, $reset, $eliminate, true ); if ( isset( $reset['templates'] ) && $reset['templates'] ) { // we can remove the templates by save/restore $saveTemplates = $parser->getOutput()->mTemplates; } if ( isset( $reset['categories'] ) && $reset['categories'] ) { // we can remove the categories by save/restore $saveCategories = $parser->getOutput()->mCategories; } if ( isset( $reset['images'] ) && $reset['images'] ) { // we can remove the images by save/restore $saveImages = $parser->getOutput()->mImages; } $parsedDPL = $parser->recursiveTagParse( $text ); if ( isset( $reset['templates'] ) && $reset['templates'] ) { $parser->getOutput()->mTemplates = $saveTemplates; } if ( isset( $reset['categories'] ) && $reset['categories'] ) { $parser->getOutput()->mCategories = $saveCategories; } if ( isset( $reset['images'] ) && $reset['images'] ) { $parser->getOutput()->mImages = $saveImages; } return $parsedDPL; }
0
PHP
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
https://cwe.mitre.org/data/definitions/400.html
vulnerable
public function setPassword($newPassword, $doHashing = true) { global $gSettingsManager, $gPasswordHashAlgorithm, $gChangeNotification; if (!$doHashing) { if (is_object($gChangeNotification)) { $gChangeNotification->logUserChange( (int) $this->getValue('usr_id'), 'usr_password', $this->getValue('usr_password'), $newPassword, $this ); } return parent::setValue('usr_password', $newPassword, false); } // get the saved cost value that fits your server performance best and rehash your password $options = array('cost' => 10); if (isset($gSettingsManager) && $gSettingsManager->has('system_hashing_cost')) { $options['cost'] = $gSettingsManager->getInt('system_hashing_cost'); } $newPasswordHash = PasswordUtils::hash($newPassword, $gPasswordHashAlgorithm, $options); if ($newPasswordHash === false) { return false; } if (is_object($gChangeNotification)) { $gChangeNotification->logUserChange( (int) $this->getValue('usr_id'), 'usr_password', $this->getValue('usr_password'), $newPasswordHash, $this ); } return parent::setValue('usr_password', $newPasswordHash, false); }
0
PHP
CWE-613
Insufficient Session Expiration
According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization."
https://cwe.mitre.org/data/definitions/613.html
vulnerable
foreach ($fields as $field => $title) { if($i==0 && $j==0){ echo '<div class="row">'; }elseif($i==0 && $j>0){ echo '</div><div class="row">'; } echo '<div class="col-md-6"><label class="checkbox-inline"><INPUT type=checkbox onclick="addHTML(\'<LI>' . $title . '</LI>\',\'names_div\',false);addHTML(\'<INPUT type=hidden name=fields[' . $field . '] value=Y>\',\'fields_div\',false);addHTML(\'\',\'names_div_none\',true);this.disabled=true">' . $title . '<label></div>'; /*if ($i % 2 == 0) echo '</TR><TR>';*/ $i++; if($i==2){ $i = 0; } $j++; }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
(empty($object_uid)? '' : ' AND node_uid = '.protect($object_uid)).' AND website = '.$website->id );
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
foreach ($nodes as $node) { if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { if ($node->active == 1) { $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; } else { $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; } $ar[$node->id] = $text; foreach (self::levelDropdownControlArray($node->id, $depth + 1, $ignore_ids, $full, $perm, $addstandalones, $addinternalalias) as $id => $text) { $ar[$id] = $text; } } }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
function categoryBreadcrumb() { // global $db, $router; //eDebug($this->category); /*if(isset($router->params['action'])) { $ancestors = $this->category->pathToNode(); }else if(isset($router->params['section'])) { $current = $db->selectObject('section',' id= '.$router->params['section']); $ancestors[] = $current; if( $current->parent != -1 || $current->parent != 0 ) { while ($db->selectObject('section',' id= '.$router->params['section']);) if ($section->id == $id) { $current = $section; break; } } } eDebug($sections); $ancestors = $this->category->pathToNode(); }*/ $ancestors = $this->category->pathToNode(); // eDebug($ancestors); assign_to_template(array( 'ancestors' => $ancestors )); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function LoadContainingTag($commit) { if (!$commit) return; $args = array(); $args[] = '--tags'; $args[] = $commit->GetHash(); $revs = explode("\n", $this->exe->Execute($commit->GetProject()->GetPath(), GIT_NAME_REV, $args)); foreach ($revs as $revline) { if (preg_match('/^([0-9a-fA-F]{40})\s+tags\/(.+)(\^[0-9]+|\~[0-9]+)$/', $revline, $regs)) { if ($regs[1] == $commit->GetHash()) { return $regs[2]; } } } }
0
PHP
CWE-78
Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/78.html
vulnerable
function edit_freeform() { $section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params); if ($section->parent == -1) { notfoundController::handle_not_found(); exit; } // doesn't work for standalone pages if (empty($section->id)) { $section->public = 1; if (!isset($section->parent)) { // This is another precaution. The parent attribute // should ALWAYS be set by the caller. //FJD - if that's the case, then we should die. notfoundController::handle_not_authorized(); exit; //$section->parent = 0; } } assign_to_template(array( 'section' => $section, 'glyphs' => self::get_glyphs(), )); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
private function SendHello($hello, $host) { fputs($this->smtp_conn, $hello . " " . $host . $this->CRLF); $rply = $this->get_lines(); $code = substr($rply,0,3); if($this->do_debug >= 2) { $this->edebug("SMTP -> FROM SERVER: " . $rply . $this->CRLF . '<br />'); } if($code != 250) { $this->error = array("error" => $hello . " not accepted from server", "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { $this->edebug("SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF . '<br />'); } return false; } $this->helo_rply = $rply; return true; }
0
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
private function getCategory() { $category = $this->categoryModel->getById($this->request->getIntegerParam('category_id')); if (empty($category)) { throw new PageNotFoundException(); } return $category; }
0
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
vulnerable
public function testIpAddressOfRangedTrustedProxyIsSetAsRemote() { $expectedSubRequest = Request::create('/'); $expectedSubRequest->headers->set('Surrogate-Capability', 'abc="ESI/1.0"'); $expectedSubRequest->server->set('REMOTE_ADDR', '1.1.1.1'); $expectedSubRequest->headers->set('x-forwarded-for', array('127.0.0.1')); $expectedSubRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1'); Request::setTrustedProxies(array('1.1.1.1/24')); $strategy = new InlineFragmentRenderer($this->getKernelExpectingRequest($expectedSubRequest)); $request = Request::create('/'); $request->headers->set('Surrogate-Capability', 'abc="ESI/1.0"'); $strategy->render('/', $request); Request::setTrustedProxies(array()); }
0
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
private function createSink(StreamInterface $stream, array $options) { if (!empty($options['stream'])) { return $stream; } $sink = isset($options['sink']) ? $options['sink'] : fopen('php://temp', 'r+'); return is_string($sink) ? new Psr7\Stream(Psr7\try_fopen($sink, 'r+')) : Psr7\stream_for($sink); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function categoryBreadcrumb() { // global $db, $router; //eDebug($this->category); /*if(isset($router->params['action'])) { $ancestors = $this->category->pathToNode(); }else if(isset($router->params['section'])) { $current = $db->selectObject('section',' id= '.$router->params['section']); $ancestors[] = $current; if( $current->parent != -1 || $current->parent != 0 ) { while ($db->selectObject('section',' id= '.$router->params['section']);) if ($section->id == $id) { $current = $section; break; } } } eDebug($sections); $ancestors = $this->category->pathToNode(); }*/ $ancestors = $this->category->pathToNode(); // eDebug($ancestors); assign_to_template(array( 'ancestors' => $ancestors )); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
$instance->processor = [0 => ${($_ = isset($this->services['App\\Db']) ? $this->services['App\\Db'] : $this->getDbService()) && false ?: '_'}, 1 => ${($_ = isset($this->services['App\\Bus']) ? $this->services['App\\Bus'] : $this->getBusService()) && false ?: '_'}];
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
private function __simple_query($cmd) { if (!empty($this->__setup['resources'])) { $this->__request_object['search'] = $this->__setup['resources']; } $commandFile = $this->__generateCommandFile(); $results = shell_exec($cmd . ' --query_data ' . $commandFile); unlink($commandFile); return $results; }
1
PHP
NVD-CWE-noinfo
null
null
null
safe
public function fromData($data, $filename) { if ($data === null) { return; } $tempPath = temp_path(basename($filename)); FileHelper::put($tempPath, $data); $file = $this->fromFile($tempPath); FileHelper::delete($tempPath); return $file; }
0
PHP
CWE-362
Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
The program contains a code sequence that can run concurrently with other code, and the code sequence requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence that is operating concurrently.
https://cwe.mitre.org/data/definitions/362.html
vulnerable
public function testGetAuthorityReturnsCorrectPort() { // HTTPS non-standard port $uri = new Uri('https://foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // HTTP non-standard port $uri = new Uri('http://foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // No scheme $uri = new Uri('foo.co:99'); $this->assertEquals('foo.co:99', $uri->getAuthority()); // No host or port $uri = new Uri('http:'); $this->assertEquals('', $uri->getAuthority()); // No host or port $uri = new Uri('http://foo.co'); $this->assertEquals('foo.co', $uri->getAuthority()); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function update() { parent::update(); expSession::clearAllUsersSessionCache('navigation'); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public function column_title( $post ) { list( $mime ) = explode( '/', $post->post_mime_type ); $title = _draft_or_post_title(); $thumb = wp_get_attachment_image( $post->ID, array( 60, 60 ), true, array( 'alt' => '' ) ); $link_start = $link_end = ''; if ( current_user_can( 'edit_post', $post->ID ) && ! $this->is_trash ) { $link_start = sprintf( '<a href="%s" aria-label="%s">', get_edit_post_link( $post->ID ), /* translators: %s: attachment title */ esc_attr( sprintf( __( '&#8220;%s&#8221; (Edit)' ), $title ) ) ); $link_end = '</a>'; } $class = $thumb ? ' class="has-media-icon"' : ''; ?> <strong<?php echo $class; ?>> <?php echo $link_start; if ( $thumb ) : ?> <span class="media-icon <?php echo sanitize_html_class( $mime . '-icon' ); ?>"><?php echo $thumb; ?></span> <?php endif; echo $title . $link_end; _media_states( $post ); ?> </strong> <p class="filename"> <span class="screen-reader-text"><?php _e( 'File name:' ); ?> </span> <?php $file = get_attached_file( $post->ID ); echo esc_html( wp_basename( $file ) ); ?> </p> <?php }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
public function onUpLoadPreSave(&$path, &$name, $src, $elfinder, $volume) { $opts = $this->opts; $volOpts = $volume->getOptionsPlugin('AutoRotate'); if (is_array($volOpts)) { $opts = array_merge($this->opts, $volOpts); } if (! $opts['enable']) { return false; } $srcImgInfo = getimagesize($src); if ($srcImgInfo === false) { return false; } // check target image type if ($srcImgInfo[2] !== IMAGETYPE_JPEG) { return false; } return $this->rotate($volume, $src, $srcImgInfo, $opts['quality']); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public static function restoreX2WebUser () { if (isset (self::$_oldUserComponent)) { Yii::app()->setComponent ('user', self::$_oldUserComponent); } }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
public function execute(&$params) { $listIdentifier=$this->parseOption('listId',$params); if(is_numeric($listIdentifier)){ $list = CActiveRecord::model('X2List')->findByPk($listIdentifier); }else{ $list = CActiveRecord::model('X2List')->findByAttributes( array('name'=>$listIdentifier)); } if($list !== null && $list->modelName === get_class($params['model'])) { if ($list->addIds($params['model']->id)) { return array (true, ""); } } return array (false, ""); }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
$rst[$key] = self::parseAndTrim($st, $unescape); } return $rst; } $str = str_replace("<br>"," ",$str); $str = str_replace("</br>"," ",$str); $str = str_replace("<br/>"," ",$str); $str = str_replace("<br />"," ",$str); $str = str_replace("\r\n"," ",$str); $str = str_replace('"',"&quot;",$str); $str = str_replace("'","&#39;",$str); $str = str_replace("’","&rsquo;",$str); $str = str_replace("‘","&lsquo;",$str); $str = str_replace("®","&#174;",$str); $str = str_replace("–","-", $str); $str = str_replace("—","&#151;", $str); $str = str_replace("”","&rdquo;", $str); $str = str_replace("“","&ldquo;", $str); $str = str_replace("¼","&#188;",$str); $str = str_replace("½","&#189;",$str); $str = str_replace("¾","&#190;",$str); $str = str_replace("™","&trade;", $str); $str = trim($str); if ($unescape) { $str = stripcslashes($str); } else { $str = addslashes($str); } return $str; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function testAggregatesHeaders() { $r = new Request('GET', 'http://foo.com', [ 'ZOO' => 'zoobar', 'zoo' => ['foobar', 'zoobar'] ]); $this->assertEquals('zoobar, foobar, zoobar', $r->getHeaderLine('zoo')); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable