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 actionPublishPost() { $post = new Events; // $user = $this->loadModel($id); if (isset($_POST['text']) && $_POST['text'] != "") { $post->text = $_POST['text']; $post->visibility = $_POST['visibility']; if (isset($_POST['associationId'])) $post->associationId = $_POST['associationId']; //$soc->attributes = $_POST['Social']; //die(var_dump($_POST['Social'])); $post->user = Yii::app()->user->getName(); $post->type = 'feed'; $post->subtype = $_POST['subtype']; $post->lastUpdated = time(); $post->timestamp = time(); if ($post->save()) { if (!empty($post->associationId) && $post->associationId != Yii::app()->user->getId()) { $notif = new Notification; $notif->type = 'social_post'; $notif->createdBy = $post->user; $notif->modelType = 'Profile'; $notif->modelId = $post->associationId; $notif->user = Yii::app()->db->createCommand() ->select('username') ->from('x2_users') ->where('id=:id', array(':id' => $post->associationId)) ->queryScalar(); // $prof = X2Model::model('Profile')->findByAttributes(array('username'=>$post->user)); // $notif->text = "$prof->fullName posted on your profile."; // $notif->record = "profile:$prof->id"; // $notif->viewed = 0; $notif->createDate = time(); // $subject=X2Model::model('Profile')->findByPk($id); // $notif->user = $subject->username; $notif->save(); } } } }
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
function uninstallPage() { $id = $this->getId(); if(empty($_POST['uninstall_confirm'])) { $plug_vars = e107::getPlug()->load($id)->getMeta(); $name = e107::getPlug()->getName(); $this->addTitle(EPL_ADLAN_63); $this->addTitle($name); return $this->pluginConfirmUninstall($plug_vars); } $post = e107::getParser()->filter($_POST); // $id = e107::getPlugin $text = e107::getPlugin()->uninstall($id, $post); e107::getMessage()->add($text, E_MESSAGE_SUCCESS); $log = e107::getPlugin()->getLog(); e107::getDebug()->log($log); $this->redirectAction('list'); }
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 getTracks() { return $this->getParameter('tracks'); }
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
$confirm = pack('H*', gps('confirm')); $name = substr($confirm, 5); $nonce = safe_field("nonce", 'txp_users', "name = '".doSlash($name)."'"); if ($nonce and $confirm === pack('H*', substr(md5($nonce), 0, 10)).$name) { include_once txpath.'/lib/txplib_admin.php'; $message = reset_author_pass($name); } }
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
protected function encode($path) { if ($path !== '') { // cut ROOT from $path for security reason, even if hacker decodes the path he will not know the root $p = $this->relpathCE($path); // if reqesting root dir $path will be empty, then assign '/' as we cannot leave it blank for crypt if ($p === '') { $p = $this->separator; } // TODO crypt path and return hash $hash = $this->crypt($p); // hash is used as id in HTML that means it must contain vaild chars // make base64 html safe and append prefix in begining $hash = strtr(base64_encode($hash), '+/=', '-_.'); // remove dots '.' at the end, before it was '=' in base64 $hash = rtrim($hash, '.'); // append volume id to make hash unique return $this->id.$hash; } //TODO: Add return statement here }
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 getCookieParams() { return $this->cookieParams; }
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 recent($vars, $type = 'post') { $sql = "SELECT * FROM `posts` WHERE `type` = '{$type}' AND `status` = '1' ORDER BY `date` DESC LIMIT {$vars}"; $posts = Db::result($sql); if(isset($posts['error'])){ $posts['error'] = "No Posts found."; }else{ $posts = $posts; } return $posts; }
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 permissions_all() { //set the permissions array $perms = array(); foreach ($this->permissions as $perm => $name) { if (!in_array($perm, $this->remove_permissions)) $perms[$perm] = $name; } $perms = array_merge($perms, $this->m_permissions, $this->add_permissions, $this->manage_permissions); return $perms; }
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 onKernelResponse(ResponseEvent $event) { if (!$event->isMainRequest()) { return; } $request = $event->getRequest(); if (!$request->hasSession() || $request->attributes->get('_security_firewall_run') !== $this->sessionKey) { return; } if ($this->dispatcher) { $this->dispatcher->removeListener(KernelEvents::RESPONSE, [$this, 'onKernelResponse']); } $this->registered = false; $session = $request->getSession(); $sessionId = $session->getId(); $usageIndexValue = $session instanceof Session ? $usageIndexReference = &$session->getUsageIndex() : null; $token = $this->tokenStorage->getToken(); if (null === $token || $this->trustResolver->isAnonymous($token)) { if ($request->hasPreviousSession()) { $session->remove($this->sessionKey); } } else { $session->set($this->sessionKey, serialize($token)); if (null !== $this->logger) { $this->logger->debug('Stored the security token in the session.', ['key' => $this->sessionKey]); } } if ($this->sessionTrackerEnabler && $session->getId() === $sessionId) { $usageIndexReference = $usageIndexValue; } }
1
PHP
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
safe
public function search_external() { // global $db, $user; global $db; $this->params['query'] = expString::escape($this->params['query']); $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-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 actionHideWidget() { if (isset($_POST['name']) && isset ($_POST['position'])) { $name = $_POST['name']; $position = $_POST['position']; $layout = Yii::app()->params->profile->getLayout(); if (isset ($layout[$position][$name])) { $layout['hiddenRight'][$name] = $layout[$position][$name]; unset ($layout[$position][$name]); Yii::app()->params->profile->saveLayout($layout); } echo Yii::app()->params->profile->getWidgetMenu(); } }
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 update() { $project = $this->getProject(); $values = $this->request->getValues(); list($valid, $errors) = $this->swimlaneValidator->validateModification($values); if ($valid) { if ($this->swimlaneModel->update($values['id'], $values)) { $this->flash->success(t('Swimlane updated successfully.')); return $this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id']))); } else { $errors = array('name' => array(t('Another swimlane with the same name exists in the project'))); } } return $this->edit($values, $errors); }
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 confirm() { $project = $this->getProject(); $this->response->html($this->helper->layout->project('action/remove', array( 'action' => $this->actionModel->getById($this->request->getIntegerParam('action_id')), 'available_events' => $this->eventManager->getAll(), 'available_actions' => $this->actionManager->getAvailableActions(), 'project' => $project, 'title' => t('Remove an action') ))); }
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 anyData() { $tasks = Task::with(['user', 'status', 'client'])->select( collect(['external_id', 'title', 'created_at', 'deadline', 'user_assigned_id', 'status_id', 'client_id']) ->map(function ($field) { return (new Task())->qualifyColumn($field); }) ->all() ); return Datatables::of($tasks) ->addColumn('titlelink', '<a href="{{ route("tasks.show",[$external_id]) }}">{{$title}}</a>') ->editColumn('client', function ($projects) { return $projects->client->company_name; }) ->editColumn('created_at', function ($tasks) { return $tasks->created_at ? with(new Carbon($tasks->created_at)) ->format(carbonDate()) : ''; }) ->editColumn('deadline', function ($tasks) { return $tasks->created_at ? with(new Carbon($tasks->deadline)) ->format(carbonDate()) : ''; }) ->editColumn('user_assigned_id', function ($tasks) { return $tasks->user->name; }) ->editColumn('status_id', function ($tasks) { return '<span class="label label-success" style="background-color:' . $tasks->status->color . '"> ' . $tasks->status->title . '</span>'; }) ->addColumn('view', function ($tasks) { return '<a href="' . route("tasks.show", $tasks->external_id) . '" class="btn btn-link">' . __('View') .'</a>' . '<a data-toggle="modal" data-id="'. route('tasks.destroy',$tasks->external_id) . '" data-title="'. $tasks->title . '" data-target="#deletion" class="btn btn-link">' . __('Delete') .'</a>' ; }) ->rawColumns(['titlelink','view', 'status_id']) ->make(true); }
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 install() { Session::start(); System::gZip(); Theme::install('header'); Control::handler('install'); Theme::install('footer'); System::Zipped(); }
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 _new_password($user_id = 0, $password, $token) { $auth = Auth::instance(); $user = ORM::factory('user',$user_id); if ($user->loaded == true) { // Determine Method (RiverID or standard) if (kohana::config('riverid.enable') == TRUE AND ! empty($user->riverid)) { // Use RiverID // We don't really have to save the password locally but if a deployer // ever wants to switch back locally, it's nice to have the pw there $user->password = $password; $user->save(); // Relay the password change back to the RiverID server $riverid = new RiverID; $riverid->email = $user->email; $riverid->token = $token; $riverid->new_password = $password; if ($riverid->setpassword() == FALSE) { // TODO: Something went wrong. Tell the user. } } else { // Use Standard if($user->check_forgot_password_token($token)) { $user->password = $password; $user->save(); } else { // TODO: Something went wrong, tell the user. } } return TRUE; } // TODO: User doesn't exist, tell the user (meta, I know). return FALSE; }
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 static function canImportData() { return true; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public function params() { $project = $this->getProject(); $values = $this->request->getValues(); $values['project_id'] = $project['id']; if (empty($values['action_name']) || empty($values['event_name'])) { $this->create(); return; } $action = $this->actionManager->getAction($values['action_name']); $action_params = $action->getActionRequiredParameters(); if (empty($action_params)) { $this->doCreation($project, $values + array('params' => array())); } $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); unset($projects_list[$project['id']]); $this->response->html($this->template->render('action_creation/params', array( 'values' => $values, 'action_params' => $action_params, 'columns_list' => $this->columnModel->getList($project['id']), 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']), 'projects_list' => $projects_list, 'colors_list' => $this->colorModel->getList(), 'categories_list' => $this->categoryModel->getList($project['id']), 'links_list' => $this->linkModel->getList(0, false), 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project), 'project' => $project, 'available_actions' => $this->actionManager->getAvailableActions(), 'swimlane_list' => $this->swimlaneModel->getList($project['id']), 'events' => $this->actionManager->getCompatibleEvents($values['action_name']), ))); }
1
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
safe
public function getLatest() { $url = "http://api.themoviedb.org/3/movie/latest?api_key=".$this->apikey; $latest = $this->curl($url); return $latest; }
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 (!is_numeric($item) && ($item != '')) { return false; } } } else { return false; } } else {
0
PHP
CWE-502
Deserialization of Untrusted Data
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
$q = self::query($sql); } 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 __construct($uid, $folder = null, $is_safe = false) { // decode combined UID-folder identifier if (preg_match('/^\d+-.+/', $uid)) { list($uid, $folder) = explode('-', $uid, 2); } $this->uid = $uid; $this->app = rcube::get_instance(); $this->storage = $this->app->get_storage(); $this->folder = strlen($folder) ? $folder : $this->storage->get_folder(); // Set current folder $this->storage->set_folder($this->folder); $this->storage->set_options(array('all_headers' => true)); $this->headers = $this->storage->get_message($uid); if (!$this->headers) { return; } $this->mime = new rcube_mime($this->headers->charset); $this->subject = $this->headers->get('subject'); list(, $this->sender) = each($this->mime->decode_address_list($this->headers->from, 1)); $this->set_safe($is_safe || $_SESSION['safe_messages'][$this->folder.':'.$uid]); $this->opt = array( 'safe' => $this->is_safe, 'prefer_html' => $this->app->config->get('prefer_html'), 'get_url' => $this->app->url(array( 'action' => 'get', 'mbox' => $this->folder, 'uid' => $uid)) ); if (!empty($this->headers->structure)) { $this->get_mime_numbers($this->headers->structure); $this->parse_structure($this->headers->structure); } else { $this->body = $this->storage->get_body($uid); } // notify plugins and let them analyze this structured message object $this->app->plugins->exec_hook('message_load', array('object' => $this)); }
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 updateAmazonOrderTracking($order_id, $courier_id, $courier_from_list, $tracking_no) { $this->db->query(" UPDATE `" . DB_PREFIX . "amazon_order` SET `courier_id` = '" . $courier_id . "', `courier_other` = " . (int)!$courier_from_list . ", `tracking_no` = '" . $tracking_no . "' WHERE `order_id` = " . (int)$order_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
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-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 renderPasswordForm($changedUserData, $changedEUFData ) { $ns = e107::getRender(); $updated_data = e107::serialize($changedUserData,'json'); $validation_key = $this->getValidationKey($updated_data); $updated_data = base64_encode($updated_data); $updated_extended = e107::serialize($changedEUFData, 'json'); $extended_key = $this->getValidationKey($updated_extended); $updated_extended = base64_encode($updated_extended); $formTarget = e107::getUrl()->create('user/myprofile/edit'); $text = "<form method='post' action='".$formTarget."'> <table><tr><td>"; foreach ($_POST as $k => $v) { if (is_array($v)) { foreach ($v as $sk => $sv) { $text .= "<input type='hidden' name='{$k}[{$sk}]' value='{$sv}' />\n"; } } else { $text .= "<input type='hidden' name='{$k}' value='{$v}' />\n"; } } $text .= LAN_USET_21."</td></tr> <tr><td>&nbsp;</td></tr> <tr><td> <input type='password' class='form-control' name='currentpassword' value='' size='30' />"; $text .= " <input type='hidden' name='updated_data' value='{$updated_data}' /> <input type='hidden' name='updated_key' value='{$validation_key}' /> <input type='hidden' name='updated_extended' value='{$updated_extended}' /> <input type='hidden' name='extended_key' value='{$extended_key}' /> <input type='hidden' name='e-token' value='".defset('e_TOKEN')."' /> </td></tr> <tr><td>&nbsp;</td></tr> <tr><td style='text-align:center'> ".e107::getForm()->button('SaveValidatedInfo',1, 'submit', LAN_ENTER)." </td></tr> </table> </form>"; $ns->tablerender(LAN_USET_39, $text); }
1
PHP
CWE-326
Inadequate Encryption Strength
The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.
https://cwe.mitre.org/data/definitions/326.html
safe
function delete() { global $db; if (empty($this->params['id'])) return false; $product_type = $db->selectValue('product', 'product_type', 'id=' . $this->params['id']); $product = new $product_type($this->params['id'], true, false); //eDebug($product_type); //eDebug($product, true); //if (!empty($product->product_type_id)) { //$db->delete($product_type, 'id='.$product->product_id); //} $db->delete('option', 'product_id=' . $product->id . " AND optiongroup_id IN (SELECT id from " . $db->prefix . "optiongroup WHERE product_id=" . $product->id . ")"); $db->delete('optiongroup', 'product_id=' . $product->id); //die(); $db->delete('product_storeCategories', 'product_id=' . $product->id . ' AND product_type="' . $product_type . '"'); if ($product->product_type == "product") { if ($product->hasChildren()) { $this->deleteChildren(); } } $product->delete(); flash('message', gt('Product deleted successfully.')); 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 static function getHelpVersionId($version) { global $db; return $db->selectValue('help_version', 'id', 'version="'.$version.'"'); }
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
return $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C2'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C2(${($_ = isset($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C3']) ? $this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C3'] : ($this->services['Symfony\\Component\\DependencyInjection\\Tests\\Fixtures\\includes\\HotPath\\C3'] = new \Symfony\Component\DependencyInjection\Tests\Fixtures\includes\HotPath\C3())) && 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
$db->updateObject($value, 'section'); } $db->updateObject($moveSec, 'section'); //handle re-ranking of previous parent $oldSiblings = $db->selectObjects("section", "parent=" . $oldParent . " AND rank>" . $oldRank . " ORDER BY rank"); $rerank = 1; foreach ($oldSiblings as $value) { if ($value->id != $moveSec->id) { $value->rank = $rerank; $db->updateObject($value, 'section'); $rerank++; } } if ($oldParent != $moveSec->parent) { //we need to re-rank the children of the parent that the moving section has just left $childOfLastMove = $db->selectObjects("section", "parent=" . $oldParent . " ORDER BY rank"); for ($i = 0, $iMax = count($childOfLastMove); $i < $iMax; $i++) { $childOfLastMove[$i]->rank = $i; $db->updateObject($childOfLastMove[$i], 'section'); } } } } self::checkForSectionalAdmins($move); expSession::clearAllUsersSessionCache('navigation'); }
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 paramRules() { return array( 'title' => Yii::t('studio',$this->title), 'info' => Yii::t('studio',$this->info), 'modelRequired' => 'Contacts', 'options' => array( array( 'name'=>'listId', 'label'=>Yii::t('studio', 'List'), 'type'=>'link', 'linkType'=>'X2List', 'linkSource'=>Yii::app()->controller->createUrl( CActiveRecord::model('X2List')->autoCompleteSource, array ( 'static' => 1 ) ) ) )); }
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 public function addCategory($_category = null, $_admin = 1, $_order = 1) { if ($_category != null && $_category != '' ) { if ($_order < 1) { $_order = 1; } $ins_stmt = Database::prepare(" INSERT INTO `" . TABLE_PANEL_TICKET_CATS . "` SET `name` = :name, `adminid` = :adminid, `logicalorder` = :lo" ); $ins_data = array( 'name' => $_category, 'adminid' => $_admin, 'lo' => $_order ); Database::pexecute($ins_stmt, $ins_data); return true; } return 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
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-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 saveConfig() { if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) { if ($this->params['order'] == 'rank ASC') { expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->params); } } parent::saveConfig(); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
protected function _fopen($path, $mode='rb') { return fopen($path, $mode); }
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-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($item->attributes as $name => $value) if ($name !== 'id' && $name !== 'listId') $copy->$name = $value; $lineItems[] = $copy; } return $lineItems; }
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
function mso_url_get() { $CI = &get_instance(); if (isset($_SERVER['REQUEST_URI']) and $_SERVER['REQUEST_URI'] and (strpos($_SERVER['REQUEST_URI'], '?') !== FALSE)) { $url = getinfo('site_protocol') . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $url = str_replace($CI->config->config['base_url'], "", $url); $url = explode('?', $url); return $url[1]; } else { return ''; } }
0
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
public function jsonError(Exception $exception) { $message = $exception->getMessage(); $code = $this->getHttpStatusCode($exception); return new JSONResponse( [ 'message' => $message . ' (' . $code . ')', 'success' => false ], $code ); }
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 testHostMustHaveCorrectType() { (new Uri())->withHost([]); }
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
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
$files[$i] = '.' . DIRECTORY_SEPARATOR . basename($file); } $files = array_map('escapeshellarg', $files); $cmd = $arc['cmd'] . ' ' . $arc['argc'] . ' ' . escapeshellarg($name) . ' ' . implode(' ', $files); $err_out = ''; $this->procExec($cmd, $o, $c, $err_out, $dir); chdir($cwd); } else { return false; } } $path = $dir . DIRECTORY_SEPARATOR . $name; return file_exists($path) ? $path : false; }
0
PHP
CWE-918
Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
https://cwe.mitre.org/data/definitions/918.html
vulnerable
public static function parseAndTrimImport($str, $isHTML = false) { //�Death from above�? � //echo "1<br>"; eDebug($str); // global $db; $str = str_replace("�", "&rsquo;", $str); $str = str_replace("�", "&lsquo;", $str); $str = str_replace("�", "&#174;", $str); $str = str_replace("�", "-", $str); $str = str_replace("�", "&#151;", $str); $str = str_replace("�", "&rdquo;", $str); $str = str_replace("�", "&ldquo;", $str); $str = str_replace("\r\n", " ", $str); $str = str_replace("\,", ",", $str); $str = str_replace('""', '"', $str); //do this no matter what...in case someone added a quote in a non HTML field if (!$isHTML) { //if HTML, then leave the single quotes alone, otheriwse replace w/ special Char $str = str_replace('"', "&quot;", $str); } $str = str_replace("�", "&#188;", $str); $str = str_replace("�", "&#189;", $str); $str = str_replace("�", "&#190;", $str); //$str = htmlspecialchars($str); //$str = utf8_encode($str); // if (DB_ENGINE=='mysqli') { // $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "&trade;", $str))); // } elseif(DB_ENGINE=='mysql') { // $str = @mysql_real_escape_string(trim(str_replace("�", "&trade;", $str)),$db->connection); // } else { // $str = trim(str_replace("�", "&trade;", $str)); // } $str = @expString::escape(trim(str_replace("�", "&trade;", $str))); //echo "2<br>"; eDebug($str,die); return $str; }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function parseModelName($model) { $customModule = Modules::model()->findByAttributes(array( 'custom' => 1, 'name' => $model, )); if ($customModule) { //$model = $customModule->title; $model = Modules::itemDisplayName($customModule->name); $model = strtolower($model); } else { switch ($model) { case 'Product': $model .= 's'; break; case 'Quote': $model .= 's'; break; case 'Opportunity': $model = str_replace('y', 'ies', $model); break; } $requestedModel = $model; $model = Modules::displayName(false, ucfirst($model)); $model = strtolower($model); if (empty($model)) { // If the model type couldn't be resolved, check for special cases // of models without a dedicated module if ($requestedModel === 'AnonContact') $model = 'anonymous contact'; else if ($requestedModel === 'Campaign') $model = 'campaign'; } } return Yii::t('app', $model); }
1
PHP
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
public function getModuleItemString() { $ret = $this->handler->_moduleName . '_' . $this->handler->_itemname; return $ret; }
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 placeholder_escape() { static $placeholder; if ( ! $placeholder ) { // If ext/hash is not present, compat.php's hash_hmac() does not support sha256. $algo = function_exists( 'hash' ) ? 'sha256' : 'sha1'; // Old WP installs may not have AUTH_SALT defined. $salt = defined( 'AUTH_SALT' ) ? AUTH_SALT : rand(); $placeholder = '{' . hash_hmac( $algo, uniqid( $salt, true ), $salt ) . '}'; } /* * Add the filter to remove the placeholder escaper. Uses priority 0, so that anything * else attached to this filter will recieve the query with the placeholder string removed. */ if ( ! has_filter( 'query', array( $this, 'remove_placeholder_escape' ) ) ) { add_filter( 'query', array( $this, 'remove_placeholder_escape' ), 0 ); } return $placeholder; }
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
$sloc = expCore::makeLocation('navigation', null, $section->id); // remove any manage permissions for this page and it's children // $db->delete('userpermission', "module='navigationController' AND internal=".$section->id); // $db->delete('grouppermission', "module='navigationController' AND internal=".$section->id); foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); } foreach ($allgroups as $gid) { $g = group::getGroupById($gid); expPermissions::grantGroup($g, 'manage', $sloc); } } }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
function showallSubcategories() { // global $db; expHistory::set('viewable', $this->params); // $parent = isset($this->params['cat']) ? $this->params['cat'] : expSession::get('catid'); $catid = expSession::get('catid'); $parent = !empty($catid) ? $catid : (!empty($this->params['cat']) ? intval($this->params['cat']) : 0); $category = new storeCategory($parent); $categories = $category->getEcomSubcategories(); $ancestors = $category->pathToNode(); assign_to_template(array( 'categories' => $categories, 'ancestors' => $ancestors, 'category' => $category )); }
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 pending() { // global $db; // make sure we have what we need. if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('Your subscriber ID was not supplied.')); // find the subscriber and their pending subscriptions $ealerts = expeAlerts::getPendingBySubscriber($this->params['id']); $subscriber = new subscribers($this->params['id']); // render the template assign_to_template(array( 'subscriber'=>$subscriber, 'ealerts'=>$ealerts )); }
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
$count += $db->dropTable($basename); } flash('message', gt('Deleted').' '.$count.' '.gt('unused tables').'.'); 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 static function start() { session_name('GeniXCMS'); session_start(); //unset($_SESSION); if (!isset($_SESSION['gxsess']) || $_SESSION['gxsess'] == "" ) { $_SESSION['gxsess'] = array ( 'key' => self::sesKey(), 'time' => date("Y-m-d H:i:s"), 'val' => array() ); } $GLOBALS['start_time'] = microtime(TRUE); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
public static function construct($tagName, $replacementText, $useOption = false, $parseContent = true, $nestLimit = -1, $optionValidator = null, $bodyValidator = null) { $def = new CodeDefinition(); $def->elCounter = 0; $def->setTagName($tagName); $def->setReplacementText($replacementText); $def->useOption = $useOption; $def->parseContent = $parseContent; $def->nestLimit = $nestLimit; $def->optionValidator = $optionValidator; $def->bodyValidator = $bodyValidator; return $def; }
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 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
foreach ($week as $dayNum => $day) { if ($dayNum == $now['mday']) { $currentweek = $weekNum; } if ($dayNum <= $endofmonth) { // $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $db->countObjects("eventdate", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; $monthly[$weekNum][$dayNum]['number'] = ($monthly[$weekNum][$dayNum]['ts'] != -1) ? $ed->find("count", $locsql . " AND date >= " . expDateTime::startOfDayTimestamp($day['ts']) . " AND date <= " . expDateTime::endOfDayTimestamp($day['ts'])) : -1; } }
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['type'])) { $attr['type'] = 'text/javascript'; } 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
static function displayname() { return gt("e-Commerce Category Manager"); }
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 getMailingDetails($id) { trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED); $details = Shopware()->Modules()->Marketing()->sMailCampaignsGetDetail((int) $id); if (!\is_array($details)) { return []; } foreach ($details['containers'] as $key => $container) { if ($container['type'] === Container::TYPE_VOUCHER) { if (!empty($container['value'])) { $details['voucher'] = $container['value']; } $details['containers'][$key]['type'] = Container::TYPE_TEXT; } if ($container['type'] === Container::TYPE_SUGGEST) { $details['suggest'] = true; } } return $details; }
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 start() { if (version_compare(PHP_VERSION, '5.4.0', '>=')) { if (session_status() !== PHP_SESSION_ACTIVE) { session_start(); } } else { set_error_handler(array($this, 'session_start_error'), E_NOTICE); session_start(); restore_error_handler(); } $this->started = session_id()? true : false; return $this; }
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 restoreX2AuthManager () { if (isset (self::$_oldAuthManagerComponent)) { Yii::app()->setComponent ('authManager', self::$_oldAuthManagerComponent); } }
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 localFileSystemInotify($path, $standby, $compare) { if (isset($this->sessionCache['localFileSystemInotify_disable'])) { return false; } $path = realpath($path); $mtime = filemtime($path); if (! $mtime) { return false; } if ($mtime != $compare) { return $mtime; } $inotifywait = defined('ELFINER_INOTIFYWAIT_PATH')? ELFINER_INOTIFYWAIT_PATH : 'inotifywait'; $standby = max(1, intval($standby)); $cmd = $inotifywait.' '.escapeshellarg($path).' -t '.$standby.' -e moved_to,moved_from,move,close_write,delete,delete_self'; $this->procExec($cmd , $o, $r); if ($r === 0) { // changed clearstatcache(); if (file_exists($path)) { $mtime = filemtime($path); // error on busy? return $mtime? $mtime : time(); } else { // target was removed return 0; } } else if ($r === 2) { // not changed (timeout) return $compare; } // error // cache to $_SESSION $this->sessionCache['localFileSystemInotify_disable'] = true; $this->session->set($this->id, $this->sessionCache, true); 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
protected function _mkdir($path, $name) { $path = $this->_joinPath($path, $name); if (ftp_mkdir($this->connect, $path) === false) { return false; } $this->options['dirMode'] && @ftp_chmod($this->connect, $this->options['dirMode'], $path); return $path; }
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 _allrevisionssince( $option ) { $this->addTable( 'revision_actor_temp', 'rev' ); $this->addSelect( [ 'rev.revactor_rev', 'rev.revactor_timestamp' ] ); $this->addOrderBy( 'rev.revactor_rev' ); $this->setOrderDir( 'DESC' ); $this->addWhere( [ $this->tableNames['page'] . '.page_id = rev.revactor_page', 'rev.revactor_timestamp >= ' . $this->convertTimestamp( $option ) ] ); }
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 load() { w3_require_once(W3TC_INC_FUNCTIONS_DIR . '/admin.php'); $this->_page = w3tc_get_current_page(); /** * Run plugin action */ $action = false; foreach ($_REQUEST as $key => $value) { if (strpos($key, 'w3tc_') === 0) { $action = 'action_' . substr($key, 5); break; } } $flush = false; $cdn = false; $support = false; $action_handler = w3_instance('W3_AdminActions_ActionHandler'); $action_handler->set_default($this); $action_handler->set_current_page($this->_page); if ($action && $action_handler->exists($action)) { if (!wp_verify_nonce(W3_Request::get_string('_wpnonce'), 'w3tc')) wp_nonce_ays('w3tc'); try { $action_handler->execute($action); } catch (Exception $e) { w3_admin_redirect_with_custom_messages(array(), array($e->getMessage())); } exit(); } }
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
foreach ($nodes as $node) { if ((($perm == 'view' && $node->public == 1) || expPermissions::check($perm, expCore::makeLocation('navigation', '', $node->id))) && !in_array($node->id, $ignore_ids)) { if ($node->active == 1) { $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . $node->name; } else { $text = str_pad('', ($depth + ($full ? 1 : 0)) * 3, '.', STR_PAD_LEFT) . '(' . $node->name . ')'; } $ar[$node->id] = $text; foreach (self::levelDropdownControlArray($node->id, $depth + 1, $ignore_ids, $full, $perm, $addstandalones, $addinternalalias) as $id => $text) { $ar[$id] = $text; } } }
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 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
firstname: l.attr('data-firstname') }); l.append(` <div class="member-details"> ${member_item} ${l.attr('data-name') || `${member_itemtype} (${member_items_id})`} </div> <button type="button" name="delete" class="btn btn-ghost-danger"> <i class="ti ti-x" title="${__('Delete')}"></i> </button> `); });
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 params() { $project = $this->getProject(); $values = $this->request->getValues(); $values['project_id'] = $project['id']; if (empty($values['action_name']) || empty($values['event_name'])) { $this->create(); return; } $action = $this->actionManager->getAction($values['action_name']); $action_params = $action->getActionRequiredParameters(); if (empty($action_params)) { $this->doCreation($project, $values + array('params' => array())); } $projects_list = $this->projectUserRoleModel->getActiveProjectsByUser($this->userSession->getId()); unset($projects_list[$project['id']]); $this->response->html($this->template->render('action_creation/params', array( 'values' => $values, 'action_params' => $action_params, 'columns_list' => $this->columnModel->getList($project['id']), 'users_list' => $this->projectUserRoleModel->getAssignableUsersList($project['id']), 'projects_list' => $projects_list, 'colors_list' => $this->colorModel->getList(), 'categories_list' => $this->categoryModel->getList($project['id']), 'links_list' => $this->linkModel->getList(0, false), 'priorities_list' => $this->projectTaskPriorityModel->getPriorities($project), 'project' => $project, 'available_actions' => $this->actionManager->getAvailableActions(), 'swimlane_list' => $this->swimlaneModel->getList($project['id']), 'events' => $this->actionManager->getCompatibleEvents($values['action_name']), ))); }
1
PHP
CWE-639
Authorization Bypass Through User-Controlled Key
The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data.
https://cwe.mitre.org/data/definitions/639.html
safe
function import() { $pullable_modules = expModules::listInstalledControllers($this->baseclassname); $modules = new expPaginator(array( 'records' => $pullable_modules, 'controller' => $this->loc->mod, 'action' => $this->params['action'], 'order' => isset($this->params['order']) ? $this->params['order'] : 'section', 'dir' => isset($this->params['dir']) ? $this->params['dir'] : '', 'page' => (isset($this->params['page']) ? $this->params['page'] : 1), 'columns' => array( gt('Title') => 'title', gt('Page') => 'section' ), )); assign_to_template(array( 'modules' => $modules, )); }
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 isBenign($config, $context) { if (!$this->isLocal($config, $context)) return false; $scheme_obj = $this->getSchemeObj($config, $context); if (!$scheme_obj) return false; // conservative approach $current_scheme_obj = $config->getDefinition('URI')->getDefaultScheme($config, $context); if ($current_scheme_obj->secure) { if (!$scheme_obj->secure) { return false; } } return true; }
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
$field_id = Symphony::Database()->fetchVar('id', 0, sprintf( "SELECT `f`.`id` FROM `tbl_fields` AS `f`, `tbl_sections` AS `s` WHERE `s`.`id` = `f`.`parent_section` AND f.`element_name` = '%s' AND `s`.`handle` = '%s' LIMIT 1", $handle, $section->get('handle')) ); $field = $entryManager->fieldManager->fetch($field_id); if($field instanceof Field) { // For deprecated reasons, call the old, typo'd function name until the switch to the // properly named buildDSRetrievalSQL function. $field->buildDSRetrivalSQL(array($value), $joins, $where, false); $filter_querystring .= sprintf("filter[%s]=%s&amp;", $handle, rawurlencode($value)); $prepopulate_querystring .= sprintf("prepopulate[%d]=%s&amp;", $field_id, rawurlencode($value)); } else { unset($filters[$i]); } }
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 sessionDataDecode(&$var, $checkIs = null) { if (self::$base64encodeSessionData) { $data = unserialize(base64_decode($var)); } else { $data = $var; } $chk = true; if ($checkIs) { switch ($checkIs) { case 'array': $chk = is_array($data); break; case 'string': $chk = is_string($data); break; case 'object': $chk = is_object($data); break; case 'int': $chk = is_int($data); break; } } if (!$chk) { unset($var); return false; } return $data; }
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 activate_discount(){ if (isset($this->params['id'])) { $discount = new discounts($this->params['id']); $discount->update($this->params); //if ($discount->discountulator->hasConfig() && empty($discount->config)) { //flash('messages', $discount->discountulator->name().' requires configuration. Please do so now.'); //redirect_to(array('controller'=>'billing', 'action'=>'configure', 'id'=>$discount->id)); //} } 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
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
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-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 getComment() { $comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id')); if (empty($comment)) { throw new PageNotFoundException(); } if (! $this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->getId()) { throw new AccessForbiddenException(); } return $comment; }
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 __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
function functions_list() { $navibars = new navibars(); $navitable = new navitable("functions_list"); $navibars->title(t(244, 'Menus')); $navibars->add_actions( array( '<a href="?fid='.$_REQUEST['fid'].'&act=2"><img height="16" align="absmiddle" width="16" src="img/icons/silk/add.png"> '.t(38, 'Create').'</a>', '<a href="?fid='.$_REQUEST['fid'].'&act=0"><img height="16" align="absmiddle" width="16" src="img/icons/silk/application_view_list.png"> '.t(39, 'List').'</a>', 'search_form' )); if($_REQUEST['quicksearch']=='true') { $navitable->setInitialURL("?fid=".$_REQUEST['fid'].'&act=json&_search=true&quicksearch='.$_REQUEST['navigate-quicksearch']); } $navitable->setURL('?fid='.$_REQUEST['fid'].'&act=json'); $navitable->sortBy('id'); $navitable->setDataIndex('id'); $navitable->setEditUrl('id', '?fid='.$_REQUEST['fid'].'&act=edit&id='); $navitable->addCol("ID", 'id', "80", "true", "left"); $navitable->addCol(t(237, 'Code'), 'codename', "100", "true", "left"); $navitable->addCol(t(242, 'Icon'), 'icon', "50", "true", "center"); $navitable->addCol(t(67, 'Title'), 'lid', "200", "true", "left"); $navitable->addCol(t(65, 'Enabled'), 'enabled', "80", "true", "center"); $navibars->add_content($navitable->generate()); return $navibars->generate(); }
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 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(); }
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 selectArray($table, $where = null, $orderby = null, $is_revisioned=false, $needs_approval=false) { if ($where == null) $where = "1"; else $where = $this->injectProof($where); $as = ''; if ($is_revisioned) { // $where.= " AND revision_id=(SELECT MAX(revision_id) FROM `" . $this->prefix . "$table` WHERE $where)"; $where .= " AND revision_id=(SELECT MAX(revision_id) FROM `" . $this->prefix . "$table` WHERE id = rev.id "; if ($needs_approval) $where .= ' AND (approved=1 OR poster=' . $needs_approval . ' OR editor=' . $needs_approval . ')'; $where .= ")"; $as = ' AS rev'; } $orderby = empty($orderby) ? '' : "ORDER BY " . $orderby; $sql = "SELECT * FROM `" . $this->prefix . "$table`" . $as . " WHERE $where $orderby LIMIT 0,1"; $res = @mysqli_query($this->connection, $sql); if ($res == null) return array(); return mysqli_fetch_assoc($res); }
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 clean_input_value($value) { if (is_string($value)) { return descript($value); } if (is_array($value)) { return array_map('descript', $value); } 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
if ($current_realm_id == -1 || is_realm_allowed($current_realm_id) || !isset($user_auth_realm_filenames{basename($item_url)})) { /* draw normal (non sub-item) menu item */ $item_url = $config['url_path'] . $item_url; if (is_menu_pick_active($item_url)) { print "<li><a role='menuitem' class='pic selected' href='" . htmlspecialchars($item_url) . "'>$item_title</a></li>\n"; } else { print "<li><a role='menuitem' class='pic' href='" . htmlspecialchars($item_url) . "'>$item_title</a></li>\n"; } } } }
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 init( $settings = false ) { if ( $settings === false ) { global $wgDplSettings; $settings = $wgDplSettings; } if ( !is_array( $settings ) ) { throw new MWException( __METHOD__ . ": Invalid settings passed." ); } self::$settings = array_merge( self::$settings, $settings ); }
0
PHP
CWE-400
Uncontrolled Resource Consumption
The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources.
https://cwe.mitre.org/data/definitions/400.html
vulnerable
foreach ($day as $extevent) { $event_cache = new stdClass(); $event_cache->feed = $extgcalurl; $event_cache->event_id = $extevent->event_id; $event_cache->title = $extevent->title; $event_cache->body = $extevent->body; $event_cache->eventdate = $extevent->eventdate->date; if (isset($extevent->dateFinished) && $extevent->dateFinished != -68400) $event_cache->dateFinished = $extevent->dateFinished; if (isset($extevent->eventstart)) $event_cache->eventstart = $extevent->eventstart; if (isset($extevent->eventend)) $event_cache->eventend = $extevent->eventend; if (isset($extevent->is_allday)) $event_cache->is_allday = $extevent->is_allday; $found = false; if ($extevent->eventdate->date < $start) // prevent duplicating events crossing month boundaries $found = $db->selectObject('event_cache','feed="'.$extgcalurl.'" AND event_id="'.$event_cache->event_id.'" AND eventdate='.$event_cache->eventdate); if (!$found) $db->insertObject($event_cache,'event_cache'); }
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 __construct( $method, $uri, array $headers = [], $body = null, $version = '1.1', array $serverParams = [] ) { $this->serverParams = $serverParams; parent::__construct($method, $uri, $headers, $body, $version); }
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 getQueryOrderby() { $R1 = 'R1_' . $this->field->id; $R2 = 'R2_' . $this->field->id; return $this->is_rank_alpha ? "$R2.label" : "$R2.rank"; }
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 parseChunkedRequest(Request $request) { $session = $this->container->get('session'); $orig = $request->get('name'); $index = $request->get('chunk'); $last = (int) $request->get('chunks') - 1 === (int) $request->get('chunk'); // it is possible, that two clients send a file with the // exact same filename, therefore we have to add the session // to the uuid otherwise we will get a mess $uuid = md5(sprintf('%s.%s', $orig, $session->getId())); return [$last, $uuid, $index, $orig]; }
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
private function sendString ($string) { $bytes_sent = fwrite($this->pop_conn, $string, strlen($string)); return $bytes_sent; }
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 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 . '%'; } $offset = abs ((int) $offset); $limit = abs ((int) $limit); $command = Yii::app()->db->createCommand (" SELECT " . implode (',', $valueAttr) . ", $nameAttr as __name FROM $table WHERE " . ($prefix === '' ? '1=1' : ($nameAttr . ' LIKE :prefix') ) . " ORDER BY __name LIMIT $offset, $limit ");
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
function _makeChooseCheckbox($value, $title) { global $THIS_RET; // return '<INPUT type=checkbox name=st_arr[] value=' . $value . ' checked>'; return "<input name=unused[$THIS_RET[STUDENT_ID]] value=" . $THIS_RET[STUDENT_ID] . " type='checkbox' id=$THIS_RET[STUDENT_ID] onClick='setHiddenCheckboxStudents(\"st_arr[]\",this,$THIS_RET[STUDENT_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 static function setActive($lang = '') { $lg = Options::v('multilang_country'); $lg = json_decode($lg, true); if (isset($_GET['lang']) && $_GET['lang'] != '' && $lang == '') { if (key_exists($_GET['lang'], $lg)) { Session::set(array('lang' => $_GET['lang'])); } else { Session::remove('lang'); } } elseif ($lang != '') { if (key_exists($lang, $lg)) { Session::set(array('lang' => $lang)); } else { Session::remove('lang'); } } }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
$payment->write(); $i++; } // Ugly hack to set the money amount $this->payment->Status = 'Created'; $this->payment->setAmount($total); // If not everything was refunded, the payment should still have the "Captured" status if ($total > 0) { $endStatus = 'Captured'; } } parent::markCompleted($endStatus, $serviceResponse, $gatewayMessage); if ($endStatus === 'Captured') { $this->createMessage(Message\PartiallyRefundedResponse::class, $gatewayMessage); } else { $this->createMessage(Message\RefundedResponse::class, $gatewayMessage); } ErrorHandling::safeExtend($this->payment, 'onRefunded', $serviceResponse); }
0
PHP
CWE-436
Interpretation Conflict
Product A handles inputs or steps differently than Product B, which causes A to perform incorrect actions based on its perception of B's state.
https://cwe.mitre.org/data/definitions/436.html
vulnerable
function form_selectable_ecell($contents, $id, $width = '', $style_or_class = '', $title = '') { form_selectable_cell(html_escape($contents), $id, $width, $style_or_class, $title); }
1
PHP
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
https://cwe.mitre.org/data/definitions/79.html
safe
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(); }
1
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
$keys = array_keys($value); // print_r($keys); if ($keys[0] == $lang) { $lang = $multilang[$key][$lang]; return $lang; } } } }
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 gdImageCreate($path,$mime){ switch($mime){ case 'image/jpeg': return @imagecreatefromjpeg($path); case 'image/png': return @imagecreatefrompng($path); case 'image/gif': return @imagecreatefromgif($path); case 'image/x-ms-bmp': if (!function_exists('imagecreatefrombmp')) { include_once dirname(__FILE__).'/libs/GdBmp.php'; } return @imagecreatefrombmp($path); case 'image/xbm': return @imagecreatefromxbm($path); case 'image/xpm': return @imagecreatefromxpm($path); } 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
foreach ($allusers as $uid) { $u = user::getUserById($uid); expPermissions::grant($u, 'manage', $sloc); }
0
PHP
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
vulnerable
$row_rub = sql_fetsel("id_rubrique", "spip_rubriques", "lang='" . $GLOBALS['spip_lang'] . "' AND id_parent=$id_parent"); if ($row_rub) { $row['id_rubrique'] = $row_rub['id_rubrique']; } } } } return $row; }
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
public function isMoved() { return $this->moved; }
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 testGetDeepWithInvalidPaths($path) { $bag = new ParameterBag(array('foo' => array('bar' => 'moo'))); $bag->get($path, null, 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
$this->paths[substr($key, strlen('path-'))] = $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
public function setModelAttributes(&$model,&$attributeList,&$params) { $data = array (); foreach($attributeList as &$attr) { if(!isset($attr['name'],$attr['value'])) continue; if(null !== $field = $model->getField($attr['name'])) { // first do variable/expression evaluation, // then process with X2Fields::parseValue() $type = $field->type; $value = $attr['value']; if(is_string($value)){ if(strpos($value, '=') === 0){ $evald = X2FlowFormatter::parseFormula($value, $params); if(!$evald[0]) return false; $value = $evald[1]; } elseif($params !== null){ if(is_string($value) && isset($params['model'])){ $value = X2FlowFormatter::replaceVariables( $value, $params, $type); } } } $data[$attr['name']] = $value; } } if (!isset ($model->scenario)) $model->setScenario ('X2Flow'); $model->setX2Fields ($data); if ($model instanceof Actions && isset($data['complete'])) { switch($data['complete']) { case 'Yes': $model->complete(); break; case 'No': $model->uncomplete(); break; } } return true; }
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