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 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-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 transform($attr, $config, $context) { if (!isset($attr['background'])) return $attr; $background = $this->confiscateAttr($attr, 'background'); // some validation should happen here $this->prependCSS($attr, "background-image:url($background);"); 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
function compression_test() { ?> <script type="text/javascript"> var compressionNonce = <?php echo wp_json_encode( wp_create_nonce( 'update_can_compress_scripts' ) ); ?>; var testCompression = { get : function(test) { var x; if ( window.XMLHttpRequest ) { x = new XMLHttpRequest(); } else { try{x=new ActiveXObject('Msxml2.XMLHTTP');}catch(e){try{x=new ActiveXObject('Microsoft.XMLHTTP');}catch(e){};} } if (x) { x.onreadystatechange = function() { var r, h; if ( x.readyState == 4 ) { r = x.responseText.substr(0, 18); h = x.getResponseHeader('Content-Encoding'); testCompression.check(r, h, test); } }; x.open('GET', ajaxurl + '?action=wp-compression-test&test='+test+'&_ajax_nonce='+compressionNonce+'&'+(new Date()).getTime(), true); x.send(''); } }, check : function(r, h, test) { if ( ! r && ! test ) this.get(1); if ( 1 == test ) { if ( h && ( h.match(/deflate/i) || h.match(/gzip/i) ) ) this.get('no'); else this.get(2); return; } if ( 2 == test ) { if ( '"wpCompressionTest' == r ) this.get('yes'); else this.get('no'); } } }; testCompression.check(); </script> <?php }
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 uploadAvatar(Request $request) { $user = auth()->user(); if ($user && $request->hasFile('admin_avatar')) { $user->clearMediaCollection('admin_avatar'); $user->addMediaFromRequest('admin_avatar') ->toMediaCollection('admin_avatar'); } if ($user && $request->has('avatar')) { $data = json_decode($request->avatar); $user->clearMediaCollection('admin_avatar'); $user->addMediaFromBase64($data->data) ->usingFileName($data->name) ->toMediaCollection('admin_avatar'); } return new UserResource($user); }
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 get_view_config() { global $template; // set paths we will search in for the view $paths = array( BASE.'themes/'.DISPLAY_THEME.'/modules/common/views/file/configure', BASE.'framework/modules/common/views/file/configure', ); foreach ($paths as $path) { $view = $path.'/'.$this->params['view'].'.tpl'; if (is_readable($view)) { if (bs(true)) { $bstrapview = $path.'/'.$this->params['view'].'.bootstrap.tpl'; if (file_exists($bstrapview)) { $view = $bstrapview; } } if (bs3(true)) { $bstrapview = $path.'/'.$this->params['view'].'.bootstrap3.tpl'; if (file_exists($bstrapview)) { $view = $bstrapview; } } $template = new controllertemplate($this, $view); $ar = new expAjaxReply(200, 'ok'); $ar->send(); } } }
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 phpAds_SessionStart() { global $session; if (empty($_COOKIE['sessionID'])) { $session = array(); $_COOKIE['sessionID'] = md5(uniqid('phpads', 1)); phpAds_SessionSetAdminCookie('sessionID', $_COOKIE['sessionID']); } return $_COOKIE['sessionID']; }
0
PHP
CWE-384
Session Fixation
Authenticating a user, or otherwise establishing a new user session, without invalidating any existing session identifier gives an attacker the opportunity to steal authenticated sessions.
https://cwe.mitre.org/data/definitions/384.html
vulnerable
private function readData() { if (isset($this->tid) && $this->tid != - 1 ) { $_ticket_stmt = Database::prepare(' SELECT * FROM `' . TABLE_PANEL_TICKETS . '` WHERE `id` = :tid' ); $_ticket = Database::pexecute_first($_ticket_stmt, array('tid' => $this->tid)); $this->Set('customer', $_ticket['customerid'], true, false); $this->Set('admin', $_ticket['adminid'], true, false); $this->Set('subject', $_ticket['subject'], true, false); $this->Set('category', $_ticket['category'], true, false); $this->Set('priority', $_ticket['priority'], true, false); $this->Set('message', $_ticket['message'], true, false); $this->Set('dt', $_ticket['dt'], true, false); $this->Set('lastchange', $_ticket['lastchange'], true, false); $this->Set('ip', $_ticket['ip'], true, false); $this->Set('status', $_ticket['status'], true, false); $this->Set('lastreplier', $_ticket['lastreplier'], true, false); $this->Set('by', $_ticket['by'], true, false); $this->Set('answerto', $_ticket['answerto'], true, false); $this->Set('archived', $_ticket['archived'], true, false); } }
0
PHP
CWE-732
Incorrect Permission Assignment for Critical Resource
The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
https://cwe.mitre.org/data/definitions/732.html
vulnerable
function getTextColumns($table) { $sql = "SHOW COLUMNS FROM " . $this->prefix.$table . " WHERE type = 'text' OR type like 'varchar%'"; $res = @mysqli_query($this->connection, $sql); if ($res == null) return array(); $records = array(); while($row = mysqli_fetch_object($res)) { $records[] = $row->Field; } return $records; }
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 getInt($key, $default = 0) { return (int) $this->get($key, $default); }
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 verify($name) { return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); }
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 remove() { $this->checkCSRFParam(); $project = $this->getProject(); $action = $this->actionModel->getById($this->request->getIntegerParam('action_id')); 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']))); }
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
$pos = strpos($val, $match); if ($pos !== false) { if ($field != '') { $var = '$r' . getvarname($field); $itm = trim(substr($val, $pos + strlen($match))); if ($itm != '') eval($var . '="' . str_replace('"', '\"', $itm) . '";'); } if (!$scanall) break; } } } } if (empty($r)) { if ($hasreg) $r['registered'] = 'no'; } else { if ($hasreg) $r['registered'] = 'yes'; $r = format_dates($r, $dateformat); } return $r; }
0
PHP
CWE-94
Improper Control of Generation of Code ('Code Injection')
The software constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.
https://cwe.mitre.org/data/definitions/94.html
vulnerable
$section = new section($this->params); } else { notfoundController::handle_not_found(); exit; } if (!empty($section->id)) { $check_id = $section->id; } else { $check_id = $section->parent; } if (expPermissions::check('manage', expCore::makeLocation('navigation', '', $check_id))) { if (empty($section->id)) { $section->active = 1; $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(), )); } else { // User does not have permission to manage sections. Throw a 403 notfoundController::handle_not_authorized(); } }
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-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 validate($number, $config, $context) { $number = $this->parseCDATA($number); if ($number === '') return false; if ($number === '0') return '0'; $sign = ''; switch ($number[0]) { case '-': if ($this->non_negative) return false; $sign = '-'; case '+': $number = substr($number, 1); } if (ctype_digit($number)) { $number = ltrim($number, '0'); return $number ? $sign . $number : '0'; } // Period is the only non-numeric character allowed if (strpos($number, '.') === false) return false; list($left, $right) = explode('.', $number, 2); if ($left === '' && $right === '') return false; if ($left !== '' && !ctype_digit($left)) return false; $left = ltrim($left, '0'); $right = rtrim($right, '0'); if ($right === '') { return $left ? $sign . $left : '0'; } elseif (!ctype_digit($right)) { return false; } return $sign . $left . '.' . $right; }
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 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 delete($fileName = null) { $this->validateFileName(); list($name, $extension) = $this->model->getFileNameParts(); return $this->datasource->delete( $this->model->getObjectTypeDirName(), $name, $extension ); }
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 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(); }
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
rsvpmaker_tx_email($post, $mail); } $send_confirmation = get_post_meta($post->ID,'_rsvp_rsvpmaker_send_confirmation_email',true); $confirm_on_payment = get_post_meta($post->ID,'_rsvp_confirmation_after_payment',true); if(($send_confirmation ||!is_numeric($send_confirmation)) && empty($confirm_on_payment) )//if it hasn't been set to 0, send it { $confirmation_subject = $templates['confirmation']['subject']; foreach($rsvpdata as $field => $value) $confirmation_subject = str_replace('['.$field.']',$value,$confirmation_subject); $confirmation_body = $templates['confirmation']['body']; foreach($rsvpdata as $field => $value) $confirmation_body = str_replace('['.$field.']',$value,$confirmation_body); $confirmation_body = do_blocks(do_shortcode($confirmation_body)); $mail["html"] = wpautop($confirmation_body); if(isset($post->ID)) // not for replay $mail["ical"] = rsvpmaker_to_ical_email ($post->ID, $rsvp_to, $rsvp["email"]); $mail["to"] = $rsvp["email"]; $mail["from"] = $rsvp_to_array[0]; $mail["fromname"] = get_bloginfo('name'); $mail["subject"] = $confirmation_subject; rsvpmaker_tx_email($post, $mail); } }
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 manage() { expHistory::set('viewable', $this->params); $page = new expPaginator(array( 'model'=>'order_status', 'where'=>1, 'limit'=>10, 'order'=>'rank', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->params['controller'], 'action'=>$this->params['action'], //'columns'=>array('Name'=>'title') )); 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
function httpsTestController($serverPort) { $args = array('HTTPS' => ''); var_dump(request('localhost', $serverPort, "test_https.php", [], [], $args)); }
1
PHP
CWE-668
Exposure of Resource to Wrong Sphere
The product exposes a resource to the wrong control sphere, providing unintended actors with inappropriate access to the resource.
https://cwe.mitre.org/data/definitions/668.html
safe
public function remove() { $project = $this->getProject(); $this->checkCSRFParam(); $column_id = $this->request->getIntegerParam('column_id'); if ($this->columnModel->remove($column_id)) { $this->flash->success(t('Column removed successfully.')); } else { $this->flash->failure(t('Unable to remove this column.')); } $this->response->redirect($this->helper->url->to('ColumnController', '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
public function queryLimit($cols, $table, $where="1=1", $order="", $offset=0, $max=100) { $this->lastError = ''; $this->lastResult = ''; $fetch = PDO::FETCH_ASSOC; try { $sql = ' SELECT SQL_CALC_FOUND_ROWS '.$cols.' FROM '.$table.' WHERE '.$where.' ORDER BY '.$order.' LIMIT '.$max.' OFFSET '.$offset; $statement = $this->db->query($sql); $this->queries_count++; $statement->setFetchMode($fetch); $this->lastResult = $statement->fetchAll(); $statement->closeCursor(); unset($statement); } catch(PDOException $e) { $this->lastError = $e->getMessage(); } catch(Exception $e) { return false; } return empty($this->lastError); }
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
$date->delete(); // event automatically deleted if all assoc eventdates are deleted } 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 manage_upcharge() { $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; $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, 'upcharge'=>!empty($this->config['upcharge'])?$this->config['upcharge']:'' )); }
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 __construct(){ }
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
self::get($arr); } else { self::incFront('default'); } }
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 transform($attr, $config, $context) { if (!isset($attr['bgcolor'])) return $attr; $bgcolor = $this->confiscateAttr($attr, 'bgcolor'); // some validation should happen here $this->prependCSS($attr, "background-color:$bgcolor;"); 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 static function create($vars) { if (is_array($vars)) { //print_r($vars['user']); $u = $vars['user']; $sql = array( 'table' => 'user', 'key' => $u, ); $db = Db::insert($sql); if (!isset($vars['detail']) || $vars['detail'] == '') { Db::insert("INSERT INTO `user_detail` (`userid`) VALUES ('{$vars['user']['userid']}')"); } else { $u = $vars['detail']; $sql = array( 'table' => 'user_detail', 'key' => $u, ); Db::insert($sql); } Hooks::run('user_sqladd_action', $vars); } return $db; }
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
foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); }
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(); $category = $this->getCategory(); $this->response->html($this->helper->layout->project('category/remove', array( 'project' => $project, 'category' => $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
function manage_vendors () { expHistory::set('viewable', $this->params); $vendor = new vendor(); $vendors = $vendor->find('all'); assign_to_template(array( 'vendors'=>$vendors )); }
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 getPurchaseOrderByJSON() { if(!empty($this->params['vendor'])) { $purchase_orders = $this->purchase_order->find('all', 'vendor_id=' . expString::escape($this->params['vendor'])); } else { $purchase_orders = $this->purchase_order->find('all'); } echo json_encode($purchase_orders); }
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 queryGetArray($table, $data, $where, $extra = "", $inner = "") { $q = $this->prepareData($table, $data, $where, $extra, $inner); $query_id = $this->query($q); if (isset($this->query_id)) { $record = mysql_fetch_assoc($this->query_id) or die(mysql_error()." | ".$q); } else { $this->oops("Invalid query_id: <b>$this->query_id</b>. Records could not be fetched."); } $this->freeResult($query_id); return $record; }#-#queryGetRow()
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 backup($type='json') { global $DB; global $website; $out = array(); $DB->query(' SELECT * FROM nv_webdictionary_history WHERE website = '.protect($website->id), 'object' ); if($type='json') $out = json_encode($DB->result()); 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 buildControl() { $control = new colorcontrol(); if (!empty($this->params['value'])) $control->value = $this->params['value']; if ($this->params['value'][0] != '#') $this->params['value'] = '#' . $this->params['value']; $control->default = $this->params['value']; if (!empty($this->params['hide'])) $control->hide = $this->params['hide']; if (isset($this->params['flip'])) $control->flip = $this->params['flip']; $this->params['name'] = !empty($this->params['name']) ? $this->params['name'] : ''; $control->name = $this->params['name']; $this->params['id'] = !empty($this->params['id']) ? $this->params['id'] : ''; $control->id = isset($this->params['id']) && $this->params['id'] != "" ? $this->params['id'] : ""; //echo $control->id; if (empty($control->id)) $control->id = $this->params['name']; if (empty($control->name)) $control->name = $this->params['id']; // attempt to translate the label if (!empty($this->params['label'])) { $this->params['label'] = gt($this->params['label']); } else { $this->params['label'] = null; } echo $control->toHTML($this->params['label'], $this->params['name']); // $ar = new expAjaxReply(200, gt('The control was created'), json_encode(array('data'=>$code))); // $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 testGetEscapeChar() { $this->assertEquals("'", $this->cleanCSV->getEscapeChar()); }
1
PHP
CWE-640
Weak Password Recovery Mechanism for Forgotten Password
The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.
https://cwe.mitre.org/data/definitions/640.html
safe
public function store(CreateAppointmentCalendarRequest $request) { $client_id = null; $user = User::where('external_id', $request->user)->first(); if ($request->client_external_id) { $client_id = Client::where('external_id', $request->client_external_id)->first()->id; if (!$client_id) { return response(__("Client not found"), 422); } } $request_type = null; $request_id = null; if ($request->source_type && $request->source_external_id) { $request_type = $request->source_type; $entry = $request_type::whereExternalId($request->source_external_id); $request_id = $entry->id; } if (!$user) { return response(__("User not found"), 422); } $startTime = str_replace(["am", "pm", ' '], "", $request->start_time) . ':00'; $endTime = str_replace(["am", "pm", ' '], "", $request->end_time) . ':00'; $appointment = Appointment::create([ 'external_id' => Uuid::uuid4()->toString(), 'source_type' => $request_type, 'source_id' => $request_id, 'client_id' => $client_id, 'title' => $request->title, 'start_at' => Carbon::parse($request->start_date . " " . $startTime), 'end_at' => Carbon::parse($request->end_date . " " . $endTime), 'user_id' => $user->id, 'color' => $request->color ]); $appointment->user_external_id = $user->external_id; $appointment->start_at = $appointment->start_at; return response($appointment); }
0
PHP
CWE-521
Weak Password Requirements
The product does not require that users should have strong passwords, which makes it easier for attackers to compromise user accounts.
https://cwe.mitre.org/data/definitions/521.html
vulnerable
public function testProductsPages () { $this->visitPages ($this->getPages ('^products')); }
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
$iloc = expUnserialize($container->internal); if ($db->selectObject('sectionref',"module='".$iloc->mod."' AND source='".$iloc->src."'") == null) { // There is no sectionref for this container. Populate sectionref if ($container->external != "N;") { $newSecRef = new stdClass(); $newSecRef->module = $iloc->mod; $newSecRef->source = $iloc->src; $newSecRef->internal = ''; $newSecRef->refcount = 1; // $newSecRef->is_original = 1; $eloc = expUnserialize($container->external); // $section = $db->selectObject('sectionref',"module='containermodule' AND source='".$eloc->src."'"); $section = $db->selectObject('sectionref',"module='container' AND source='".$eloc->src."'"); if (!empty($section)) { $newSecRef->section = $section->id; $db->insertObject($newSecRef,"sectionref"); $missing_sectionrefs[] = gt("Missing sectionref for container replaced").": ".$iloc->mod." - ".$iloc->src." - PageID #".$section->id; } else { $db->delete('container','id="'.$container->id.'"'); $missing_sectionrefs[] = gt("Cant' find the container page for container").": ".$iloc->mod." - ".$iloc->src.' - '.gt('deleted'); } } } } assign_to_template(array( 'missing_sectionrefs'=>$missing_sectionrefs, )); }
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 testCompletePurchaseHttpOptions() { $this->setMockHttpResponse('ExpressPurchaseSuccess.txt'); $this->getHttpRequest()->query->replace(array( 'token' => 'GET_TOKEN', 'PayerID' => 'GET_PAYERID', )); $response = $this->gateway->completePurchase(array( 'amount' => '10.00', 'currency' => 'BYR', ))->send(); $httpRequests = $this->getMockedRequests(); $httpRequest = $httpRequests[0]; parse_str((string)$httpRequest->getBody(), $postData); $this->assertSame('GET_TOKEN', $postData['TOKEN']); $this->assertSame('GET_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
protected function scriptCallback($matches) { return $matches[1] . htmlspecialchars($matches[2], ENT_COMPAT, 'UTF-8') . $matches[3]; }
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 save_change_password() { global $user; $isuser = ($this->params['uid'] == $user->id) ? 1 : 0; if (!$user->isAdmin() && !$isuser) { flash('error', gt('You do not have permissions to change this users password.')); expHistory::back(); } if (($isuser && empty($this->params['password'])) || (!empty($this->params['password']) && $user->password != user::encryptPassword($this->params['password']))) { flash('error', gt('The current password you entered is not correct.')); expHistory::returnTo('editable'); } //eDebug($user); $u = new user(intval($this->params['uid'])); $ret = $u->setPassword($this->params['new_password1'], $this->params['new_password2']); //eDebug($u, true); if (is_string($ret)) { flash('error', $ret); expHistory::returnTo('editable'); } else { $params = array(); $params['is_admin'] = !empty($u->is_admin); $params['is_acting_admin'] = !empty($u->is_acting_admin); $u->update($params); } if (!$isuser) { flash('message', gt('The password for') . ' ' . $u->username . ' ' . gt('has been changed.')); } else { $user->password = $u->password; flash('message', gt('Your password has been changed.')); } 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 replace($def, $config) { 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 __construct() { $this->children = array(); $this->nestDepth = 0; }
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 delete_option_master() { global $db; $masteroption = new option_master($this->params['id']); // delete any implementations of this option master $db->delete('option', 'option_master_id='.$masteroption->id); $masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id); //eDebug($masteroption); 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 testMoveCannotBeCalledMoreThanOnce() { $stream = \GuzzleHttp\Psr7\stream_for('Foo bar!'); $upload = new UploadedFile($stream, 0, UPLOAD_ERR_OK); $this->cleanup[] = $to = tempnam(sys_get_temp_dir(), 'diac'); $upload->moveTo($to); $this->assertTrue(file_exists($to)); $this->setExpectedException('RuntimeException', 'moved'); $upload->moveTo($to); }
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 listFilesInDirectory($dir, $omitSymlinks, $prefix = '') { if (!is_dir($dir)) { return false; } $excludes = array(".",".."); $result = array(); $files = self::localScandir($dir); if (!$files) { return array(); } foreach($files as $file) { if (!in_array($file, $excludes)) { $path = $dir.DIRECTORY_SEPARATOR.$file; if (is_link($path)) { if ($omitSymlinks) { continue; } else { $result[] = $prefix.$file; } } else if (is_dir($path)) { $result[] = $prefix.$file.DIRECTORY_SEPARATOR; $subs = elFinderVolumeFTP::listFilesInDirectory($path, $omitSymlinks, $prefix.$file.DIRECTORY_SEPARATOR); if ($subs) { $result = array_merge($result, $subs); } } else { $result[] = $prefix.$file; } } } return $result; }
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 __construct() { global $GLOBALS, $data; self::$editors =& $GLOBALS; self::$data =& $data; self::$url = Options::get('siteurl'); self::$domain = Options::get('sitedomain'); self::$name = Options::get('sitename'); self::$key = Options::get('sitekeywords'); self::$desc = Options::get('sitedesc'); }
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 getSwimlane(array $project) { $swimlane = $this->swimlaneModel->getById($this->request->getIntegerParam('swimlane_id')); if (empty($swimlane)) { throw new PageNotFoundException(); } if ($swimlane['project_id'] != $project['id']) { throw new AccessForbiddenException(); } return $swimlane; }
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 static function name($id) { return Categories::name($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 permissions() { //set the permissions array return $this->add_permissions; }
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
recyclebin::sendToRecycleBin($loc, $parent); //FIXME if we delete the module & sectionref the module completely disappears // if (class_exists($secref->module)) { // $modclass = $secref->module; // //FIXME: more module/controller glue code // if (expModules::controllerExists($modclass)) { // $modclass = expModules::getControllerClassName($modclass); // $mod = new $modclass($loc->src); // $mod->delete_instance(); // } else { // $mod = new $modclass(); // $mod->deleteIn($loc); // } // } } // $db->delete('sectionref', 'section=' . $parent); $db->delete('section', 'parent=' . $parent); }
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
function delete_option_master() { global $db; $masteroption = new option_master($this->params['id']); // delete any implementations of this option master $db->delete('option', 'option_master_id='.$masteroption->id); $masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id); //eDebug($masteroption); 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 set($def, $config) { if (!$this->checkDefType($def)) return; $file = $this->generateFilePath($config); if (!$this->_prepareDir($config)) return false; return $this->_write($file, serialize($def), $config); }
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 manage_versions() { expHistory::set('manageable', $this->params); $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); $sql = 'SELECT hv.*, COUNT(h.title) AS num_docs FROM '.DB_TABLE_PREFIX.'_help h '; $sql .= 'RIGHT JOIN '.DB_TABLE_PREFIX.'_help_version hv ON h.help_version_id=hv.id GROUP BY hv.version'; $page = new expPaginator(array( 'sql'=>$sql, 'limit'=>30, 'order' => (isset($this->params['order']) ? $this->params['order'] : 'version'), 'dir' => (isset($this->params['dir']) ? $this->params['dir'] : 'DESC'), 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->baseclassname, 'action'=>$this->params['action'], 'src'=>$this->loc->src, 'columns'=>array( gt('Version')=>'version', gt('Title')=>'title', gt('Current')=>'is_current', gt('# of Docs')=>'num_docs' ), )); assign_to_template(array( 'current_version'=>$current_version, 'page'=>$page )); }
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 update() { global $user; if (expSession::get('customer-signup')) expSession::set('customer-signup', false); if (isset($this->params['address_country_id'])) { $this->params['country'] = $this->params['address_country_id']; unset($this->params['address_country_id']); } if (isset($this->params['address_region_id'])) { $this->params['state'] = $this->params['address_region_id']; unset($this->params['address_region_id']); } if ($user->isLoggedIn()) { // check to see how many other addresses this user has already. $count = $this->address->find('count', 'user_id='.$user->id); // if this is first address save for this user we'll make this the default if ($count == 0) { $this->params['is_default'] = 1; $this->params['is_billing'] = 1; $this->params['is_shipping'] = 1; } // associate this address with the current user. $this->params['user_id'] = $user->id; // save the object $this->address->update($this->params); } else { //if (ecomconfig::getConfig('allow_anonymous_checkout')){ //user is not logged in, but allow anonymous checkout is enabled so we'll check //a few things that we don't check in the parent 'stuff and create a user account. $this->params['is_default'] = 1; $this->params['is_billing'] = 1; $this->params['is_shipping'] = 1; $this->address->update($this->params); } expHistory::back(); }
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
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-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 exist($tag) { $tag = Typo::cleanX($tag); $sql = "SELECT `name` FROM `cat` WHERE `name` = '{$tag}' AND `type` = 'tag'"; $q = Db::result($sql); // echo Db::$num_rows; if (Db::$num_rows > 0) { return true; } else { 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
public function confirm() { $task = $this->getTask(); $link_id = $this->request->getIntegerParam('link_id'); $link = $this->taskExternalLinkModel->getById($link_id); if (empty($link)) { throw new PageNotFoundException(); } $this->response->html($this->template->render('task_external_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
static function validUTF($string) { if(!mb_check_encoding($string, 'UTF-8') OR !($string === mb_convert_encoding(mb_convert_encoding($string, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { return false; } return true; }
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
protected function hmac($data, $key) { if (function_exists('hash_hmac')) { return hash_hmac('md5', $data, $key); } // The following borrowed from // http://php.net/manual/en/function.mhash.php#27225 // RFC 2104 HMAC implementation for php. // Creates an md5 HMAC. // Eliminates the need to install mhash to compute a HMAC // by Lance Rushing $bytelen = 64; // byte length for md5 if (strlen($key) > $bytelen) { $key = pack('H*', md5($key)); } $key = str_pad($key, $bytelen, chr(0x00)); $ipad = str_pad('', $bytelen, chr(0x36)); $opad = str_pad('', $bytelen, chr(0x5c)); $k_ipad = $key ^ $ipad; $k_opad = $key ^ $opad; return md5($k_opad . pack('H*', md5($k_ipad . $data))); }
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 fixName($name) { $name = preg_replace('/[^A-Za-z0-9\.]/','_',$name); if ($name[0] == '.') $name[0] = '_'; return $name; // return preg_replace('/[^A-Za-z0-9\.]/', '-', $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
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-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
private function swap($token) { $this->tokens[$this->t] = $token; }
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 pathTestNoAuthority() { return [ // path-rootless ['urn:example:animal:ferret:nose'], // path-absolute ['urn:/example:animal:ferret:nose'], ['urn:/'], // path-empty ['urn:'], ['urn'], ]; }
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 validUTF($string) { if(!mb_check_encoding($string, 'UTF-8') OR !($string === mb_convert_encoding(mb_convert_encoding($string, 'UTF-32', 'UTF-8' ), 'UTF-8', 'UTF-32'))) { return false; } return true; }
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 _addfirstcategorydate( $option ) { //@TODO: This should be programmatically determining which categorylink table to use instead of assuming the first one. $this->addSelect( [ 'cl_timestamp' => "DATE_FORMAT(cl1.cl_timestamp, '%Y%m%d%H%i%s')" ] ); }
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
function process_tasks($task) { global $send; /** * First see if the doc_ID exists * if not we need to create this */ $task = make_document($task); update_taskman($task, 'created', '1'); if ($task['DOC_TYPE'] == 'Fax') { deliver_document($task); } update_taskman($task, 'completed', '1'); if ($task['DOC_TYPE'] == "Fax") { //now return any objects you need to Eye Form $send['DOC_link'] = "<a href='".$webroot."/openemr/controller.php?document&view&patient_id=".attr($task['PATIENT_ID'])."&doc_id=".attr($task['DOC_ID'])."' target='_blank' title=".xlt('Report was faxed. Click to view.')."> <i class='fa fa-file-pdf-o fa-fw'></i> </a>"; //if we want a "resend" icon, add it here. } return $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
public function manage_versions() { expHistory::set('manageable', $this->params); $hv = new help_version(); $current_version = $hv->find('first', 'is_current=1'); $sql = 'SELECT hv.*, COUNT(h.title) AS num_docs FROM '.DB_TABLE_PREFIX.'_help h '; $sql .= 'RIGHT JOIN '.DB_TABLE_PREFIX.'_help_version hv ON h.help_version_id=hv.id GROUP BY hv.version'; $page = new expPaginator(array( 'sql'=>$sql, 'limit'=>30, 'order' => (isset($this->params['order']) ? $this->params['order'] : 'version'), 'dir' => (isset($this->params['dir']) ? $this->params['dir'] : 'DESC'), 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->baseclassname, 'action'=>$this->params['action'], 'src'=>$this->loc->src, 'columns'=>array( gt('Version')=>'version', gt('Title')=>'title', gt('Current')=>'is_current', gt('# of Docs')=>'num_docs' ), )); assign_to_template(array( 'current_version'=>$current_version, 'page'=>$page )); }
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 configure() { expHistory::set('editable', $this->params); // little bit of trickery so that that categories can have their own configs $this->loc->src = "@globalstoresettings"; $config = new expConfig($this->loc); $this->config = $config->config; $pullable_modules = expModules::listInstalledControllers($this->baseclassname, $this->loc); $views = expTemplate::get_config_templates($this, $this->loc); $gc = new geoCountry(); $countries = $gc->find('all'); $gr = new geoRegion(); $regions = $gr->find('all'); assign_to_template(array( 'config'=>$this->config, 'pullable_modules'=>$pullable_modules, 'views'=>$views, 'countries'=>$countries, 'regions'=>$regions, 'title'=>static::displayname() )); }
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 get($vars) { $op = Db::result("SELECT `value` FROM `options` WHERE `name` = '{$vars}' LIMIT 1"); if(Db::$num_rows > 0){ return $op[0]->value; }else{ 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
function XMLRPCremoveUserGroup($name, $affiliation) { global $user, $mysql_link_vcl; if(! in_array('groupAdmin', $user['privileges'])) { return array('status' => 'error', 'errorcode' => 16, 'errormsg' => 'access denied for managing groups'); } $validate = array('name' => $name, 'affiliation' => $affiliation); $rc = validateAPIgroupInput($validate, 1); if($rc['status'] == 'error') return $rc; $query = "SELECT ownerid, " . "affiliationid, " . "custom, " . "courseroll " . "FROM usergroup " . "WHERE id = {$rc['id']}"; $qh = doQuery($query, 101); if(! $row = mysql_fetch_assoc($qh)) { return array('status' => 'error', 'errorcode' => 18, 'errormsg' => 'user group with submitted name and affiliation does not exist'); } // if custom and not owner or custom/courseroll and no federated user group access, no access to delete group if(($row['custom'] == 1 && $user['id'] != $row['ownerid']) || (($row['custom'] == 0 || $row['courseroll'] == 1) && ! checkUserHasPerm('Manage Federated User Groups (global)') && (! checkUserHasPerm('Manage Federated User Groups (affiliation only)') || $row['affiliationid'] != $user['affiliationid']))) { return array('status' => 'error', 'errorcode' => 29, 'errormsg' => 'access denied to delete user group with submitted name and affiliation'); } if(checkForGroupUsage($rc['id'], 'user')) { return array('status' => 'error', 'errorcode' => 72, 'errormsg' => 'group currently in use and cannot be removed'); } $query = "DELETE FROM usergroup " . "WHERE id = {$rc['id']}"; doQuery($query, 101); # validate something deleted if(mysql_affected_rows($mysql_link_vcl) == 0) { return array('status' => 'error', 'errorcode' => 30, 'errormsg' => 'failure while deleting group from database'); } return array('status' => 'success'); }
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 getFile() { $task_id = $this->request->getIntegerParam('task_id'); $file_id = $this->request->getIntegerParam('file_id'); $model = 'projectFileModel'; if ($task_id > 0) { $model = 'taskFileModel'; $project_id = $this->taskFinderModel->getProjectId($task_id); if ($project_id !== $this->request->getIntegerParam('project_id')) { throw new AccessForbiddenException(); } } $file = $this->$model->getById($file_id); if (empty($file)) { throw new PageNotFoundException(); } $file['model'] = $model; return $file; }
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
return $fa->nameGlyph($icons, 'icon-'); } } else { return array(); } }
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
elseif ($permission == $mergedPermission && $mergedPermissions[$permission] == 1) { $matched = true; break; }
0
PHP
NVD-CWE-noinfo
null
null
null
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-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 getDisplayName ($plural=true, $ofModule=true) { return Yii::t('workflow', '{process}', array( '{process}' => Modules::displayName($plural, 'Process'), )); }
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
foreach ($attributes as $name) { if (!isset($def->info[$element]->attr[$name])) return "$element.$name"; }
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 setParameter($name, $value) { throw new LogicException('Impossible to call set() on a frozen ParameterBag.'); }
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 execute() { // call parent, this will probably add some general CSS/JS or other required files parent::execute(); // get parameters $term = SpoonFilter::getPostValue('term', null, ''); $limit = (int) FrontendModel::getModuleSetting('search', 'autocomplete_num_items', 10); // validate if($term == '') $this->output(self::BAD_REQUEST, null, 'term-parameter is missing.'); // get matches $matches = FrontendSearchModel::getStartsWith($term, FRONTEND_LANGUAGE, $limit); // get search url $url = FrontendNavigation::getURLForBlock('search'); // loop items and set search url foreach($matches as &$match) $match['url'] = $url . '?form=search&q=' . $match['term']; // output $this->output(self::OK, $matches); }
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 manage() { expHistory::set('manageable', $this->params); // build out a SQL query that gets all the data we need and is sortable. $sql = 'SELECT b.*, c.title as companyname, f.expfiles_id as file_id '; $sql .= 'FROM '.DB_TABLE_PREFIX.'_banner b, '.DB_TABLE_PREFIX.'_companies c , '.DB_TABLE_PREFIX.'_content_expFiles f '; $sql .= 'WHERE b.companies_id = c.id AND (b.id = f.content_id AND f.content_type="banner")'; $page = new expPaginator(array( 'model'=>'banner', 'sql'=>$sql, 'order'=>'title', 'page'=>(isset($this->params['page']) ? $this->params['page'] : 1), 'controller'=>$this->params['controller'], 'action'=>$this->params['action'], 'src'=>$this->loc->src, 'columns'=>array( gt('Title')=>'title', gt('Company')=>'companyname', gt('Impressions')=>'impressions', gt('Clicks')=>'clicks' ) )); assign_to_template(array( 'page'=>$page )); }
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
$date->delete(); // event automatically deleted if all assoc eventdates are deleted } expHistory::back(); }
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 edit(Request $request, $id) { return $this->view('post::admin.posts.edit', [ 'content_id'=>$id ]); }
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 isPublic($s) { if ($s == null) { return false; } while ($s->public && $s->parent > 0) { $s = new section($s->parent); } $lineage = (($s->public) ? 1 : 0); return $lineage; }
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
$this->info[$key] = implode(' | ', array_keys($lookup)); }
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
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
public static function filterValue($value, $regex, $stripTags = true) { if (empty($value)) { return $value; } if ($stripTags) { $value = strip_tags($value); } if (preg_match($regex, $value)) { return null; } return $value; }
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
print '>' . title_trim(null_out_substitutions(html_escape($form_data[$id])), 75) . "</option>\n"; } }
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 info_application($bp_name, $bdd){ $sql = "select * from bp where name = '" . $bp_name . "'"; $req = $bdd->query($sql); $info = $req->fetch(); echo json_encode($info); }
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 html_edit_form($param) { global $TEXT; if ($param['target'] !== 'section') { msg('No editor for edit target ' . hsc($param['target']) . ' found.', -1); } $attr = array('tabindex'=>'1'); if (!$param['wr']) $attr['readonly'] = 'readonly'; $param['form']->addElement(form_makeWikiText($TEXT, $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
$controller = new $ctlname(); if (method_exists($controller,'isSearchable') && $controller->isSearchable()) { // $mods[$controller->name()] = $controller->addContentToSearch(); $mods[$controller->searchName()] = $controller->addContentToSearch(); } } uksort($mods,'strnatcasecmp'); assign_to_template(array( 'mods'=>$mods )); }
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 configureOptions(OptionsResolver $resolver) { $resolver->setDefaults([ self::DEFAULT_OPT => "'self'", self::IMG_OPT => "* data: blob:", self::MEDIA_OPT => "'self' data:", self::SCRIPT_OPT => "'self' 'nonce-" . $this->getNonce() . "' 'unsafe-inline' 'unsafe-eval'", self::STYLE_OPT => "'self' 'unsafe-inline'", self::FRAME_OPT => "'self'", self::CONNECT_OPT => "'self' blob:", self::FONT_OPT => "'self'", ]); }
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 db_seq_nextval($seqname) { global $DatabaseType; if ($DatabaseType == 'mysqli') $seq = "fn_" . strtolower($seqname) . "()"; return $seq; }
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 submit(Request $request) { Auth::logout(); $url = site_url(); return app()->url_manager->redirect($url); }
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
$q = self::$mysqli->query($vars) ; if($q === false) { Control::error('db',"Query failed: ".self::$mysqli->error."<br />\n"); } } return $q; }
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
$body = str_replace(array("\n"), "<br />", $body); } else { // It's going elsewhere (doesn't like quoted-printable) $body = str_replace(array("\n"), " -- ", $body); } $title = $items[$i]->title; $msg .= "BEGIN:VEVENT\n"; $msg .= $dtstart . $dtend; $msg .= "UID:" . $items[$i]->date_id . "\n"; $msg .= "DTSTAMP:" . date("Ymd\THis", time()) . "Z\n"; if ($title) { $msg .= "SUMMARY:$title\n"; } if ($body) { $msg .= "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" . $body . "\n"; } // if($link_url) { $msg .= "URL: $link_url\n";} if (!empty($this->config['usecategories'])) { if (!empty($items[$i]->expCat[0]->title)) { $msg .= "CATEGORIES:".$items[$i]->expCat[0]->title."\n"; } else { $msg .= "CATEGORIES:".$this->config['uncat']."\n"; } } $msg .= "END:VEVENT\n"; }
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 editspeed() { global $db; if (empty($this->params['id'])) return false; $calcname = $db->selectValue('shippingcalculator', 'calculator_name', 'id='.$this->params['id']); $calc = new $calcname($this->params['id']); assign_to_template(array( 'calculator'=>$calc )); }
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 testAddServiceIdWithUnsupportedCharacters() { $class = 'Symfony_DI_PhpDumper_Test_Unsupported_Characters'; $container = new ContainerBuilder(); $container->setParameter("'", 'oh-no'); $container->register("foo*/oh-no", 'FooClass')->setPublic(true); $container->register('bar$', 'FooClass')->setPublic(true); $container->register('bar$!', 'FooClass')->setPublic(true); $container->compile(); $dumper = new PhpDumper($container); $this->assertStringEqualsFile(self::$fixturesPath.'/php/services_unsupported_characters.php', $dumper->dump(['class' => $class])); require_once self::$fixturesPath.'/php/services_unsupported_characters.php'; $this->assertTrue(method_exists($class, 'getFooOhNoService')); $this->assertTrue(method_exists($class, 'getBarService')); $this->assertTrue(method_exists($class, 'getBar2Service')); }
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
$callback = function (array $matches) { return 'a'; };
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