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 |
---|---|---|---|---|---|---|---|
list($ns, $key) = explode('.', $name, 2);
$ret[$ns][$key] = $value;
}
return $ret;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
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-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function manage() {
expHistory::set('viewable', $this->params);
// $category = new storeCategory();
// $categories = $category->getFullTree();
//
// // foreach($categories as $i=>$val){
// // if (!empty($this->values) && in_array($val->id,$this->values)) {
// // $this->tags[$i]->value = true;
// // } else {
// // $this->tags[$i]->value = false;
// // }
// // $this->tags[$i]->draggable = $this->draggable;
// // $this->tags[$i]->checkable = $this->checkable;
// // }
//
// $obj = json_encode($categories);
} | 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 unlockTables() {
$sql = "UNLOCK TABLES";
$res = mysqli_query($this->connection, $sql);
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 |
public function subscriptions() {
global $db;
expHistory::set('manageable', $this->params);
// make sure we have what we need.
if (empty($this->params['key'])) expQueue::flashAndFlow('error', gt('The security key for account was not supplied.'));
if (empty($this->params['id'])) expQueue::flashAndFlow('error', gt('The subscriber id for account was not supplied.'));
// verify the id/key pair
$sub = new subscribers($this->params['id']);
if (empty($sub->id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.'));
// get this users subscriptions
$subscriptions = $db->selectColumn('expeAlerts_subscribers', 'expeAlerts_id', 'subscribers_id='.$sub->id);
// get a list of all available E-Alerts
$ealerts = new expeAlerts();
assign_to_template(array(
'subscriber'=>$sub,
'subscriptions'=>$subscriptions,
'ealerts'=>$ealerts->find('all')
));
} | 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 hasParent()
{
return $this->parent != null;
} | 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 ($module->info_injector as $i => $injector) {
if (!is_object($injector)) {
$class = "HTMLPurifier_Injector_$injector";
$injector = new $class;
}
$n[$injector->name] = $injector;
} | 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 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-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 editAlt() {
global $user;
$file = new expFile($this->params['id']);
if ($user->id==$file->poster || $user->isAdmin()) {
$file->alt = $this->params['newValue'];
$file->save();
$ar = new expAjaxReply(200, gt('Your alt was updated successfully'), $file);
} else {
$ar = new expAjaxReply(300, gt("You didn't create this file, so you can't edit it."));
}
$ar->send();
echo json_encode($file); //FIXME we exit before hitting this
} | 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 getError()
{
return $this->error;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function autocomplete() {
return;
global $db;
$model = $this->params['model'];
$mod = new $model();
$srchcol = explode(",",$this->params['searchoncol']);
/*for ($i=0; $i<count($srchcol); $i++) {
if ($i>=1) $sql .= " OR ";
$sql .= $srchcol[$i].' LIKE \'%'.$this->params['query'].'%\'';
}*/
// $sql .= ' AND parent_id=0';
//eDebug($sql);
//$res = $mod->find('all',$sql,'id',25);
$sql = "select DISTINCT(p.id), p.title, model, sef_url, f.id as fileid from ".$db->prefix."product as p INNER JOIN ".$db->prefix."content_expfiles as cef ON p.id=cef.content_id INNER JOIN ".$db->prefix."expfiles as f ON cef.expfiles_id = f.id where match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') AND p.parent_id=0 order by match (p.title,p.model,p.body) against ('" . $this->params['query'] . "') desc LIMIT 25";
//$res = $db->selectObjectsBySql($sql);
//$res = $db->selectObjectBySql('SELECT * FROM `exponent_product`');
$ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res);
$ar->send();
} | 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 postFilter($html, $config, $context) {
return $html;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function setPassword(Request $request, string $token)
{
$this->validate($request, [
'password' => ['required', 'min:8'],
]);
try {
$userId = $this->inviteService->checkTokenAndGetUserId($token);
} catch (Exception $exception) {
return $this->handleTokenException($exception);
}
$user = $this->userRepo->getById($userId);
$user->password = bcrypt($request->get('password'));
$user->email_confirmed = true;
$user->save();
$this->inviteService->deleteByUser($user);
$this->showSuccessNotification(trans('auth.user_invite_success', ['appName' => setting('app-name')]));
$this->loginService->login($user, auth()->getDefaultDriver());
return redirect('/');
} | 0 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | vulnerable |
function selectObjectsIndexedArray($table, $where = null, $orderby = null) {
if ($where == null)
$where = "1";
else
$where = $this->injectProof($where);
if ($orderby == null)
$orderby = '';
else
$orderby = "ORDER BY " . $orderby;
$res = @mysqli_query($this->connection, "SELECT * FROM `" . $this->prefix . "$table` WHERE $where $orderby");
if ($res == null)
return array();
$objects = array();
for ($i = 0, $iMax = mysqli_num_rows($res); $i < $iMax; $i++) {
$o = mysqli_fetch_object($res);
$objects[$o->id] = $o;
}
return $objects;
} | 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 load_from_post()
{
if(intval($_REQUEST['parent'])!=$this->id) // protection against selecting this same category as parent of itself
{
$this->parent = intval($_REQUEST['parent']);
}
$this->template = $_REQUEST['template'];
$this->access = intval($_REQUEST['access']);
$this->groups = $_REQUEST['groups'];
if($this->access < 3)
{
$this->groups = array();
}
$this->permission = intval($_REQUEST['permission']);
$this->visible = intval($_REQUEST['visible']);
$this->date_published = (empty($_REQUEST['date_published'])? '' : core_date2ts($_REQUEST['date_published']));
$this->date_unpublish = (empty($_REQUEST['date_unpublish'])? '' : core_date2ts($_REQUEST['date_unpublish']));
// language strings and options
$this->dictionary = array();
$this->paths = array();
$fields = array('title', 'action-type', 'action-jump-item', 'action-jump-branch', 'action-new-window', 'action-masked-redirect'); //, 'path', 'visible');
foreach($_REQUEST as $key => $value)
{
if(empty($value))
{
continue;
}
foreach($fields as $field)
{
if(substr($key, 0, strlen($field.'-'))==$field.'-')
{
$this->dictionary[substr($key, strlen($field.'-'))][$field] = $value;
}
}
if(substr($key, 0, strlen('path-'))=='path-')
{
$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 showUnpublished() {
expHistory::set('viewable', $this->params);
// setup the where clause for looking up records.
$where = parent::aggregateWhereClause();
$where = "((unpublish != 0 AND unpublish < ".time().") OR (publish > ".time().")) AND ".$where;
if (isset($this->config['only_featured'])) $where .= ' AND is_featured=1';
$page = new expPaginator(array(
'model'=>'news',
'where'=>$where,
'limit'=>25,
'order'=>'unpublish',
'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),
'controller'=>$this->baseclassname,
'action'=>$this->params['action'],
'src'=>$this->loc->src,
'columns'=>array(
gt('Title')=>'title',
gt('Published On')=>'publish',
gt('Status')=>'unpublish'
),
));
assign_to_template(array(
'page'=>$page
));
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
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 |
public function manage()
{
expHistory::set('manageable',$this->params);
$gc = new geoCountry();
$countries = $gc->find('all');
$gr = new geoRegion();
$regions = $gr->find('all',null,'rank asc,name asc');
assign_to_template(array(
'countries'=>$countries,
'regions'=>$regions
));
} | 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 redirect($url)
{
if (trim($url) == '') {
return false;
}
$url = str_ireplace('Location:', '', $url);
$url = trim($url);
$redirectUrl = site_url();
$parseUrl = parse_url($url);
if (isset($parseUrl['host'])) {
if ($parseUrl['host'] == site_hostname()) {
$redirectUrl = $url;
}
}
$redirectUrl = str_replace("\r", "", $redirectUrl);
$redirectUrl = str_replace("\n", "", $redirectUrl);
if (headers_sent()) {
echo '<meta http-equiv="refresh" content="0;url=' . $redirectUrl . '">';
} else {
return \Redirect::to($redirectUrl);
}
} | 1 | PHP | CWE-93 | Improper Neutralization of CRLF Sequences ('CRLF Injection') | The software uses CRLF (carriage return line feeds) as a special element, e.g. to separate lines or records, but it does not neutralize or incorrectly neutralizes CRLF sequences from inputs. | https://cwe.mitre.org/data/definitions/93.html | safe |
public function showall() {
expHistory::set('viewable', $this->params);
// figure out if should limit the results
if (isset($this->params['limit'])) {
$limit = $this->params['limit'] == 'none' ? null : $this->params['limit'];
} else {
$limit = (isset($this->config['limit']) && $this->config['limit'] != '') ? $this->config['limit'] : 10;
}
$order = isset($this->config['order']) ? $this->config['order'] : 'publish DESC';
// pull the news posts from the database
$items = $this->news->find('all', $this->aggregateWhereClause(), $order);
// merge in any RSS news and perform the sort and limit the number of posts we return to the configured amount.
if (!empty($this->config['pull_rss'])) $items = $this->mergeRssData($items);
// setup the pagination object to paginate the news stories.
$page = new expPaginator(array(
'records'=>$items,
'limit'=>$limit,
'order'=>$order,
'page'=>(isset($this->params['page']) ? $this->params['page'] : 1),
'controller'=>$this->params['controller'],
'action'=>$this->params['action'],
'src'=>$this->loc->src,
'view'=>empty($this->params['view']) ? null : $this->params['view']
));
assign_to_template(array(
'page'=>$page,
'items'=>$page->records,
'rank'=>($order==='rank')?1:0,
'params'=>$this->params,
));
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
function reset_stats() {
// global $db;
// reset the counters
// $db->sql ('UPDATE '.$db->prefix.'banner SET impressions=0 WHERE 1');
banner::resetImpressions();
// $db->sql ('UPDATE '.$db->prefix.'banner SET clicks=0 WHERE 1');
banner::resetClicks();
// let the user know we did stuff.
flash('message', gt("Banner statistics reset."));
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 |
function edit() {
global $template;
parent::edit();
$allforms = array();
$allforms[""] = gt('Disallow Feedback');
// calculate which event date is the one being edited
$event_key = 0;
foreach ($template->tpl->tpl_vars['record']->value->eventdate as $key=>$d) {
if ($d->id == $this->params['date_id']) $event_key = $key;
}
assign_to_template(array(
'allforms' => array_merge($allforms, expTemplate::buildNameList("forms", "event/email", "tpl", "[!_]*")),
'checked_date' => !empty($this->params['date_id']) ? $this->params['date_id'] : null,
'event_key' => $event_key,
));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function actionView($id) {
$model = CActiveRecord::model('Docs')->findByPk($id);
if (!$this->checkPermissions($model, 'view')) $this->denied ();
if(isset($model)){
$permissions=explode(", ",$model->editPermissions);
if(in_array(Yii::app()->user->getName(),$permissions))
$editFlag=true;
else
$editFlag=false;
}
if (!isset($model) ||
($model->visibility == 0 && $model->createdBy != Yii::app()->user->getName()) &&
!Yii::app()->params->isAdmin && !$editFlag)
$this->redirect(array('/docs/docs/index'));
// add doc to user's recent item list
User::addRecentItem('d', $id, Yii::app()->user->getId());
X2Flow::trigger('RecordViewTrigger',array('model'=>$model));
$this->render('view', array(
'model' => $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 save(){
$login_user = $this->checkLogin();
$team_name = I("team_name");
$id = I("id/d");
if ($id) {
D("Team")->where(" id = '$id' ")->save(array("team_name"=>$team_name));
}else{
$data['username'] = $login_user['username'] ;
$data['uid'] = $login_user['uid'] ;
$data['team_name'] = $team_name ;
$data['addtime'] = time() ;
$id = D("Team")->add($data);
}
$return = D("Team")->where(" id = '$id' ")->find();
if (!$return) {
$return['error_code'] = 10103 ;
$return['error_message'] = 'request fail' ;
}
$this->sendResult($return);
} | 0 | PHP | CWE-352 | Cross-Site Request Forgery (CSRF) | The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request. | https://cwe.mitre.org/data/definitions/352.html | vulnerable |
function render() {
$output = $this->pageContext->getOutput();
$output->enableOOUI();
$this->showAddBypassForm();
$this->showBypassesList();
}
| 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 |
protected function configure() {
// set ARGS
$this->ARGS = $_SERVER['REQUEST_METHOD'] === 'POST'? $_POST : $_GET;
// set thumbnails path
$path = $this->options['tmbPath'];
if ($path) {
if (!file_exists($path)) {
if (@mkdir($path)) {
chmod($path, $this->options['tmbPathMode']);
} else {
$path = '';
}
}
if (is_dir($path) && is_readable($path)) {
$this->tmbPath = $path;
$this->tmbPathWritable = is_writable($path);
}
}
// set image manipulation library
$type = preg_match('/^(imagick|gd|auto)$/i', $this->options['imgLib'])
? strtolower($this->options['imgLib'])
: 'auto';
if (($type == 'imagick' || $type == 'auto') && extension_loaded('imagick')) {
$this->imgLib = 'imagick';
} else {
$this->imgLib = function_exists('gd_info') ? 'gd' : '';
}
// check archivers
if (empty($this->archivers['create'])) {
$this->disabled[] ='archive';
}
if (empty($this->archivers['extract'])) {
$this->disabled[] ='extract';
}
$_arc = $this->getArchivers();
if (empty($_arc['create'])) {
$this->disabled[] ='zipdl';
}
// check 'statOwner' for command `chmod`
if (empty($this->options['statOwner'])) {
$this->disabled[] ='chmod';
}
// check 'mimeMap'
if (!is_array($this->options['mimeMap'])) {
$this->options['mimeMap'] = array();
}
} | 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 getAcl($node) {
if (is_string($node)) {
$node = $this->server->tree->getNodeForPath($node);
}
$acl = parent::getAcl($node);
// Authenticated user have read access to all nodes, as node list only contains elements
// that user can read.
$acl[] = [
'principal' => '{DAV:}authenticated',
'privilege' => '{DAV:}read',
'protected' => true,
];
if ($node instanceof Calendar && \Session::haveRight(\PlanningExternalEvent::$rightname, UPDATE)) {
// If user can update external events, then he is able to write on calendar to create new events.
$acl[] = [
'principal' => '{DAV:}authenticated',
'privilege' => '{DAV:}write',
'protected' => true,
];
} else if ($node instanceof CalendarObject) {
$item = $this->getCalendarItemForPath($node->getName());
if ($item instanceof \CommonDBTM && $item->can($item->fields['id'], UPDATE)) {
$acl[] = [
'principal' => '{DAV:}authenticated',
'privilege' => '{DAV:}write',
'protected' => true,
];
}
}
return $acl;
} | 0 | PHP | CWE-862 | Missing Authorization | The software does not perform an authorization check when an actor attempts to access a resource or perform an action. | https://cwe.mitre.org/data/definitions/862.html | vulnerable |
protected function parse()
{
parent::parse();
// grab the error-type from the parameters
$errorType = $this->getParameter('type');
// set correct headers
switch($errorType)
{
case 'module-not-allowed':
case 'action-not-allowed':
SpoonHTTP::setHeadersByCode(403);
break;
case 'not-found':
SpoonHTTP::setHeadersByCode(404);
break;
}
// querystring provided?
if($this->getParameter('querystring') !== null)
{
// split into file and parameters
$chunks = explode('?', $this->getParameter('querystring'));
// get extension
$extension = SpoonFile::getExtension($chunks[0]);
// if the file has an extension it is a non-existing-file
if($extension != '' && $extension != $chunks[0])
{
// set correct headers
SpoonHTTP::setHeadersByCode(404);
// give a nice error, so we can detect which file is missing
echo 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.';
// stop script execution
exit;
}
}
// assign the correct message into the template
$this->tpl->assign('message', BL::err(SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
} | 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 getProjectTag(array $project)
{
$tag = $this->tagModel->getById($this->request->getIntegerParam('tag_id'));
if (empty($tag)) {
throw new PageNotFoundException();
}
if ($tag['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
return $tag;
} | 1 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | safe |
static public function getHighestOrderNumber($_uid = 0)
{
$where = '';
$sel_data = array();
if ($_uid > 0) {
$where = " WHERE `adminid` = :adminid";
$sel_data['adminid'] = $_uid;
}
$sql = "SELECT MAX(`logicalorder`) as `highestorder` FROM `" . TABLE_PANEL_TICKET_CATS . "`" . $where . ";";
$result_stmt = Database::prepare($sql);
$result = Database::pexecute_first($result_stmt, $sel_data);
return (isset($result['highestorder']) ? (int) $result['highestorder'] : 0);
} | 1 | 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 | safe |
foreach ($days as $event) {
if (empty($event->eventdate->date) || ($viewrange == 'upcoming' && $event->eventdate->date < time()))
break;
if (empty($event->eventstart))
$event->eventstart = $event->eventdate->date;
$extitem[] = $event;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function actionGetItems(){
$sql =
'SELECT id, name as value
FROM x2_templates
WHERE name
LIKE :qterm
ORDER BY name ASC';
$command = Yii::app()->db->createCommand($sql);
$qterm = $_GET['term'].'%';
$command->bindParam(":qterm", $qterm, PDO::PARAM_STR);
$result = $command->queryAll();
echo CJSON::encode($result); exit;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
public function __toString()
{
$str = $this->data['Name'] . '=' . $this->data['Value'] . '; ';
foreach ($this->data as $k => $v) {
if ($k !== 'Name' && $k !== 'Value' && $v !== null && $v !== false) {
if ($k === 'Expires') {
$str .= 'Expires=' . gmdate('D, d M Y H:i:s \G\M\T', $v) . '; ';
} else {
$str .= ($v === true ? $k : "{$k}={$v}") . '; ';
}
}
}
return rtrim($str, '; ');
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function beforeFilter()
{
parent::beforeFilter();
$this->Security->unlockedActions = array_merge($this->Security->unlockedActions, array('setHomePage'));
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
function PMA_getUrlParams(
$what, $reload, $action, $db, $table, $selected, $views,
$original_sql_query, $original_url_query
) {
$_url_params = array(
'query_type' => $what,
'reload' => (! empty($reload) ? 1 : 0),
);
if (mb_strpos(' ' . $action, 'db_') == 1) {
$_url_params['db']= $db;
} elseif (mb_strpos(' ' . $action, 'tbl_') == 1
|| $what == 'row_delete'
) {
$_url_params['db']= $db;
$_url_params['table']= $table;
}
foreach ($selected as $sval) {
if ($what == 'row_delete') {
$_url_params['selected'][] = 'DELETE FROM '
. PMA\libraries\Util::backquote($table)
. ' WHERE ' . $sval . ' LIMIT 1;';
} else {
$_url_params['selected'][] = $sval;
}
}
if ($what == 'drop_tbl' && !empty($views)) {
foreach ($views as $current) {
$_url_params['views'][] = $current;
}
}
if ($what == 'row_delete') {
$_url_params['original_sql_query'] = $original_sql_query;
if (! empty($original_url_query)) {
$_url_params['original_url_query'] = $original_url_query;
}
}
return $_url_params;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
private function _pStart() {
$par = new HTMLPurifier_Token_Start('p');
$par->armor['MakeWellFormed_TagClosedError'] = true;
return $par;
} | 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 |
$src = substr($ref->source, strlen($prefix)) . $section->id;
if (call_user_func(array($ref->module, 'hasContent'))) {
$oloc = expCore::makeLocation($ref->module, $ref->source);
$nloc = expCore::makeLocation($ref->module, $src);
if ($ref->module != "container") {
call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc);
} else {
call_user_func(array($ref->module, 'copyContent'), $oloc, $nloc, $section->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 |
$newret = recyclebin::restoreFromRecycleBin($iLoc, $page_id);
if (!empty($newret)) $ret .= $newret . '<br>';
if ($iLoc->mod == 'container') {
$ret .= scan_container($container->internal, $page_id);
}
}
return $ret;
}
| 0 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
function edit_freeform() {
$section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params);
if ($section->parent == -1) {
notfoundController::handle_not_found();
exit;
} // doesn't work for standalone pages
if (empty($section->id)) {
$section->public = 1;
if (!isset($section->parent)) {
// This is another precaution. The parent attribute
// should ALWAYS be set by the caller.
//FJD - if that's the case, then we should die.
notfoundController::handle_not_authorized();
exit;
//$section->parent = 0;
}
}
assign_to_template(array(
'section' => $section,
'glyphs' => self::get_glyphs(),
));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
$item = trim( $item );
if ( strpos( $item, '|-' ) === 0 ) {
$item = explode( '|-', $item, 2 );
if ( count( $item ) == 2 ) {
$item = $item[1];
} else {
$rowsKey[$index] = $item;
continue;
}
}
if ( strlen( $item ) > 0 ) {
$word = explode( "\n|", $item );
if ( isset( $word[0] ) && empty( $word[0] ) ) {
array_shift( $word );
}
if ( isset( $word[abs( $sortColumn ) - 1] ) ) {
$test = trim( $word[abs( $sortColumn ) - 1] );
if ( strpos( $test, '|' ) > 0 ) {
$test = trim( explode( '|', $test )[1] );
}
$rowsKey[$index] = $test;
}
}
}
$this->sort($rowsKey, $sortColumn);
$newItems = [];
foreach ( $rowsKey as $index => $val ) {
$newItems[] = $items[$index];
}
$items = $newItems;
}
return $this->listStart . $this->implodeItems( $items ) . $this->listEnd;
} | 0 | PHP | CWE-400 | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | vulnerable |
public function clean($html) {
$xssClean = new XSSClean();
$html = $xssClean->clean($html);
$config = \HTMLPurifier_Config::createDefault();
if ($this->purifierPath) {
$config->set('Cache.SerializerPath', $this->purifierPath);
}
if ($this->purifierPath) {
$config->set('Cache.SerializerPath', $this->purifierPath);
}
$config->set('URI.DisableExternal', true);
$config->set('URI.DisableExternalResources', true);
// $config->set('URI.DisableResources', true);
$config->set('URI.Host', site_hostname());
$purifier = new \HTMLPurifier($config);
$html = $purifier->purify($html);
return $html;
} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
static function description() {
return "Manage events and schedules, and optionally publish them.";
} | 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 XMLRPCgetUserGroups($groupType=0, $affiliationid=0) {
global $user;
$groups = getUserGroups($groupType, $affiliationid);
// Filter out any groups to which the user does not have access.
$usergroups = array();
foreach($groups as $id => $group){
if($group['ownerid'] == $user['id'] ||
(array_key_exists("editgroupid", $group) &&
array_key_exists($group['editgroupid'], $user["groups"])) ||
(array_key_exists($id, $user["groups"]))){
array_push($usergroups, $group);
}
}
return array(
"status" => "success",
"groups" => $usergroups);
} | 0 | PHP | CWE-264 | Permissions, Privileges, and Access Controls | Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control. | https://cwe.mitre.org/data/definitions/264.html | vulnerable |
public function extralog($user, $action = null, $description = null, $fieldsResult = null, $modifiedUser = null)
{
// new data
$model = 'User';
$modelId = $user['id'];
if (!empty($modifiedUser)) {
$modelId = $modifiedUser['User']['id'];
}
if ($action == 'login') {
$description = "User (" . $user['id'] . "): " . $user['email'];
} elseif ($action == 'logout') {
$description = "User (" . $user['id'] . "): " . $user['email'];
} elseif ($action == 'edit') {
$description = "User (" . $modifiedUser['User']['id'] . "): " . $modifiedUser['User']['email'];
} elseif ($action == 'change_pw') {
$description = "User (" . $modifiedUser['User']['id'] . "): " . $modifiedUser['User']['email'];
$fieldsResult = "Password changed.";
}
// query
$this->Log = ClassRegistry::init('Log');
$this->Log->create();
$this->Log->save(array(
'org' => $user['Organisation']['name'],
'model' => $model,
'model_id' => $modelId,
'email' => $user['email'],
'action' => $action,
'title' => $description,
'change' => isset($fieldsResult) ? $fieldsResult : ''));
// write to syslogd as well
App::import('Lib', 'SysLog.SysLog');
$syslog = new SysLog();
$syslog->write('notice', $description . ' -- ' . $action . (empty($fieldResult) ? '' : '-- ' . $fieldResult)); | 1 | PHP | CWE-269 | Improper Privilege Management | The software does not properly assign, modify, track, or check privileges for an actor, creating an unintended sphere of control for that actor. | https://cwe.mitre.org/data/definitions/269.html | safe |
function edit() {
global $user;
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
$require_login = empty($this->params['require_login']) ? SIMPLENOTE_REQUIRE_LOGIN : $this->params['require_login'];
$require_approval = empty($this->params['require_approval']) ? SIMPLENOTE_REQUIRE_APPROVAL : $this->params['require_approval'];
$require_notification = empty($this->params['require_notification']) ? SIMPLENOTE_REQUIRE_NOTIFICATION : $this->params['require_notification'];
$notification_email = empty($this->params['notification_email']) ? SIMPLENOTE_NOTIFICATION_EMAIL : $this->params['notification_email'];
if (empty($this->params['formtitle']))
{
if (empty($this->params['id']))
{
$formtitle = gt("Add New Note");
}
else
{
$formtitle = gt("Edit Note");
}
}
else
{
$formtitle = $this->params['formtitle'];
}
$id = empty($this->params['id']) ? null : $this->params['id'];
$simpleNote = new expSimpleNote($id);
//FIXME here is where we might sanitize the note before displaying/editing it
assign_to_template(array(
'simplenote'=>$simpleNote,
'user'=>$user,
'require_login'=>$require_login,
'require_approval'=>$require_approval,
'require_notification'=>$require_notification,
'notification_email'=>$notification_email,
'formtitle'=>$formtitle,
'content_type'=>$this->params['content_type'],
'content_id'=>$this->params['content_id'],
'tab'=>empty($this->params['tab'])?0:$this->params['tab']
));
} | 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 |
$event = mysqli_fetch_assoc($result);
if($queue == "active"){
$ged_command = "-drop -type $ged_type_nbr -queue $queue ";
foreach ($array_ged_packets as $key => $value) {
if($value["key"] == true){
$ged_command .= "\"".$event[$key]."\" ";
}
}
$ged_command = trim($ged_command, " ");
shell_exec($path_ged_bin." ".$ged_command);
logging("ged_update",$ged_command);
} else {
$id_list .= $id.",";
}
}
if($queue == "history"){
$id_list = trim($id_list, ",");
$ged_command = "-drop -id ".$id_list." -queue history";
shell_exec($path_ged_bin." ".$ged_command);
logging("ged_update",$ged_command);
}
} | 0 | PHP | CWE-78 | Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') | The software constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/78.html | vulnerable |
public function actionGetItems($term){
X2LinkableBehavior::getItems ($term);
} | 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 ($data['alertred'] as $alert) {
# code...
echo "<li>$alert</li>\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 |
$parser->getOutput()->mTemplates[$nsp] = array_diff_assoc( $parser->getOutput()->mTemplates[$nsp], self::$createdLinks[1][$nsp] );
// echo ("<pre> elim: parser Tpls [$nsp] nachher = ". count($parser->getOutput()->mTemplates[$nsp]) ."</pre>\n");
if ( count( $parser->getOutput()->mTemplates[$nsp] ) == 0 ) {
unset( $parser->getOutput()->mTemplates[$nsp] );
}
}
} | 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 ($rolePermissions as $rolePermission => $value) {
// Strip the '*' off the start of the permission.
$checkPermission = substr($permission, 1);
// We will make sure that the merged permission does not
// exactly match our permission, but ends with it.
if ($checkPermission != $rolePermission && ends_with($rolePermission, $checkPermission) && $value == 1) {
$matched = true;
break;
}
} | 0 | PHP | NVD-CWE-Other | Other | NVD is only using a subset of CWE for mapping instead of the entire CWE, and the weakness type is not covered by that subset. | https://nvd.nist.gov/vuln/categories | vulnerable |
private function addServiceInstance($id, Definition $definition, $isSimpleInstance)
{
$class = $this->dumpValue($definition->getClass());
if (0 === strpos($class, "'") && false === strpos($class, '$') && !preg_match('/^\'(?:\\\{2})?[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*(?:\\\{2}[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*)*\'$/', $class)) {
throw new InvalidArgumentException(sprintf('"%s" is not a valid class name for the "%s" service.', $class, $id));
}
$isProxyCandidate = $this->getProxyDumper()->isProxyCandidate($definition);
$instantiation = '';
if (!$isProxyCandidate && $definition->isShared()) {
$instantiation = "\$this->services['$id'] = ".($isSimpleInstance ? '' : '$instance');
} elseif (!$isSimpleInstance) { | 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 handleRequest() {
/* Load error handling class */
$this->loadErrorHandler();
$this->modx->invokeEvent('OnHandleRequest');
/* save page to manager object. allow custom actionVar choice for extending classes. */
$this->action = isset($_REQUEST[$this->actionVar]) ? $_REQUEST[$this->actionVar] : $this->defaultAction;
/* invoke OnManagerPageInit event */
$this->modx->invokeEvent('OnManagerPageInit',array('action' => $this->action));
$this->prepareResponse();
} | 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 |
private function resize($src, $srcImgInfo, $maxWidth, $maxHeight, $quality, $preserveExif) {
$zoom = min(($maxWidth/$srcImgInfo[0]),($maxHeight/$srcImgInfo[1]));
$width = round($srcImgInfo[0] * $zoom);
$height = round($srcImgInfo[1] * $zoom);
if (class_exists('Imagick', false)) {
return $this->resize_imagick($src, $width, $height, $quality, $preserveExif);
} else {
return $this->resize_gd($src, $width, $height, $quality, $srcImgInfo);
}
} | 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 getCategory()
{
$category = $this->categoryModel->getById($this->request->getIntegerParam('category_id'));
if (empty($category)) {
throw new PageNotFoundException();
}
return $category;
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
public function approve_toggle() {
if (empty($this->params['id'])) return;
/* The global constants can be overriden by passing appropriate params */
//sure wish I could do this once in the constructor. sadly $this->params[] isn't set yet
// $require_login = empty($this->params['require_login']) ? COMMENTS_REQUIRE_LOGIN : $this->params['require_login'];
// $require_approval = empty($this->params['require_approval']) ? COMMENTS_REQUIRE_APPROVAL : $this->params['require_approval'];
// $require_notification = empty($this->params['require_notification']) ? COMMENTS_REQUIRE_NOTIFICATION : $this->params['require_notification'];
// $notification_email = empty($this->params['notification_email']) ? COMMENTS_NOTIFICATION_EMAIL : $this->params['notification_email'];
$comment = new expComment($this->params['id']);
$comment->approved = $comment->approved == 1 ? 0 : 1;
if ($comment->approved) {
$this->sendApprovalNotification($comment,$this->params);
}
$comment->save();
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 |
$this->inSelect(array(
'name' => 'select',
'type' => HTML5::ENDTAG
));
/* An end tag whose tag name is one of: "caption", "table", "tbody",
"tfoot", "thead", "tr", "td", "th" */
} elseif(in_array($token['name'], array('caption', 'table', 'tbody', | 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 Disconnect () {
$this->sendString('QUIT');
fclose($this->pop_conn);
} | 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 configure() {
$this->config['defaultbanner'] = array();
if (!empty($this->config['defaultbanner_id'])) {
$this->config['defaultbanner'][] = new expFile($this->config['defaultbanner_id']);
}
parent::configure();
$banners = $this->banner->find('all', null, 'companies_id');
assign_to_template(array(
'banners'=>$banners,
'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 |
function setup()
{
$this -> catch_globals();
$this -> version['prior'] = '01';
$this -> version['minor'] = '06';
$this -> version['fix'] = '02';
$this -> version_text = $this -> version['prior'];
$this -> version_text .= '.';
$this -> version_text .= $this -> version['minor'];
$this -> version_text .= '.';
$this -> version_text .= $this -> version['fix'];
//manipulate some actions if user chose updat
if ($this -> globals['mode'] == 'update') {
//seperate update finish screen
if ($this -> globals['action'] == 'enter_email') $this -> globals['action'] = 'screen_execute_update_and_finish';
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function edit_internalalias() {
$section = isset($this->params['id']) ? $this->section->find($this->params['id']) : new section($this->params);
if ($section->parent == -1) {
notfoundController::handle_not_found();
exit;
} // doesn't work for standalone pages
if (empty($section->id)) {
$section->public = 1;
if (!isset($section->parent)) {
// This is another precaution. The parent attribute
// should ALWAYS be set by the caller.
//FJD - if that's the case, then we should die.
notfoundController::handle_not_authorized();
exit;
//$section->parent = 0;
}
}
assign_to_template(array(
'section' => $section,
'glyphs' => self::get_glyphs(),
));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
function isError()
{
return (is_object($this->error));
} | 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() {
}
| 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 setContainer($container)
{
$this->container = $container;
$container->setType(Container::TYPE_LINKS);
} | 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 MAX_adRenderImageBeacon($logUrl, $beaconId = 'beacon', $userAgent = null)
{
if (!isset($userAgent) && isset($_SERVER['HTTP_USER_AGENT'])) {
$userAgent = $_SERVER['HTTP_USER_AGENT'];
}
$beaconId .= '_{random}';
// Add beacon image for logging
if (isset($userAgent) && preg_match("#Mozilla/(1|2|3|4)#", $userAgent)
&& !preg_match("#compatible#", $userAgent)) {
$div = "<layer id='{$beaconId}' width='0' height='0' border='0' visibility='hide'>";
$style = '';
$divEnd = '</layer>';
} else {
$div = "<div id='{$beaconId}' style='position: absolute; left: 0px; top: 0px; visibility: hidden;'>";
$style = " style='width: 0px; height: 0px;'";
$divEnd = '</div>';
}
$beacon = "$div<img src='".htmlspecialchars($logUrl)."' width='0' height='0' alt=''{$style} />{$divEnd}";
return $beacon;
} | 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 |
$section = new section(intval($page));
if ($section) {
// self::deleteLevel($section->id);
$section->delete();
}
}
} | 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(array $attributes = null)
{
$rootDir = realpath(__DIR__ . "/../");
$this->setChroot(array($rootDir));
$this->setRootDir($rootDir);
$this->setTempDir(sys_get_temp_dir());
$this->setFontDir($rootDir . "/lib/fonts");
$this->setFontCache($this->getFontDir());
$ver = "";
$versionFile = realpath(__DIR__ . "/../VERSION");
if (file_exists($versionFile) && ($version = trim(file_get_contents($versionFile))) !== false && $version !== '$Format:<%h>$') {
$ver = "/$version";
}
$this->setHttpContext([
"http" => [
"follow_location" => false,
"user_agent" => "Dompdf$ver https://github.com/dompdf/dompdf"
]
]);
if (null !== $attributes) {
$this->set($attributes);
}
} | 0 | PHP | CWE-73 | External Control of File Name or Path | The software allows user input to control or influence paths or file names that are used in filesystem operations. | https://cwe.mitre.org/data/definitions/73.html | vulnerable |
function build_daterange_sql($timestamp, $endtimestamp=null, $field='date', $multiday=false) {
if (empty($endtimestamp)) {
$date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($timestamp) . ")";
} else {
$date_sql = "((".$field." >= " . expDateTime::startOfDayTimestamp($timestamp) . " AND ".$field." <= " . expDateTime::endOfDayTimestamp($endtimestamp) . ")";
}
if ($multiday)
$date_sql .= " OR (" . expDateTime::startOfDayTimestamp($timestamp) . " BETWEEN ".$field." AND dateFinished)";
$date_sql .= ")";
return $date_sql;
}
| 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_sitemap() {
global $db, $user, $sectionObj, $sections;
expHistory::set('viewable', $this->params);
$id = $sectionObj->id;
$current = null;
// all we need to do is determine the current section
$navsections = $sections;
if ($sectionObj->parent == -1) {
$current = $sectionObj;
} else {
foreach ($navsections as $section) {
if ($section->id == $id) {
$current = $section;
break;
}
}
}
assign_to_template(array(
'sasections' => $db->selectObjects('section', 'parent=-1'),
'sections' => $navsections,
'current' => $current,
'canManage' => ((isset($user->is_acting_admin) && $user->is_acting_admin == 1) ? 1 : 0),
));
} | 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 parseAndTrimImport($str, $isHTML = false) { //�Death from above�? �
//echo "1<br>"; eDebug($str);
// global $db;
$str = str_replace("�", "’", $str);
$str = str_replace("�", "‘", $str);
$str = str_replace("�", "®", $str);
$str = str_replace("�", "-", $str);
$str = str_replace("�", "—", $str);
$str = str_replace("�", "”", $str);
$str = str_replace("�", "“", $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('"', """, $str);
}
$str = str_replace("�", "¼", $str);
$str = str_replace("�", "½", $str);
$str = str_replace("�", "¾", $str);
//$str = htmlspecialchars($str);
//$str = utf8_encode($str);
// if (DB_ENGINE=='mysqli') {
// $str = @mysqli_real_escape_string($db->connection,trim(str_replace("�", "™", $str)));
// } elseif(DB_ENGINE=='mysql') {
// $str = @mysql_real_escape_string(trim(str_replace("�", "™", $str)),$db->connection);
// } else {
// $str = trim(str_replace("�", "™", $str));
// }
$str = @expString::escape(trim(str_replace("�", "™", $str)));
//echo "2<br>"; eDebug($str,die);
return $str;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function delete_bp($bp,$bdd){
$sql = "delete from bp where name = '" . $bp . "'";
$bdd->exec($sql);
$sql = "delete from bp_services where bp_name = '" . $bp . "'";
$bdd->exec($sql);
$sql = "delete from bp_links where bp_name = '" . $bp . "'";
$bdd->exec($sql);
$sql = "delete from bp_links where bp_link = '" . $bp . "'";
$bdd->exec($sql);
} | 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 |
$files[$key]->save();
}
// eDebug($files,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 withoutQueryValue(UriInterface $uri, $key)
{
$current = $uri->getQuery();
if (!$current) {
return $uri;
}
$result = [];
foreach (explode('&', $current) as $part) {
if (explode('=', $part)[0] !== $key) {
$result[] = $part;
};
}
return $uri->withQuery(implode('&', $result));
} | 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 public function onPost( $par, $out, $request ) {
global $wgUser;
if (!$request->getText('reason')) {
$out->addHTML(Html::rawElement(
'p',
[ 'class' => 'error '],
wfMessage( 'report-error-missing-reason' )->escaped()
));
} else {
$dbw = wfGetDB( DB_MASTER );
$dbw->startAtomic(__METHOD__);
$dbw->insert( 'report_reports', [
'report_revid' => (int)$par,
'report_reason' => $request->getText('reason'),
'report_user' => $wgUser->getId(),
'report_user_text' => $wgUser->getName(),
'report_timestamp' => wfTimestampNow()
], __METHOD__ );
$dbw->endAtomic(__METHOD__);
$out->addWikiMsg( 'report-success' );
$out->addWikiMsg( 'returnto', '[[' . SpecialPage::getTitleFor('Diff', $par)->getPrefixedText() . ']]' );
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 |
public function update_version() {
// get the current version
$hv = new help_version();
$current_version = $hv->find('first', 'is_current=1');
// check to see if the we have a new current version and unset the old current version.
if (!empty($this->params['is_current'])) {
// $db->sql('UPDATE '.DB_TABLE_PREFIX.'_help_version set is_current=0');
help_version::clearHelpVersion();
}
expSession::un_set('help-version');
// save the version
$id = empty($this->params['id']) ? null : $this->params['id'];
$version = new help_version();
// if we don't have a current version yet so we will force this one to be it
if (empty($current_version->id)) $this->params['is_current'] = 1;
$version->update($this->params);
// if this is a new version we need to copy over docs
if (empty($id)) {
self::copydocs($current_version->id, $version->id);
}
// let's update the search index to reflect the current help version
searchController::spider();
flash('message', gt('Saved help version').' '.$version->version);
expHistory::back();
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function startTLS()
{
if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) {
return false;
}
// Begin encrypted connection
if (!stream_socket_enable_crypto(
$this->smtp_conn,
true,
STREAM_CRYPTO_METHOD_TLS_CLIENT
)) {
return false;
}
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 |
public function setContainer($container, $type = 'ctText')
{
$this->container = $container;
$container->setType($type);
} | 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 testGroupsPages () {
$this->visitPages ($this->getPages ('^groups'));
} | 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 tearDown()
{
foreach ($this->cleanup as $file) {
if (is_scalar($file) && file_exists($file)) {
unlink($file);
}
}
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
function move_standalone() {
expSession::clearAllUsersSessionCache('navigation');
assign_to_template(array(
'parent' => $this->params['parent'],
));
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
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();
} | 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 make($string) {
return new HTMLPurifier_AttrDef_HTML_Bool($string);
} | 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 |
} elseif ($p->group == 3) {
$grp = AUTHOR;
} elseif ($p->group == 4) { | 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 cat($vars) {
switch (SMART_URL) {
case true:
# code...
$url = Site::$url."/".$vars."/".Typo::slugify(Categories::name($vars));
break;
default:
# code...
$url = Site::$url."/index.php?cat={$vars}";
break;
}
return $url;
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function handle($request, Closure $next)
{
$checkCart = cart_get_items_count();
if (!$checkCart) {
//$shop_page = get_content('single=true&content_type=page&is_shop=1');
$shop_page = app()->content_repository->getFirstShopPage();
$redir = site_url();
if ($shop_page and isset($shop_page['id'])) {
$link = content_link($shop_page['id']);
if ($link) {
$redir = $link;
}
}
return redirect($redir);
}
$requiresRegistration = get_option('shop_require_registration', 'website') == '1';
if ($requiresRegistration and is_logged() == false) {
return redirect(route('checkout.login'));
}
return $next($request);
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
function update_option_master() {
global $db;
$id = empty($this->params['id']) ? null : $this->params['id'];
$opt = new option_master($id);
$oldtitle = $opt->title;
$opt->update($this->params);
// if the title of the master changed we should update the option groups that are already using it.
if ($oldtitle != $opt->title) {
}$db->sql('UPDATE '.$db->prefix.'option SET title="'.$opt->title.'" WHERE option_master_id='.$opt->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 __construct($inline, $block) {
$this->inline = new HTMLPurifier_ChildDef_Optional($inline);
$this->block = new HTMLPurifier_ChildDef_Optional($block);
$this->elements = $this->block->elements;
} | 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 select_atversion(){
global $sort_versions;
$menu = '<form action="'.$_SERVER['PHP_SELF'].'" method="post">';
$menu.= '<select name="atversions">';
$menu.= '<option value="0">'._AT("all").'</option>';
foreach($sort_versions as $version){
if($version == VERSION){
$menu .= '<option value="'.$version.'" selected="selected">'.$version.'</option>';
}else{
$menu .= '<option value="'.$version.'" >'.$version.'</option>';
}
}
$menu .='</select>';
$menu .='<input type="submit" value="'. _AT('filter').'"/></form>';
return $menu;
} | 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 save()
{
$project = $this->getProject();
$values = $this->request->getValues();
list($valid, $errors) = $this->categoryValidator->validateCreation($values);
if ($valid) {
if ($this->categoryModel->create($values) !== false) {
$this->flash->success(t('Your category have been created successfully.'));
$this->response->redirect($this->helper->url->to('CategoryController', 'index', array('project_id' => $project['id'])), true);
return;
} else {
$errors = array('name' => array(t('Another category with the same name exists in this project')));
}
}
$this->create($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 testGetFormatWithCustomMimeType()
{
$request = new Request();
$request->setFormat('custom', 'application/vnd.foo.api;myversion=2.3');
$this->assertEquals('custom', $request->getFormat('application/vnd.foo.api;myversion=2.3'));
} | 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 validateInputSource($fields)
{
if (!empty($this->data['Feed']['input_source'])) {
$localAllowed = empty(Configure::read('Security.disable_local_feed_access'));
$validOptions = array('network');
if ($localAllowed) {
$validOptions[] = 'local';
}
if (!in_array($this->data['Feed']['input_source'], $validOptions)) {
return __(
'Invalid input source. The only valid options are %s. %s',
implode(', ', $validOptions),
(!$localAllowed && $this->data['Feed']['input_source'] === 'local') ?
__('Security.disable_local_feed_access is currently enabled, local feeds are thereby not allowed.') :
''
);
}
}
return true;
} | 1 | PHP | NVD-CWE-noinfo | null | null | null | safe |
public function getPath()
{
return $this->path == null ? '' : $this->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 |
public function cleanup($config) {
if (!$this->_prepareDir($config)) return false;
$dir = $this->generateDirectoryPath($config);
$dh = opendir($dir);
while (false !== ($filename = readdir($dh))) {
if (empty($filename)) continue;
if ($filename[0] === '.') continue;
$key = substr($filename, 0, strlen($filename) - 4);
if ($this->isOld($key, $config)) unlink($dir . '/' . $filename);
}
} | 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 |
$date->delete(); // event automatically deleted if all assoc eventdates are deleted
}
expHistory::back();
}
| 0 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
function wp_read_video_metadata( $file ) {
if ( ! file_exists( $file ) ) {
return false;
}
$metadata = array();
if ( ! defined( 'GETID3_TEMP_DIR' ) ) {
define( 'GETID3_TEMP_DIR', get_temp_dir() );
}
if ( ! class_exists( 'getID3', false ) ) {
require( ABSPATH . WPINC . '/ID3/getid3.php' );
}
$id3 = new getID3();
$data = $id3->analyze( $file );
if ( isset( $data['video']['lossless'] ) )
$metadata['lossless'] = $data['video']['lossless'];
if ( ! empty( $data['video']['bitrate'] ) )
$metadata['bitrate'] = (int) $data['video']['bitrate'];
if ( ! empty( $data['video']['bitrate_mode'] ) )
$metadata['bitrate_mode'] = $data['video']['bitrate_mode'];
if ( ! empty( $data['filesize'] ) )
$metadata['filesize'] = (int) $data['filesize'];
if ( ! empty( $data['mime_type'] ) )
$metadata['mime_type'] = $data['mime_type'];
if ( ! empty( $data['playtime_seconds'] ) )
$metadata['length'] = (int) round( $data['playtime_seconds'] );
if ( ! empty( $data['playtime_string'] ) )
$metadata['length_formatted'] = $data['playtime_string'];
if ( ! empty( $data['video']['resolution_x'] ) )
$metadata['width'] = (int) $data['video']['resolution_x'];
if ( ! empty( $data['video']['resolution_y'] ) )
$metadata['height'] = (int) $data['video']['resolution_y'];
if ( ! empty( $data['fileformat'] ) )
$metadata['fileformat'] = $data['fileformat'];
if ( ! empty( $data['video']['dataformat'] ) )
$metadata['dataformat'] = $data['video']['dataformat'];
if ( ! empty( $data['video']['encoder'] ) )
$metadata['encoder'] = $data['video']['encoder'];
if ( ! empty( $data['video']['codec'] ) )
$metadata['codec'] = $data['video']['codec'];
if ( ! empty( $data['audio'] ) ) {
unset( $data['audio']['streams'] );
$metadata['audio'] = $data['audio'];
}
wp_add_id3_tag_data( $metadata, $data );
$metadata = wp_kses_post_deep( $metadata );
return $metadata;
} | 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 getResourceGroupID($groupdname) {
list($type, $name) = explode('/', $groupdname);
$query = "SELECT g.id "
. "FROM resourcegroup g, "
. "resourcetype t "
. "WHERE g.name = '$name' AND "
. "t.name = '$type' AND "
. "g.resourcetypeid = t.id";
$qh = doQuery($query, 371);
if($row = mysql_fetch_row($qh))
return $row[0];
else
return NULL;
} | 0 | PHP | CWE-264 | Permissions, Privileges, and Access Controls | Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control. | https://cwe.mitre.org/data/definitions/264.html | vulnerable |
function get_is_file($dir, $item)
{
$filename = get_abs_item($dir, $item);
return @is_file($filename);
} | 1 | 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 | safe |
foreach ($allusers as $uid) {
$u = user::getUserById($uid);
expPermissions::grant($u, 'manage', $sloc);
} | 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 |
static function author() {
return "Dave Leffler";
}
| 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 actionGetItems(){
$sql = 'SELECT id, name as value, subject FROM x2_bug_reports WHERE name LIKE :qterm ORDER BY name ASC';
$command = Yii::app()->db->createCommand($sql);
$qterm = $_GET['term'].'%';
$command->bindParam(":qterm", $qterm, PDO::PARAM_STR);
$result = $command->queryAll();
echo CJSON::encode($result); exit;
} | 0 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | vulnerable |
protected function _copy($source, $targetDir, $name)
{
$res = false;
$target = $this->_joinPath($targetDir, $name);
if ($this->tmp) {
$local = $this->getTempFile();
if ($this->connect->get($source, $local)
&& $this->connect->put($target, $local, NET_SFTP_LOCAL_FILE)) {
$res = true;
}
unlink($local);
} else {
//not memory efficient
$res = $this->_filePutContents($target, $this->_getContents($source));
}
return $res;
} | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.