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
$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
function move_standalone() { expSession::clearAllUsersSessionCache('navigation'); assign_to_template(array( 'parent' => $this->params['parent'], )); }
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 edit_optiongroup_master() { expHistory::set('editable', $this->params); $id = isset($this->params['id']) ? $this->params['id'] : null; $record = new optiongroup_master($id); 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 function requestAsync($method, $uri = null, array $options = []) { $options = $this->prepareDefaults($options); // Remove request modifying parameter because it can be done up-front. $headers = isset($options['headers']) ? $options['headers'] : []; $body = isset($options['body']) ? $options['body'] : null; $version = isset($options['version']) ? $options['version'] : '1.1'; // Merge the URI into the base URI. $uri = $this->buildUri($uri, $options); if (is_array($body)) { $this->invalidBody(); } $request = new Psr7\Request($method, $uri, $headers, $body, $version); // Remove the option so that they are not doubly-applied. unset($options['headers'], $options['body'], $options['version']); return $this->transfer($request, $options); }
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 withUserInfo($user, $password = null) { $info = $user; if ($password) { $info .= ':' . $password; } if ($this->userInfo === $info) { return $this; } $new = clone $this; $new->userInfo = $info; return $new; }
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 hasNext() { return count($this->tokens) > 1 + $this->i; }
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
protected function replaceTagCount( $tag, $nr ) { return str_replace( '%NR%', $nr, $tag ); }
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 showUnpublished() { expHistory::set('viewable', $this->params); // setup the where clause for looking up records. $where = parent::aggregateWhereClause(); $where = "((unpublish != 0 AND unpublish < ".time().") OR (publish > ".time().")) AND ".$where; if (isset($this->config['only_featured'])) $where .= ' AND is_featured=1'; $page = new expPaginator(array( 'model'=>'news', 'where'=>$where, 'limit'=>25, 'order'=>'unpublish', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->baseclassname, 'action'=>$this->params['action'], 'src'=>$this->loc->src, 'columns'=>array( gt('Title')=>'title', gt('Published On')=>'publish', gt('Status')=>'unpublish' ), )); assign_to_template(array( 'page'=>$page )); }
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 show() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask_converter/show', array( 'subtask' => $subtask, 'task' => $task, ))); }
0
PHP
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
vulnerable
public function updateTab($id, $array) { if (!$id || $id == '') { $this->setAPIResponse('error', 'id was not set', 422); return null; } if (!$array) { $this->setAPIResponse('error', 'no data was sent', 422); return null; } $tabInfo = $this->getTabById($id); if ($tabInfo) { $array = $this->checkKeys($tabInfo, $array); } else { $this->setAPIResponse('error', 'No tab info found', 404); return false; } if (array_key_exists('name', $array)) { $array['name'] = htmlspecialchars($array['name']); if ($this->isTabNameTaken($array['name'], $id)) { $this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409); return false; } } if (array_key_exists('default', $array)) { if ($array['default']) { $this->clearTabDefault(); } } $response = [ array( 'function' => 'query', 'query' => array( 'UPDATE tabs SET', $array, 'WHERE id = ?', $id ) ), ]; $this->setAPIResponse(null, 'Tab info updated'); $this->setLoggerChannel('Tab Management'); $this->logger->debug('Edited Tab Info for [' . $tabInfo['name'] . ']'); return $this->processQueries($response); }
0
PHP
CWE-434
Unrestricted Upload of File with Dangerous Type
The software allows the attacker to upload or transfer files of dangerous types that can be automatically processed within the product's environment.
https://cwe.mitre.org/data/definitions/434.html
vulnerable
public function getItems2 ( $prefix='', $page=0, $limit=20, $valueAttr='name', $nameAttr='name') { $modelClass = get_class ($this->owner); $model = CActiveRecord::model ($modelClass); $table = $model->tableName (); $offset = intval ($page) * intval ($limit); AuxLib::coerceToArray ($valueAttr); $modelClass::checkThrowAttrError (array_merge ($valueAttr, array ($nameAttr))); $params = array (); if ($prefix !== '') { $params[':prefix'] = $prefix . '%'; } if ($limit !== -1) { $offset = abs ((int) $offset); $limit = abs ((int) $limit); $limitClause = "LIMIT $offset, $limit"; } if ($model->asa ('permissions')) { list ($accessCond, $permissionsParams) = $model->getAccessSQLCondition (); $params = array_merge ($params, $permissionsParams); } $command = Yii::app()->db->createCommand (" SELECT " . implode (',', $valueAttr) . ", $nameAttr as __name FROM $table as t WHERE " . ($prefix === '' ? '1=1' : ($nameAttr . ' LIKE :prefix') ) . (isset ($accessCond) ? " AND $accessCond" : '') . "
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
static function convertUTF($string) { return $string = str_replace('?', '', htmlspecialchars($string, ENT_IGNORE, 'UTF-8')); }
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
$contents = ['form' => tep_draw_form('zones', 'zones.php', 'page=' . $_GET['page'] . '&action=insert')];
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 load($mod) { $file = GX_MOD."/".$mod."/index.php"; if(file_exists($file)){ include ($file); } }
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 get_item_permissions_check( $request ) { $term = $this->get_term( $request['id'] ); if ( is_wp_error( $term ) ) { return $term; } if ( 'edit' === $request['context'] && ! current_user_can( 'edit_term', $term->term_id ) ) { return new WP_Error( 'rest_forbidden_context', __( 'Sorry, you are not allowed to edit this term.' ), array( 'status' => rest_authorization_required_code() ) ); } return true; }
1
PHP
NVD-CWE-noinfo
null
null
null
safe
static function displayname() { return gt("e-Commerce Category Manager"); }
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
$stack = array_merge($stack, array_reverse($array, true)); for ($i = count($array); $i > 0; $i--) { $context_stack[] = $context; } } }
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
function edit() { global $template; parent::edit(); $allforms = array(); $allforms[""] = gt('Disallow Feedback'); // calculate which event date is the one being edited $event_key = 0; foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) { if ($d->id == $this->params['date_id']) $event_key = $key; } assign_to_template(array( 'allforms' => array_merge($allforms, expTemplate::buildNameList("forms", "event/email", "tpl", "[!_]*")), 'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null, 'event_key' => $event_key, )); }
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
static function canView() { return Session::haveRight(self::$rightname, READ); }
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 function AddCC($address, $name = '') { return $this->AddAnAddress('cc', $address, $name); }
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 ridOld() { $json = Options::get('tokens'); $tokens = json_decode($json, true); $time = time(); foreach ($tokens as $token => $value) { # code... //print_r($token); if ($time - $value['time'] > 600) { # code... unset($tokens[$token]); } } $tokens = json_encode($tokens); if(Options::update('tokens',$tokens)){ return true; }else{ return false; } }
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
public function manage_sitemap() { global $db, $user, $sectionObj, $sections; expHistory::set('viewable', $this->params); $id = $sectionObj->id; $current = null; // all we need to do is determine the current section $navsections = $sections; if ($sectionObj->parent == -1) { $current = $sectionObj; } else { foreach ($navsections as $section) { if ($section->id == $id) { $current = $section; break; } } } assign_to_template(array( 'sasections' => $db->selectObjects('section', 'parent=-1'), 'sections' => $navsections, 'current' => $current, 'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0), )); }
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 enable() { $this->checkCSRFParam(); $project = $this->getProject(); $swimlane_id = $this->request->getIntegerParam('swimlane_id'); if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) { $this->flash->success(t('Swimlane updated successfully.')); } else { $this->flash->failure(t('Unable to update this swimlane.')); } $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); }
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
private function doCreation(array $project, array $values) { $values['project_id'] = $project['id']; list($valid, ) = $this->actionValidator->validateCreation($values); if ($valid) { if ($this->actionModel->create($values) !== false) { $this->flash->success(t('Your automatic action have been created successfully.')); } else { $this->flash->failure(t('Unable to create your automatic action.')); } } $this->response->redirect($this->helper->url->to('ActionController', 'index', array('project_id' => $project['id']))); }
1
PHP
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
safe
public function search_external() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.source as source, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->prefix . "external_addresses as a "; //R JOIN " . //$db->prefix . "billingmethods as bm ON bm.addresses_id=a.id "; $sql .= " WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) "; $sql .= "order by match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) ASC LIMIT 12"; $res = $db->selectObjectsBySql($sql); foreach ($res as $key=>$record) { $res[$key]->title = $record->firstname . ' ' . $record->lastname; } //eDebug($sql); $ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res); $ar->send(); }
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
} elseif (isset($graph['data_query_name'])) { if (isset($prev_data_query_name)) { if ($prev_data_query_name != $graph['data_query_name']) { $print = true; $prev_data_query_name = $graph['data_query_name']; } else { $print = false; } } else { $print = true; $prev_data_query_name = $graph['data_query_name']; } if ($print) { if (!$start) { while(($i % $columns) != 0) { print "<td style='text-align:center;width:" . round(100 / $columns, 3) . "%;'></td>"; $i++; } print "</tr>\n"; } print "<tr class='tableHeader'> <td class='graphSubHeaderColumn textHeaderDark' colspan='$columns'>" . __('Data Query:') . ' ' . $graph['data_query_name'] . "</td> </tr>\n"; $i = 0; } } if ($i == 0) { print "<tr class='tableRowGraph'>\n"; $start = false; } ?> <td style='width:<?php print round(100 / $columns, 2);?>%;'> <table style='text-align:center;margin:auto;'> <tr> <td> <div class='graphWrapper' id='wrapper_<?php print $graph['local_graph_id']?>' graph_width='<?php print read_user_setting('default_width');?>' graph_height='<?php print read_user_setting('default_height');?>'></div> <?php print (read_user_setting('show_graph_title') == 'on' ? "<span class='center'>" . html_escape($graph['title_cache']) . '</span>' : '');?> </td> <td id='dd<?php print $graph['local_graph_id'];?>' class='noprint graphDrillDown'> <?php print graph_drilldown_icons($graph['local_graph_id'], 'graph_buttons_thumbnails');?> </td> </tr> </table> </td> <?php $i++; $k++; if (($i % $columns) == 0 && ($k < $num_graphs)) { $i=0; $j++; print "</tr>\n"; $start = true; } } if (!$start) { while(($i % $columns) != 0) { print "<td style='text-align:center;width:" . round(100 / $columns, 2) . "%;'></td>"; $i++; } print "</tr>\n"; } } else {
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 autocomplete() { return; global $db; $model = $this->params['model']; $mod = new $model(); $srchcol = explode(",",$this->params['searchoncol']); /*for ($i=0; $i<count($srchcol); $i++) { if ($i>=1) $sql .= " OR "; $sql .= $srchcol[$i].' LIKE \'%'.$this->params['query'].'%\''; }*/ // $sql .= ' AND parent_id=0'; //eDebug($sql); //$res = $mod->find('all',$sql,'id',25); $sql = "select DISTINCT(p.id), p.title, model, sef_url, f.id as fileid from ".$db->prefix."product as p INNER JOIN ".$db->prefix."content_expfiles as cef ON p.id=cef.content_id INNER JOIN ".$db->prefix."expfiles as f ON cef.expfiles_id = f.id where match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') AND p.parent_id=0 order by match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') desc LIMIT 25"; //$res = $db->selectObjectsBySql($sql); //$res = $db->selectObjectBySql('SELECT * FROM `exponent_product`'); $ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res); $ar->send(); }
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 error ($vars="", $val='') { if( isset($vars) && $vars != "" ) { $file = GX_PATH.'/inc/lib/Control/Error/'.$vars.'.control.php'; if (file_exists($file)) { include($file); } }else{ include(GX_PATH.'/inc/lib/Control/Error/unknown.control.php'); } }
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
static function author() { return "Dave Leffler"; }
1
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
safe
public function testSetSaveHandler53() { if (PHP_VERSION_ID >= 50400) { $this->markTestSkipped('Test skipped, for PHP 5.3 only.'); } $this->iniSet('session.save_handler', 'files'); $storage = $this->getStorage(); $storage->setSaveHandler(); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); $storage->setSaveHandler(null); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); $storage->setSaveHandler(new NativeSessionHandler()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); $storage->setSaveHandler(new SessionHandlerProxy(new NullSessionHandler())); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); $storage->setSaveHandler(new NullSessionHandler()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy', $storage->getSaveHandler()); $storage->setSaveHandler(new NativeProxy()); $this->assertInstanceOf('Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy', $storage->getSaveHandler()); }
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 rss() { switch (SMART_URL) { case true: # code... $inFold = (Options::v('permalink_use_index_php') == 'on') ? '/index.php' : ''; $url = Site::$url.$inFold.'/rss'.GX_URL_PREFIX; break; default: # code... $url = Site::$url.'/index.php?rss'; break; } return $url; }
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 manage_vendors () { expHistory::set('viewable', $this->params); $vendor = new vendor(); $vendors = $vendor->find('all'); assign_to_template(array( 'vendors'=>$vendors )); }
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 static function referenceFixtures () { return array ( 'contacts' => 'Contacts', 'tags' => 'Tags', ); }
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 testGetMimeTypesFromInexistentFormat() { $request = new Request(); $this->assertNull($request->getMimeType('foo')); $this->assertEquals(array(), Request::getMimeTypes('foo')); }
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 show() { $task = $this->getTask(); $subtask = $this->getSubtask(); $this->response->html($this->template->render('subtask_restriction/show', array( 'status_list' => array( SubtaskModel::STATUS_TODO => t('Todo'), SubtaskModel::STATUS_DONE => t('Done'), ), 'subtask_inprogress' => $this->subtaskStatusModel->getSubtaskInProgress($this->userSession->getId()), 'subtask' => $subtask, 'task' => $task, ))); }
0
PHP
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
vulnerable
} elseif ($node->nodeType === XML_COMMENT_NODE) { // this is code is only invoked for comments in script/style in versions // of libxml pre-2.6.28 (regular comments, of course, are still // handled regularly) $tokens[] = $this->factory->createComment($node->data); return false; } elseif (
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 breadcrumb() { global $sectionObj; expHistory::set('viewable', $this->params); $id = $sectionObj->id; $current = null; // Show not only the location of a page in the hierarchy but also the location of a standalone page $current = new section($id); if ($current->parent == -1) { // standalone page $navsections = section::levelTemplate(-1, 0); foreach ($navsections as $section) { if ($section->id == $id) { $current = $section; break; } } } else { $navsections = section::levelTemplate(0, 0); foreach ($navsections as $section) { if ($section->id == $id) { $current = $section; break; } } } assign_to_template(array( 'sections' => $navsections, 'current' => $current, )); }
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 search() { // global $db, $user; global $db; $sql = "select DISTINCT(a.id) as id, a.firstname as firstname, a.middlename as middlename, a.lastname as lastname, a.organization as organization, a.email as email "; $sql .= "from " . $db->prefix . "addresses as a "; //R JOIN " . //$db->prefix . "billingmethods as bm ON bm.addresses_id=a.id "; $sql .= " WHERE match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) "; $sql .= "order by match (a.firstname,a.lastname,a.email,a.organization) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) ASC LIMIT 12"; $res = $db->selectObjectsBySql($sql); foreach ($res as $key=>$record) { $res[$key]->title = $record->firstname . ' ' . $record->lastname; } //eDebug($sql); $ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res); $ar->send(); }
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 theme_switch() { if (!expUtil::isReallyWritable(BASE.'framework/conf/config.php')) { // we can't write to the config.php file flash('error',gt('The file /framework/conf/config.php is NOT Writeable. You will be unable to change the theme.')); } expSettings::change('DISPLAY_THEME_REAL', $this->params['theme']); expSession::set('display_theme',$this->params['theme']); $sv = isset($this->params['sv'])?$this->params['sv']:''; if (strtolower($sv)=='default') { $sv = ''; } expSettings::change('THEME_STYLE_REAL',$sv); expSession::set('theme_style',$sv); expDatabase::install_dbtables(); // update tables to include any custom definitions in the new theme // $message = (MINIFY != 1) ? "Exponent is now minifying Javascript and CSS" : "Exponent is no longer minifying Javascript and CSS" ; // flash('message',$message); $message = gt("You have selected the")." '".$this->params['theme']."' ".gt("theme"); if ($sv != '') { $message .= ' '.gt('with').' '.$this->params['sv'].' '.gt('style variation'); } flash('message',$message); // expSession::un_set('framework'); expSession::set('force_less_compile', 1); // expTheme::removeSmartyCache(); expSession::clearAllUsersSessionCache(); expHistory::returnTo('manageable'); }
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
$file_link = explode(" ", trim(xss_clean($row['file'])))[0]; // If the link has no "http://" in front, then add it if (substr(strtolower($file_link), 0, 4) !== 'http') { $file_link = 'http://' . $file_link; } echo '<td><a href="http://anonym.to/?' . $file_link . '" target="_blank"><img class="icon" src="images/warning.png"/>http://anonym.to/?' . $file_link . '</a></td>'; echo '<td><a href="include/play.php?f=' . $row['session'] . '" target="_blank"><img class="icon" src="images/play.ico"/>Play</a></td>'; echo '<td><a href="kippo-scanner.php?file_url=' . $file_link . '" target="_blank">Scan File</a></td>'; echo '</tr>'; $counter++; }
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 admin_add() { $this->pageTitle = __d('baser', 'テーマアップロード'); $this->subMenuElements = ['themes']; if (!$this->request->is(['post', 'put'])) { return; } if ($this->Theme->isOverPostSize()) { $this->BcMessage->setError( __d( 'baser', '送信できるデータ量を超えています。合計で %s 以内のデータを送信してください。', ini_get('post_max_size') ) ); } if (empty($this->request->data['Theme']['file']['tmp_name'])) { $message = __d('baser', 'ファイルのアップロードに失敗しました。'); if (!empty($this->request->data['Theme']['file']['error']) && $this->request->data['Theme']['file']['error'] == 1) { $message .= __d('baser', 'サーバに設定されているサイズ制限を超えています。'); } $this->BcMessage->setError($message); return; } $name = $this->request->data['Theme']['file']['name']; move_uploaded_file($this->request->data['Theme']['file']['tmp_name'], TMP . $name); App::uses('BcZip', 'Lib'); $BcZip = new BcZip(); if (!$BcZip->extract(TMP . $name, BASER_THEMES)) { $msg = __d('baser', 'アップロードしたZIPファイルの展開に失敗しました。'); $msg .= "\n" . $BcZip->error; $this->BcMessage->setError($msg); return; } unlink(TMP . $name); $this->BcMessage->setInfo('テーマファイル「' . $name . '」を追加しました。'); $this->redirect(['action' => 'index']); }
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
public function testGroupsPages () { $this->visitPages ($this->getPages ('^groups')); }
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
private function normalize($str, $opts) { if ($opts['nfc'] || $opts['nfkc']) { if (class_exists('Normalizer', false)) { if ($opts['nfc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_C)) $str = Normalizer::normalize($str, Normalizer::FORM_C); if ($opts['nfkc'] && ! Normalizer::isNormalized($str, Normalizer::FORM_KC)) $str = Normalizer::normalize($str, Normalizer::FORM_KC); } else { if (! class_exists('I18N_UnicodeNormalizer', false)) { include_once 'I18N/UnicodeNormalizer.php'; } if (class_exists('I18N_UnicodeNormalizer', false)) { $normalizer = new I18N_UnicodeNormalizer(); if ($opts['nfc']) $str = $normalizer->normalize($str, 'NFC'); if ($opts['nfkc']) $str = $normalizer->normalize($str, 'NFKC'); } } } if ($opts['convmap'] && is_array($opts['convmap'])) { $str = strtr($str, $opts['convmap']); } if ($opts['lowercase']) { if (function_exists('mb_strtolower')) { $str = mb_strtolower($str, 'UTF-8'); } else { $str = strtolower($str); } } return $str; }
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 theme_switch() { if (!expUtil::isReallyWritable(BASE.'framework/conf/config.php')) { // we can't write to the config.php file flash('error',gt('The file /framework/conf/config.php is NOT Writeable. You will be unable to change the theme.')); } expSettings::change('DISPLAY_THEME_REAL', $this->params['theme']); expSession::set('display_theme',$this->params['theme']); $sv = isset($this->params['sv'])?$this->params['sv']:''; if (strtolower($sv)=='default') { $sv = ''; } expSettings::change('THEME_STYLE_REAL',$sv); expSession::set('theme_style',$sv); expDatabase::install_dbtables(); // update tables to include any custom definitions in the new theme // $message = (MINIFY != 1) ? "Exponent is now minifying Javascript and CSS" : "Exponent is no longer minifying Javascript and CSS" ; // flash('message',$message); $message = gt("You have selected the")." '".$this->params['theme']."' ".gt("theme"); if ($sv != '') { $message .= ' '.gt('with').' '.$this->params['sv'].' '.gt('style variation'); } flash('message',$message); // expSession::un_set('framework'); expSession::set('force_less_compile', 1); // expTheme::removeSmartyCache(); expSession::clearAllUsersSessionCache(); expHistory::returnTo('manageable'); }
1
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
safe
public function beforeExecute () { if (!(Yii::app()->controller instanceof EmailInboxesController)) { throw new CHttpException (400, Yii::t('app', 'Invalid controller') ); } }
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
function XMLRPCdeleteUserGroup($name, $affiliation) { # This was the original function. All other functions use 'remove' rather # than 'delete'. The function was renamed to XMLRPCremoveUserGroup. This was # kept for compatibility reasons return XMLRPCremoveUserGroup($name, $affiliation); }
1
PHP
CWE-264
Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.
https://cwe.mitre.org/data/definitions/264.html
safe
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
public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) { $this->host = $host; // If no port value provided, use default if (false === $port) { $this->port = $this->POP3_PORT; } else { $this->port = (integer)$port; } // If no timeout value provided, use default if (false === $timeout) { $this->tval = $this->POP3_TIMEOUT; } else { $this->tval = (integer)$timeout; } $this->do_debug = $debug_level; $this->username = $username; $this->password = $password; // Reset the error log $this->errors = array(); // connect $result = $this->connect($this->host, $this->port, $this->tval); if ($result) { $login_result = $this->login($this->username, $this->password); if ($login_result) { $this->disconnect(); return true; } } // We need to disconnect regardless of whether the login succeeded $this->disconnect(); 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
public function delete(){ $login_user = $this->checkLogin(); $uid = $login_user['uid'] ; $id = I("id/d")? I("id/d") : 0; $teamItemInfo = D("TeamItem")->where(" id = '$id' ")->find(); $item_id = $teamItemInfo['item_id'] ; $team_id = $teamItemInfo['team_id'] ; if(!$this->checkItemManage($uid , $item_id)){ $this->sendError(10303); return ; } $ret = D("TeamItemMember")->where(" item_id = '$item_id' and team_id = '$team_id' ")->delete(); $ret = D("TeamItem")->where(" id = '$id' ")->delete(); if ($ret) { $this->sendResult($ret); }else{ $return['error_code'] = 10103 ; $return['error_message'] = 'request fail' ; $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
$emails[$u->email] = trim(user::getUserAttribution($u->id)); }
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 lookup($var) { if (is_array($var)) return parent::lookup($var); elseif (is_numeric($var)) return parent::lookup(array('staff_id'=>$var)); elseif (Validator::is_email($var)) return parent::lookup(array('email'=>$var)); elseif (is_string($var)) return parent::lookup(array('username'=>$var)); else return null; }
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 decode($jwt, $key = null, $algo = null) { $tks = explode('.', $jwt); if (count($tks) != 3) { throw new Exception('Wrong number of segments'); } list($headb64, $payloadb64, $cryptob64) = $tks; if (null === ($header = json_decode(JWT::urlsafeB64Decode($headb64)))) { throw new Exception('Invalid segment encoding'); } if (null === $payload = json_decode(JWT::urlsafeB64Decode($payloadb64))) { throw new Exception('Invalid segment encoding'); } $sig = JWT::urlsafeB64Decode($cryptob64); if (isset($key)) { if (empty($header->alg)) { throw new DomainException('Empty algorithm'); } if (!JWT::verifySignature($sig, "$headb64.$payloadb64", $key, $algo)) { throw new UnexpectedValueException('Signature verification failed'); } } return $payload; }
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
protected function AddAnAddress($kind, $address, $name = '') { if (!preg_match('/^(to|cc|bcc|Reply-To)$/', $kind)) { $this->SetError($this->Lang('Invalid recipient array').': '.$kind); if ($this->exceptions) { throw new phpmailerException('Invalid recipient array: ' . $kind); } if ($this->SMTPDebug) { $this->edebug($this->Lang('Invalid recipient array').': '.$kind); } return false; } $address = trim($address); $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim if (!$this->ValidateAddress($address)) { $this->SetError($this->Lang('invalid_address').': '. $address); if ($this->exceptions) { throw new phpmailerException($this->Lang('invalid_address').': '.$address); } if ($this->SMTPDebug) { $this->edebug($this->Lang('invalid_address').': '.$address); } return false; } if ($kind != 'Reply-To') { if (!isset($this->all_recipients[strtolower($address)])) { array_push($this->$kind, array($address, $name)); $this->all_recipients[strtolower($address)] = true; return true; } } else { if (!array_key_exists(strtolower($address), $this->ReplyTo)) { $this->ReplyTo[strtolower($address)] = array($address, $name); 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
function get_filedisplay_views() { expTemplate::get_filedisplay_views(); $paths = array( BASE.'framework/modules/common/views/file/', BASE.'themes/'.DISPLAY_THEME.'modules/common/views/file/', ); $views = array(); foreach ($paths as $path) { if (is_readable($path)) { $dh = opendir($path); while (($file = readdir($dh)) !== false) { if (is_readable($path.'/'.$file) && substr($file, -4) == '.tpl' && substr($file, -14) != '.bootstrap.tpl' && substr($file, -15) != '.bootstrap3.tpl' && substr($file, -10) != '.newui.tpl') { $filename = substr($file, 0, -4); $views[$filename] = gt($filename); } } } } return $views; }
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 testCompletePurchaseCustomOptions() { $this->setMockHttpResponse('ExpressPurchaseSuccess.txt'); // Those values should not be used if custom token or payerid are passed $this->getHttpRequest()->query->replace(array( 'token' => 'GET_TOKEN', 'PayerID' => 'GET_PAYERID', )); $response = $this->gateway->completePurchase(array( 'amount' => '10.00', 'currency' => 'BYR', 'token' => 'CUSTOM_TOKEN', 'payerid' => 'CUSTOM_PAYERID', ))->send(); $httpRequests = $this->getMockedRequests(); $httpRequest = $httpRequests[0]; parse_str((string)$httpRequest->getBody(), $postData); $this->assertSame('CUSTOM_TOKEN', $postData['TOKEN']); $this->assertSame('CUSTOM_PAYERID', $postData['PAYERID']); }
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 attributeLabels() { return array( 'actionId' => Yii::t('actions','Action ID'), 'text' => Yii::t('actions','Action Text'), ); }
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
public function asHtml(ElementNode $el) { if (!$this->hasValidInputs($el)) { return $el->getAsBBCode(); } $html = $this->getReplacementText(); if ($this->usesOption()) { $html = str_ireplace('{option}', $el->getAttribute(), $html); } if ($this->parseContent()) { $content = ""; foreach ($el->getChildren() as $child) $content .= $child->getAsHTML(); } else { $content = ""; foreach ($el->getChildren() as $child) $content .= $child->getAsBBCode(); } $html = str_ireplace('{param}', $content, $html); return $html; }
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 __construct () { self::$opt = json_decode(Options::v('mdo_theme_options'), true); if (self::$opt['mdo_adsense'] != '') { Hooks::attach('footer_load_lib', array('MdoTheme', 'loadAdsenseJs')); } }
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 setPageTextMatchRegex( array $pageTextMatchRegex = [] ) { $this->pageTextMatchRegex = (array)$pageTextMatchRegex; }
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 testHalfOpenTag() { $this->assertProduces('[b', '[b'); $this->assertProduces('wut [url=http://jbbcode.com', 'wut [url=http://jbbcode.com'); }
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
function columnUpdate($table, $col, $val, $where=1) { $res = @mysqli_query($this->connection, "UPDATE `" . $this->prefix . "$table` SET `$col`='" . $val . "' WHERE $where"); /*if ($res == null) return array(); $objects = array(); for ($i = 0; $i < mysqli_num_rows($res); $i++) $objects[] = mysqli_fetch_object($res);*/ //return $objects; }
1
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
safe
public function confirm() { $task = $this->getTask(); $link = $this->getTaskLink(); $this->response->html($this->template->render('task_internal_link/remove', array( 'link' => $link, 'task' => $task, ))); }
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 mail($from) { $useVerp = ($this->do_verp ? ' XVERP' : ''); return $this->sendCommand( 'MAIL FROM', 'MAIL FROM:<' . $from . '>' . $useVerp, 250 ); }
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
function productFeed() { // global $db; //check query password to avoid DDOS /* * condition = new * description * id - SKU * link * price * title * brand - manufacturer * image link - fullsized image, up to 10, comma seperated * product type - category - "Electronics > Audio > Audio Accessories MP3 Player Accessories","Health & Beauty > Healthcare > Biometric Monitors > Pedometers" */ $out = '"id","condition","description","like","price","title","brand","image link","product type"' . chr(13) . chr(10); $p = new product(); $prods = $p->find('all', 'parent_id=0 AND '); //$prods = $db->selectObjects('product','parent_id=0 AND'); }
1
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
safe
public static function delete($id) { $id = sprintf('%d', $id); $parent = self::getParent($id); $sql = array( 'table' => 'cat', 'where' => array( 'id' => $id, ), ); $cat = Db::delete($sql); if ($cat) { return true; } else { return false; } // check all posts with this category and move to parent categories $post = Db::result("SELECT `id` FROM `posts` WHERE `cat` = '{$id}'"); $npost = Db::$num_rows; //print_r($parent); if ($npost > 0) { $sql = "UPDATE `posts` SET `cat` = '{$parent[0]->parent}' WHERE `cat` = '{$id}'"; Db::query($sql); } }
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 country_region_name_by_code($code, $language="") { global $DB; // TODO: region names have no translation in database at this time // $lang = core_get_language($language); $DB->query('SELECT name FROM nv_countries_regions WHERE `numeric` = '.protect($code)); $row = $DB->first(); return $row->name; }
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 newFromStyle( $style, \DPL\Parameters $parameters ) { $style = strtolower( $style ); switch ( $style ) { case 'definition': $class = 'DefinitionHeading'; break; case 'h1': case 'h2': case 'h3': case 'h4': case 'h5': case 'h6': case 'header': $class = 'TieredHeading'; break; case 'ordered': $class = 'OrderedHeading'; break; case 'unordered': $class = 'UnorderedHeading'; break; default: return null; break; } $class = '\DPL\Heading\\' . $class; return new $class( $parameters ); }
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 static function versionReport() { $v = self::latestVersion(); $html = " <div class=\"alert alert-warning\"> <span class=\"fa fa-warning\"></span> Warning: Your CMS version is different with our latest version (<strong>$v</strong>). Please upgrade your system. </div> "; return $html; }
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 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; }
1
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
safe
public function getQueryOrderby() { $uh = UserHelper::instance(); $R1 = 'R1_' . $this->field->id; $R2 = 'R2_' . $this->field->id; return "$R2.ugroup_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
protected function getC3Service() { include_once $this->targetDirs[1].'/includes/HotPath/C3.php'; return $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3(); }
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 getTestServiceSubscriberService() { return $this->services['Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\TestServiceSubscriber(); }
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_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; //This will make sure that only the country or region that given a rate value will be saved in the db $upcharge = array(); foreach($this->params['upcharge'] as $key => $item) { if(!empty($item)) { $upcharge[$key] = $item; } } $this->config['upcharge'] = $upcharge; $config->update(array('config'=>$this->config)); flash('message', gt('Configuration updated')); expHistory::back(); }
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 testCommandCategorieExistence ($name = NULL) { global $pearDB, $form; $id = NULL; if (isset($form)) $id = $form->getSubmitValue('cmd_category_id'); $DBRESULT = $pearDB->query("SELECT `category_name`, `cmd_category_id` FROM `command_categories` WHERE `category_name` = '".htmlentities($name, ENT_QUOTES, "UTF-8")."'"); $cat = $DBRESULT->fetchRow(); if ($DBRESULT->numRows() >= 1 && $cat["cmd_category_id"] == $id) return true; else if ($DBRESULT->numRows() >= 1 && $cat["cmd_category_id"] != $id) return false; else 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
function selectExpObjectsBySql($sql, $classname, $get_assoc=true, $get_attached=true) { $res = @mysqli_query($this->connection, $sql); if ($res == null) return array(); $arrays = array(); $numrows = mysqli_num_rows($res); for ($i = 0; $i < $numrows; $i++) $arrays[] = new $classname(mysqli_fetch_assoc($res), true, true); return $arrays; }
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 getDisplayName ($plural=true) { return Yii::t('workflow', '{process}', array( '{process}' => Modules::displayName($plural, 'Process'), )); }
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
public function transform($attr, $config, $context) { // Calculated from Firefox if (!isset($attr['cols'])) $attr['cols'] = '22'; if (!isset($attr['rows'])) $attr['rows'] = '3'; return $attr; }
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 testConvertsRequestsToStrings() { $request = new Psr7\Request('PUT', 'http://foo.com/hi?123', [ 'Baz' => 'bar', 'Qux' => 'ipsum' ], 'hello', '1.0'); $this->assertEquals( "PUT /hi?123 HTTP/1.0\r\nHost: foo.com\r\nBaz: bar\r\nQux: ipsum\r\n\r\nhello", Psr7\str($request) ); }
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 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
public static function DragnDropReRank2() { global $router, $db; $id = $router->params['id']; $page = new section($id); $old_rank = $page->rank; $old_parent = $page->parent; $new_rank = $router->params['position'] + 1; // rank $new_parent = intval($router->params['parent']); $db->decrement($page->tablename, 'rank', 1, 'rank>' . $old_rank . ' AND parent=' . $old_parent); // close in hole $db->increment($page->tablename, 'rank', 1, 'rank>=' . $new_rank . ' AND parent=' . $new_parent); // make room $params = array(); $params['parent'] = $new_parent; $params['rank'] = $new_rank; $page->update($params); self::checkForSectionalAdmins($id); expSession::clearAllUsersSessionCache('navigation'); }
1
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
safe
foreach ($grpusers as $u) { $emails[$u->email] = trim(user::getUserAttribution($u->id)); }
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
->orWhere('name', 'like', '%' . $search . '%'); }); } $users = $query->get(); return view('form.user-select-list', compact('users')); }
0
PHP
NVD-CWE-Other
Other
NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset.
https://nvd.nist.gov/vuln/categories
vulnerable
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 )); }
1
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
safe
public function activate_address() { global $db, $user; $object = new stdClass(); $object->id = $this->params['id']; $db->setUniqueFlag($object, 'addresses', $this->params['is_what'], "user_id=" . $user->id); flash("message", gt("Successfully updated address.")); 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
protected function connect() { $user = $this->getUser(); $workgroup = null; if (strpos($user, '/')) { list($workgroup, $user) = explode('/', $user); } $this->state->init($workgroup, $user, $this->getPassword()); }
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
public static function delete($id) { $sql = array( 'table' => 'menus', 'where' => array( 'id' => $id, ), ); $menu = Db::delete($sql); }
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 delete_version() { if (empty($this->params['id'])) { flash('error', gt('The version you are trying to delete could not be found')); } // get the version $version = new help_version($this->params['id']); if (empty($version->id)) { flash('error', gt('The version you are trying to delete could not be found')); } // if we have errors than lets get outta here! if (!expQueue::isQueueEmpty('error')) expHistory::back(); // delete the version $version->delete(); expSession::un_set('help-version'); flash('message', gt('Deleted version').' '.$version->version.' '.gt('and all documents in that version.')); expHistory::back(); }
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($term){ X2LinkableBehavior::getItems ($term, 'id', 'id'); }
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 confirm() { $project = $this->getProject(); $tag_id = $this->request->getIntegerParam('tag_id'); $tag = $this->tagModel->getById($tag_id); $this->response->html($this->template->render('project_tag/remove', array( 'tag' => $tag, '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 reparent_standalone() { $standalone = $this->section->find($this->params['page']); if ($standalone) { $standalone->parent = $this->params['parent']; $standalone->update(); expSession::clearAllUsersSessionCache('navigation'); expHistory::back(); } else { notfoundController::handle_not_found(); } }
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 searchName() { return gt('Webpage'); }
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 showall() { expHistory::set('viewable', $this->params); $hv = new help_version(); //$current_version = $hv->find('first', 'is_current=1'); $ref_version = $hv->find('first', 'version=\''.$this->help_version.'\''); // pagination parameter..hard coded for now. $where = $this->aggregateWhereClause(); $where .= 'AND help_version_id='.(empty($ref_version->id)?'0':$ref_version->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
public function get($extramediatypes = false) { try { return $this->getConfig($extramediatypes); } 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
function visitTextNode(\JBBCode\TextNode $textNode) { /* Convert :) into an image tag. */ $textNode->setValue(str_replace(':)', '<img src="/smiley.png" alt=":)" />', $textNode->getValue())); }
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 getAuthority() { if ($this->host == '') { return ''; } $authority = $this->host; if ($this->userInfo != '') { $authority = $this->userInfo . '@' . $authority; } if ($this->port !== null) { $authority .= ':' . $this->port; } return $authority; }
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
$result = $search->getSearchResults($item->query, false, true); if(empty($result) && !in_array($item->query, $badSearchArr)) { $badSearchArr[] = $item->query; $badSearch[$ctr2]['query'] = $item->query; $badSearch[$ctr2]['count'] = $db->countObjects("search_queries", "query='{$item->query}'"); $ctr2++; } } //Check if the user choose from the dropdown if(!empty($user_default)) { if($user_default == $anonymous) { $u_id = 0; } else { $u_id = $user_default; } $where .= "user_id = {$u_id}"; } //Get all the search query records $records = $db->selectObjects('search_queries', $where); for ($i = 0, $iMax = count($records); $i < $iMax; $i++) { if(!empty($records[$i]->user_id)) { $u = user::getUserById($records[$i]->user_id); $records[$i]->user = $u->firstname . ' ' . $u->lastname; } } $page = new expPaginator(array( 'records' => $records, 'where'=>1, 'model'=>'search_queries', 'limit'=>(isset($this->config['limit']) && $this->config['limit'] != '') ? 10 : $this->config['limit'], 'order'=>empty($this->config['order']) ? 'timestamp' : $this->config['order'], 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->baseclassname, 'action'=>$this->params['action'], 'columns'=>array( 'ID'=>'id', gt('Query')=>'query', gt('Timestamp')=>'timestamp', gt('User')=>'user_id', ), )); $uname['id'] = implode($uname['id'],','); $uname['name'] = implode($uname['name'],','); assign_to_template(array( 'page'=>$page, 'users'=>$uname, 'user_default' => $user_default, 'badSearch' => $badSearch )); }
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 manage () { expHistory::set('viewable', $this->params); $vendor = new vendor(); $vendors = $vendor->find('all'); if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . $this->params['vendor']); } else { $purchase_orders = $this->purchase_order->find('all'); } assign_to_template(array( 'purchase_orders'=>$purchase_orders, 'vendors' => $vendors, 'vendor_id' => @$this->params['vendor'] )); }
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 testResolvesUris($base, $rel, $expected) { $uri = new Uri($base); $actual = Uri::resolve($uri, $rel); $this->assertEquals($expected, (string) $actual); }
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
$file = sprintf('%s/%s.class.php', $path, $class_name); if(is_file($file)) { include_once $file; } } }
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'] = Options::get('siteurl').$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; }
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