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 |
---|---|---|---|---|---|---|---|
function preview()
{
if ($this->params['id'] == 0) { // we want the default editor
$demo = new stdClass();
$demo->id = 0;
$demo->name = "Default";
if ($this->params['editor'] == 'ckeditor') {
$demo->skin = 'kama';
} elseif ($this->params['editor'] == 'tinymce') {
$demo->skin = 'lightgray';
}
} else {
$demo = self::getEditorSettings($this->params['id'], expString::escape($this->params['editor']));
}
assign_to_template(
array(
'demo' => $demo,
'editor' => $this->params['editor']
)
);
} | 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 insertObject($object, $table) {
//if ($table=="text") eDebug($object,true);
$sql = "INSERT INTO `" . $this->prefix . "$table` (";
$values = ") VALUES (";
foreach (get_object_vars($object) as $var => $val) {
//We do not want to save any fields that start with an '_'
if ($var{0} != '_') {
$sql .= "`$var`,";
if ($values != ") VALUES (") {
$values .= ",";
}
$values .= "'" . $this->escapeString($val) . "'";
}
}
$sql = substr($sql, 0, -1) . substr($values, 0) . ")";
//if($table=='text')eDebug($sql,true);
if (@mysqli_query($this->connection, $sql) != false) {
$id = mysqli_insert_id($this->connection);
return $id;
} else
return 0;
} | 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 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()
));
} | 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 |
$prepared = $eml->prepareBody();
}
if (!$prepared) { // InlineEmail failed validation
$errors = $eml->getErrors ();
return array (false, array_shift ($errors));
}
list ($success, $message) = $this->checkDoNotEmailFields ($eml);
if (!$success) {
return array ($success, $message);
}
$result = $eml->send($historyFlag);
if (isset($result['code']) && $result['code'] == 200) {
if (YII_UNIT_TESTING) {
return array(true, $eml->message);
} else {
return array(true, "");
}
} else {
return array (false, Yii::t('app', "Email could not be sent"));
}
} | 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()
{
$project = $this->getProject();
$this->checkCSRFParam();
$column_id = $this->request->getIntegerParam('column_id');
if ($this->columnModel->remove($column_id)) {
$this->flash->success(t('Column removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this column.'));
}
$this->response->redirect($this->helper->url->to('ColumnController', 'index', array('project_id' => $project['id'])));
} | 0 | PHP | CWE-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 confirm() {
global $db;
// 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
$id = $db->selectValue('subscribers','id', 'id='.$this->params['id'].' AND hash="'.$this->params['key'].'"');
if (empty($id)) expQueue::flashAndFlow('error', gt('We could not find any subscriptions matching the ID and Key you provided.'));
// activate this users pending subscriptions
$sub = new stdClass();
$sub->enabled = 1;
$db->updateObject($sub, 'expeAlerts_subscribers', 'subscribers_id='.$id);
// find the users active subscriptions
$ealerts = expeAlerts::getBySubscriber($id);
assign_to_template(array(
'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 |
function delete_option_master() {
global $db;
$masteroption = new option_master($this->params['id']);
// delete any implementations of this option master
$db->delete('option', 'option_master_id='.$masteroption->id);
$masteroption->delete('optiongroup_master_id=' . $masteroption->optiongroup_master_id);
//eDebug($masteroption);
expHistory::back();
} | 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 ($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;
}
}
| 0 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | vulnerable |
public static function autoload()
{
include GX_LIB.'Vendor/autoload.php';
} | 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 |
$input = ['name' => 'ldap', 'rootdn_passwd' => $password]; | 0 | PHP | CWE-327 | Use of a Broken or Risky Cryptographic Algorithm | The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information. | https://cwe.mitre.org/data/definitions/327.html | vulnerable |
public function testUserCredentials($email, $password, $server, $port, $security) {
require_once(realpath(Yii::app()->basePath.'/components/phpMailer/class.phpmailer.php'));
require_once(realpath(Yii::app()->basePath.'/components/phpMailer/class.smtp.php'));
$phpMail = new PHPMailer(true);
$phpMail->isSMTP();
$phpMail->SMTPAuth = true;
$phpMail->Username = $email;
$phpMail->Password = $password;
$phpMail->Host = $server;
$phpMail->Port = $port;
$phpMail->SMTPSecure = $security;
try {
$validCredentials = $phpMail->SmtpConnect();
} catch(phpmailerException $error) {
$validCredentials = false;
}
return $validCredentials;
} | 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 |
$this->path = $segments_encoder->encode($this->path);
} else {
// path-noscheme (relative)
// my/path
// (once again, not checking nz)
$segment_nc_encoder = new HTMLPurifier_PercentEncoder($chars_sub_delims . '@');
$c = strpos($this->path, '/');
if ($c !== false) {
$this->path =
$segment_nc_encoder->encode(substr($this->path, 0, $c)) .
$segments_encoder->encode(substr($this->path, $c));
} else {
$this->path = $segment_nc_encoder->encode($this->path);
}
}
} else { | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function saveConfig() {
if (!empty($this->params['aggregate']) || !empty($this->params['pull_rss'])) {
if ($this->params['order'] == 'rank ASC') {
expValidator::failAndReturnToForm(gt('User defined ranking is not allowed when aggregating or pull RSS data feeds.'), $this->params);
}
}
parent::saveConfig();
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function testGetDropdownValue($params, $expected, $session_params = []) {
$this->login();
$bkp_params = [];
//set session params if any
if (count($session_params)) {
foreach ($session_params as $param => $value) {
if (isset($_SESSION[$param])) {
$bkp_params[$param] = $_SESSION[$param];
}
$_SESSION[$param] = $value;
}
}
$params['_idor_token'] = \Session::getNewIDORToken($params['itemtype'] ?? '');
$result = \Dropdown::getDropdownValue($params, false);
//reset session params before executing test
if (count($session_params)) {
foreach ($session_params as $param => $value) {
if (isset($bkp_params[$param])) {
$_SESSION[$param] = $bkp_params[$param];
} else {
unset($_SESSION[$param]);
}
}
}
$this->array($result)->isIdenticalTo($expected);
} | 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 __viewIndex()
{
$this->setPageType('table');
$this->setTitle(__('%1$s – %2$s', array(__('Pages'), __('Symphony'))));
$nesting = Symphony::Configuration()->get('pages_table_nest_children', 'symphony') == 'yes';
if ($nesting && isset($_GET['parent']) && is_numeric($_GET['parent'])) {
$parent = PageManager::fetchPageByID((int)$_GET['parent'], array('title', 'id'));
}
$this->appendSubheading(isset($parent) ? $parent['title'] : __('Pages'), Widget::Anchor(
__('Create New'), Administration::instance()->getCurrentPageURL() . 'new/' . ($nesting && isset($parent) ? "?parent={$parent['id']}" : null),
__('Create a new page'), 'create button', null, array('accesskey' => 'c')
)); | 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 characters($char_class, $start) {
return preg_replace('#^(['.$char_class.']+).*#s', '\\1', substr($this->data, $start));
} | 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 _joinPath($dir, $name) {
$sql = 'SELECT id FROM '.$this->tbf.' WHERE parent_id="'.$dir.'" AND name="'.$this->db->real_escape_string($name).'"';
if (($res = $this->query($sql)) && ($r = $res->fetch_assoc())) {
$this->updateCache($r['id'], $this->_stat($r['id']));
return $r['id'];
}
return -1;
} | 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 validateChildren($tokens_of_children, $config, $context) {
$result = parent::validateChildren($tokens_of_children, $config, $context);
// we assume that $tokens_of_children is not modified
if ($result === false) {
if (empty($tokens_of_children)) return true;
elseif ($this->whitespace) return $tokens_of_children;
else return array();
}
return $result;
} | 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 assertAlnum() {
$this->assertIsString();
if (!ctype_alnum($this->contents)) $this->error('must be alphanumeric');
return $this;
} | 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();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
if ($tag['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
if ($this->tagModel->remove($tag_id)) {
$this->flash->success(t('Tag removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this tag.'));
}
$this->response->redirect($this->helper->url->to('ProjectTagController', 'index', array('project_id' => $project['id'])));
} | 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 |
protected function backward(&$i, &$current) {
if ($i === null) $i = $this->inputIndex - 1;
else $i--;
if ($i < 0) return false;
$current = $this->inputTokens[$i];
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 |
foreach ($grpusers as $u) {
$emails[$u->email] = trim(user::getUserAttribution($u->id));
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function safePath($filename = 'data.csv'){
return implode(DIRECTORY_SEPARATOR, array(
Yii::app()->basePath,
'data',
$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 |
function singleQuoteReplace($param1 = false, $param2 = false, $param3)
{
return str_replace("'", "''", str_replace("\'", "'", $param3));
} | 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 login() {
user::login(expString::escape(expString::sanitize($_POST['username'])),expString::escape(expString::sanitize($_POST['password'])));
if (!isset($_SESSION[SYS_SESSION_KEY]['user'])) { // didn't successfully log in
flash('error', gt('Invalid Username / Password'));
if (expSession::is_set('redirecturl_error')) {
$url = expSession::get('redirecturl_error');
expSession::un_set('redirecturl_error');
header("Location: ".$url);
} else {
expHistory::back();
}
} else { // we're logged in
global $user;
if (expSession::get('customer-login')) expSession::un_set('customer-login');
if (!empty($_POST['username'])) flash('message', gt('Welcome back').' '.expString::sanitize($_POST['username']));
if ($user->isAdmin()) {
expHistory::back();
} else {
foreach ($user->groups as $g) {
if (!empty($g->redirect)) {
$url = URL_FULL.$g->redirect;
break;
}
}
if (isset($url)) {
header("Location: ".$url);
} else {
expHistory::back();
}
}
}
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
public function setContainer($container)
{
$this->container = $container;
$container->setType('ctArticles');
} | 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 getPLaying() {
$url = "http://api.themoviedb.org/3/movie/now_playing?api_key=".$this->apikey;
$now_playing = $this->curl($url);
return $now_playing;
}
| 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 search_by_model() {
global $db, $user;
$sql = "select DISTINCT(p.id) as id, p.title, model from " . $db->prefix . "product as p WHERE ";
if (!($user->isAdmin())) $sql .= '(p.active_type=0 OR p.active_type=1) AND ';
//if first character of search is a -, then we do a wild card, else from beginning
$this->params['query'] = expString::escape($this->params['query']);
if ($this->params['query'][0] == '-') {
$sql .= " p.model LIKE '%" . $this->params['query'];
} else {
$sql .= " p.model LIKE '" . $this->params['query'];
}
$sql .= "%' AND p.parent_id=0 GROUP BY p.id ";
$sql .= "order by p.model ASC LIMIT 30";
$res = $db->selectObjectsBySql($sql);
//eDebug($sql);
$ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res);
$ar->send();
} | 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 |
$navs[$i]->link = expCore::makeLink(array('section' => $navs[$i]->id), '', $navs[$i]->sef_name);
if (!$view) {
// unset($navs[$i]); //FIXME this breaks jstree if we remove a parent and not the child
$attr = new stdClass();
$attr->class = 'hidden'; // bs3 class to hide elements
$navs[$i]->li_attr = $attr;
}
}
| 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 getMailingVoucher($id)
{
trigger_error(sprintf('%s:%s is deprecated since Shopware 5.6 and will be private with 5.8.', __CLASS__, __METHOD__), E_USER_DEPRECATED);
$sql = 'SELECT value FROM s_campaigns_containers WHERE type=? AND promotionID=?';
$voucherID = Shopware()->Db()->fetchOne($sql, ['ctVoucher', $id]);
if (empty($voucherID)) {
return false;
}
$sql = "
SELECT ev.*, 'VOUCHER123' as code
FROM s_emarketing_vouchers ev
WHERE ev.modus = 1 AND (ev.valid_to >= CURDATE() OR ev.valid_to IS NULL)
AND (ev.valid_from <= CURDATE() OR ev.valid_from IS NULL)
AND ev.id=?
";
return Shopware()->Db()->fetchRow($sql, [$voucherID]);
} | 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 handleText(&$token) {} | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
$this->where = array_merge( $this->where, $where );
} else {
throw new \MWException( __METHOD__ . ': An invalid where clause was passed.' );
return false;
}
return true;
} | 0 | PHP | CWE-400 | Uncontrolled Resource Consumption | The software does not properly control the allocation and maintenance of a limited resource, thereby enabling an actor to influence the amount of resources consumed, eventually leading to the exhaustion of available resources. | https://cwe.mitre.org/data/definitions/400.html | vulnerable |
$item = array();
$item['id'] = $incident->id;
$item['title'] = $incident->incident_title;
$item['link'] = $site_url.'reports/view/'.$incident->id;
$item['description'] = $incident->incident_description;
$item['date'] = $incident->incident_date;
$item['categories'] = $categories;
if
(
$incident->location_id != 0 AND
$incident->location->longitude AND
$incident->location->latitude
)
{
$item['point'] = array(
$incident->location->latitude,
$incident->location->longitude
);
$items[] = $item;
}
}
$cache->set($subdomain.'_feed_'.$limit.'_'.$page, $items, array('feed'), 3600); // 1 Hour
$feed_items = $items;
}
$feedpath = $feedtype == 'atom' ? 'feed/atom/' : 'feed/';
//header("Content-Type: text/xml; charset=utf-8");
$view = new View('feed/'.$feedtype);
$view->feed_title = htmlspecialchars(Kohana::config('settings.site_name'));
$view->site_url = $site_url;
$view->georss = 1; // this adds georss namespace in the feed
$view->feed_url = $site_url.$feedpath;
$view->feed_date = gmdate("D, d M Y H:i:s T", time());
$view->feed_description = htmlspecialchars(Kohana::lang('ui_admin.incident_feed').' '.Kohana::config('settings.site_name'));
$view->items = $feed_items;
$view->render(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 update() {
//populate the alt tag field if the user didn't
if (empty($this->params['alt'])) $this->params['alt'] = $this->params['title'];
// call expController update to save the image
parent::update();
} | 1 | PHP | CWE-74 | Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') | The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/74.html | safe |
public function visitTextNode(\JBBCode\TextNode $textNode)
{
// Nothing to do here, text nodes do not have tag names or children
} | 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 searchNew() {
global $db, $user;
$this->params['query'] = expString::escape($this->params['query']);
//$this->params['query'] = str_ireplace('-','\-',$this->params['query']);
$sql = "select DISTINCT(p.id) as id, p.title, model, sef_url, f.id as fileid, ";
$sql .= "match (p.title,p.model,p.body) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) as relevance, ";
$sql .= "CASE when p.model like '" . $this->params['query'] . "%' then 1 else 0 END as modelmatch, ";
$sql .= "CASE when p.title like '%" . $this->params['query'] . "%' then 1 else 0 END as titlematch ";
$sql .= "from " . $db->prefix . "product as p INNER JOIN " .
$db->prefix . "content_expFiles as cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' INNER JOIN " . $db->prefix .
"expFiles as f ON cef.expFiles_id = f.id WHERE ";
if (!$user->isAdmin()) $sql .= '(p.active_type=0 OR p.active_type=1) AND ';
$sql .= " match (p.title,p.model,p.body) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) AND p.parent_id=0 ";
$sql .= " HAVING relevance > 0 ";
//$sql .= "GROUP BY p.id ";
$sql .= "order by modelmatch,titlematch,relevance desc LIMIT 10";
eDebug($sql);
$res = $db->selectObjectsBySql($sql);
eDebug($res, true);
$ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res);
$ar->send();
} | 1 | PHP | CWE-20 | Improper Input Validation | The product receives input or data, but it does
not validate or incorrectly validates that the input has the
properties that are required to process the data safely and
correctly. | https://cwe.mitre.org/data/definitions/20.html | safe |
public static function get($vars)
{
$op = Db::result("SELECT `value` FROM `options` WHERE `name` = '{$vars}' LIMIT 1");
if (Db::$num_rows > 0) {
return $op[0]->value;
} else {
return false;
}
} | 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 filesBySearch($text, $wid=NULL, $orderby="name ASC")
{
global $DB;
global $website;
if(empty($wid))
$wid = $website->id;
$DB->query(' SELECT * FROM nv_files
WHERE name LIKE '.protect('%'.$text.'%').'
AND website = '.$wid.'
ORDER BY '.$orderby);
return $DB->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 |
$fdat_value = htmlspecialchars(xss_clean($fdat_value));
$fdat_field = htmlspecialchars(xss_clean($fdat_field));
if($fdat_field != 'flt_keel') {?>
<input type=hidden name="<?=$fdat_field?>" value="<?=$fdat_value?>">
<? }
}?>
| 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
public function getTags($refreshCache = false) {
if ($this->_tags === null || $refreshCache) {
$this->_tags = Yii::app()->db->createCommand()
->select('tag')
->from(CActiveRecord::model('Tags')->tableName())
->where(
'type=:type AND itemId=:itemId',
array(
':type' => get_class($this->getOwner()),
':itemId' => $this->getOwner()->id))
->queryColumn();
}
return $this->_tags;
} | 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 confirm()
{
$project = $this->getProject();
$tag_id = $this->request->getIntegerParam('tag_id');
$tag = $this->tagModel->getById($tag_id);
$this->response->html($this->template->render('project_tag/remove', array(
'tag' => $tag,
'project' => $project,
)));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
private function initData() {
$this->Set('customer', 0, true, true);
$this->Set('admin', 1, true, true);
$this->Set('subject', '', true, true);
$this->Set('category', '0', true, true);
$this->Set('priority', '2', true, true);
$this->Set('message', '', true, true);
$this->Set('dt', 0, true, true);
$this->Set('lastchange', 0, true, true);
$this->Set('ip', '', true, true);
$this->Set('status', '0', true, true);
$this->Set('lastreplier', '0', true, true);
$this->Set('by', '0', true, true);
$this->Set('answerto', '0', true, true);
$this->Set('archived', '0', true, true);
} | 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 approve() {
expHistory::set('editable', $this->params);
/* 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['id'])) {
flash('error', gt('No ID supplied for note to approve'));
$lastUrl = expHistory::getLast('editable');
}
$simplenote = new expSimpleNote($this->params['id']);
assign_to_template(array(
'simplenote'=>$simplenote,
'require_login'=>$require_login,
'require_approval'=>$require_approval,
'require_notification'=>$require_notification,
'notification_email'=>$notification_email,
'tab'=>$this->params['tab']
));
} | 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->subtaskTimeTrackingModel->logEndTime($subtaskId, $this->userSession->getId());
$this->subtaskTimeTrackingModel->updateTaskTimeTracking($task['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 |
throw new \InvalidArgumentException(
'URI must be a string or Psr\Http\Message\UriInterface'
);
}
$this->method = strtoupper($method);
$this->uri = $uri;
$this->setHeaders($headers);
$this->protocol = $protocolVersion;
$host = $uri->getHost();
if ($host && !$this->hasHeader('Host')) {
$this->updateHostFromUri($host);
}
if ($body) {
$this->stream = stream_for($body);
}
} | 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 _mkdir($path, $name)
{
$path = $this->_joinPath($path, $name);
if ($this->connect->mkdir($path) === false) {
return false;
}
$this->options['dirMode'] && $this->connect->chmod($this->options['dirMode'], $path);
return $path;
} | 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 remove($config) {
$file = $this->generateFilePath($config);
if (!file_exists($file)) return false;
return unlink($file);
} | 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 onRegistration() {
if ( !defined( 'DPL_VERSION' ) ) {
define( 'DPL_VERSION', '3.3.5' );
}
} | 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 |
elseif ($permission === $rolePermission && $rolePermissions[$permission] === 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 |
} elseif ($token instanceof HTMLPurifier_Token_Empty) {
if ($this->_flashCompat && $token->name == "param" && !empty($this->_flashStack)) {
$this->_flashStack[count($this->_flashStack)-1]->param[$token->attr['name']] = $token->attr['value'];
}
$attr = $this->generateAttributes($token->attr, $token->name);
return '<' . $token->name . ($attr ? ' ' : '') . $attr . | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
function change_pass()
{
global $txp_user;
extract(psa(array('new_pass')));
if (empty($new_pass)) {
author_list(array(gTxt('password_required'), E_ERROR));
return;
}
$rs = change_user_password($txp_user, $new_pass);
if ($rs) {
// Todo: Move full stop to Textpack.
$message = gTxt('password_changed') . '.';
author_list($message);
}
} | 1 | 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 | safe |
private function __add_query($cmd)
{
unset($this->__default_filters['returnFormat']);
$body = json_encode($this->__default_filters);
$bodyFilename = $this->__generateSetupFile($body);
$bodyParam = ' --body ' . $bodyFilename;
$levelParam = ' --level ' . strtolower($this->__scope) . 's';
$setup = json_encode($this->__setup);
$setupFilename = $this->__generateSetupFile($setup);
$setupParam = ' --setup ' . $setupFilename;
$urlParam = ' --misp_url ' . $this->__url;
$cmd .= $bodyParam . $setupParam . $levelParam . $urlParam;
$results = shell_exec($cmd);
unlink($bodyFilename);
unlink($setupFilename);
return $results;
} | 0 | PHP | NVD-CWE-noinfo | null | null | null | vulnerable |
function tests($size) {
test(make_fb_serialize_struct($size));
test(make_fb_serialize_vector($size));
test(make_fb_serialize_list($size));
test(make_fb_cs_list_map($size));
test(make_fb_cs_map($size));
test(make_fb_cs_vector($size));
} | 1 | PHP | CWE-674 | Uncontrolled Recursion | The product does not properly control the amount of recursion which takes place, consuming excessive resources, such as allocated memory or the program stack. | https://cwe.mitre.org/data/definitions/674.html | safe |
public function testCustomBrandWorks()
{
$this->card->addSupportedBrand('omniexpress', '/^9\d{12}(\d{3})?$/');
$this->assertArrayHasKey('omniexpress', $this->card->getSupportedBrands());
$this->card->setNumber('9111111111111110');
$this->card->validate();
$this->assertEquals('omniexpress', $this->card->getBrand());
} | 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 logout()
{
// Initialize the current auth session before trying to remove it
if (is_null($this->user) && !$this->check()) {
return;
}
if ($this->isImpersonator()) {
$this->user = $this->getImpersonator();
$this->stopImpersonate();
return;
}
if ($this->user) {
$this->user->setRememberToken(null);
$this->user->forceSave();
}
$this->user = null;
Session::flush();
Cookie::queue(Cookie::forget($this->sessionKey));
} | 0 | PHP | CWE-613 | Insufficient Session Expiration | According to WASC, "Insufficient Session Expiration is when a web site permits an attacker to reuse old session credentials or session IDs for authorization." | https://cwe.mitre.org/data/definitions/613.html | vulnerable |
public function getBoolean($key, $default = false, $deep = false)
{
return $this->filter($key, $default, FILTER_VALIDATE_BOOLEAN, array(), $deep);
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function showall_tags() {
$images = $this->image->find('all');
$used_tags = array();
foreach ($images as $image) {
foreach($image->expTag as $tag) {
if (isset($used_tags[$tag->id])) {
$used_tags[$tag->id]->count++;
} else {
$exptag = new expTag($tag->id);
$used_tags[$tag->id] = $exptag;
$used_tags[$tag->id]->count = 1;
}
}
}
assign_to_template(array(
'tags'=>$used_tags
));
} | 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 |
$path = Helpers::isAbsolute($item) ? $item : ($this->getRepositoryPath() . DIRECTORY_SEPARATOR . $item);
if (!file_exists($path)) {
throw new GitException("The path at '$item' does not represent a valid file.");
}
$this->run('add', $item);
} | 0 | PHP | CWE-77 | Improper Neutralization of Special Elements used in a Command ('Command Injection') | The software constructs all or part of a command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/77.html | vulnerable |
public function setFlashCookieObject($name, $object, $time = 60)
{
setcookie($name, json_encode($object), time() + $time, '/');
return $this;
} | 0 | PHP | CWE-565 | Reliance on Cookies without Validation and Integrity Checking | The application relies on the existence or values of cookies when performing security-critical operations, but it does not properly ensure that the setting is valid for the associated user. | https://cwe.mitre.org/data/definitions/565.html | vulnerable |
public static function dropdown($vars){
if(is_array($vars)){
//print_r($vars);
$name = $vars['name'];
$where = "WHERE `status` = '1' AND ";
if(isset($vars['type'])) {
$where .= " `type` = '{$vars['type']}' AND ";
}else{
$where .= " ";
}
$where .= " `status` = '1' ";
$order_by = "ORDER BY ";
if(isset($vars['order_by'])) {
$order_by .= " {$vars['order_by']} ";
}else{
$order_by .= " `name` ";
}
if (isset($vars['sort'])) {
$sort = " {$vars['sort']}";
}else{
$sort = 'ASC';
}
}
$cat = Db::result("SELECT * FROM `posts` {$where} {$order_by} {$sort}");
$num = Db::$num_rows;
$drop = "<select name=\"{$name}\" class=\"form-control\"><option></option>";
if($num > 0){
foreach ($cat as $c) {
# code...
// if($c->parent == ''){
if(isset($vars['selected']) && $c->id == $vars['selected']) $sel = "SELECTED"; else $sel = "";
$drop .= "<option value=\"{$c->id}\" $sel style=\"padding-left: 10px;\">{$c->title}</option>";
// foreach ($cat as $c2) {
// # code...
// if($c2->parent == $c->id){
// if(isset($vars['selected']) && $c2->id == $vars['selected']) $sel = "SELECTED"; else $sel = "";
// $drop .= "<option value=\"{$c2->id}\" $sel style=\"padding-left: 10px;\"> {$c2->name}</option>";
// }
// }
// }
}
}
$drop .= "</select>";
return $drop;
}
| 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 getCategory(array $project)
{
$category = $this->categoryModel->getById($this->request->getIntegerParam('category_id'));
if (empty($category)) {
throw new PageNotFoundException();
}
if ($category['project_id'] != $project['id']) {
throw new AccessForbiddenException();
}
return $category;
} | 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 remove()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->remove($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane removed successfully.'));
} else {
$this->flash->failure(t('Unable to remove this swimlane.'));
}
$this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
public function createDatabase($dbname = null)
{
$stmt = Database::prepare("CREATE DATABASE :dbname");
Database::pexecute($stmt, [
'dbname' => $dbname
]);
} | 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 $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']
));
} | 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 __construct( \DPL\Parameters $parameters, \Parser $parser ) {
parent::__construct( $parameters, $parser );
$this->textSeparator = $parameters->getParameter( 'inlinetext' );
$listSeparators = $parameters->getParameter( 'listseparators' );
if ( isset( $listSeparators[0] ) ) {
$this->listStart = $listSeparators[0];
}
if ( isset( $listSeparators[1] ) ) {
$this->itemStart = $listSeparators[1];
}
if ( isset( $listSeparators[2] ) ) {
$this->itemEnd = $listSeparators[2];
}
if ( isset( $listSeparators[3] ) ) {
$this->listEnd = $listSeparators[3];
}
} | 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($module->info_tag_transform as $k => $v) {
if ($v === false) unset($this->info_tag_transform[$k]);
else $this->info_tag_transform[$k] = $v;
} | 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 _date2timestamp( $datetime, $wtz=null ) {
if( !isset( $datetime['hour'] )) $datetime['hour'] = 0;
if( !isset( $datetime['min'] )) $datetime['min'] = 0;
if( !isset( $datetime['sec'] )) $datetime['sec'] = 0;
if( empty( $wtz ) && ( !isset( $datetime['tz'] ) || empty( $datetime['tz'] )))
return mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] );
$output = $offset = 0;
if( empty( $wtz )) {
if( iCalUtilityFunctions::_isOffset( $datetime['tz'] )) {
$offset = iCalUtilityFunctions::_tz2offset( $datetime['tz'] ) * -1;
$wtz = 'UTC';
}
else
$wtz = $datetime['tz'];
}
if(( 'Z' == $wtz ) || ( 'GMT' == strtoupper( $wtz )))
$wtz = 'UTC';
try {
$strdate = sprintf( '%04d-%02d-%02d %02d:%02d:%02d', $datetime['year'], $datetime['month'], $datetime['day'], $datetime['hour'], $datetime['min'], $datetime['sec'] );
$d = new DateTime( $strdate, new DateTimeZone( $wtz ));
if( 0 != $offset ) // adjust for offset
$d->modify( $offset.' seconds' );
$output = $d->format( 'U' );
unset( $d );
}
catch( Exception $e ) {
$output = mktime( $datetime['hour'], $datetime['min'], $datetime['sec'], $datetime['month'], $datetime['day'], $datetime['year'] );
}
return $output;
} | 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 post($vars) {
switch (SMART_URL) {
case true:
# code...
$url = Options::get('siteurl')."/".self::slug($vars)."/{$vars}";
break;
default:
# code...
$url = Options::get('siteurl')."/index.php?post={$vars}";
break;
}
return $url;
} | 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 testDoesNotTouchClosureListeners()
{
$this->getServer()->flush();
$this->getServer()->enqueue(array(
"HTTP/1.1 200 OK\r\n" .
"Date: Mon, 12 Nov 2012 03:06:37 GMT\r\n" .
"Cache-Control: private, s-maxage=0, max-age=0, must-revalidate\r\n" .
"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
"Content-Length: 2\r\n\r\nhi",
"HTTP/1.0 304 Not Modified\r\n" .
"Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
"Content-Type: text/html; charset=UTF-8\r\n" .
"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
"Age: 6302\r\n\r\n",
"HTTP/1.0 304 Not Modified\r\n" .
"Date: Mon, 12 Nov 2012 03:06:38 GMT\r\n" .
"Content-Type: text/html; charset=UTF-8\r\n" .
"Last-Modified: Mon, 12 Nov 2012 02:53:38 GMT\r\n" .
"Age: 6302\r\n\r\n",
));
$client = new Client($this->getServer()->getUrl());
$client->addSubscriber(new CachePlugin());
$client->getEventDispatcher()->addListener('command.after_send', function() {});
$this->assertEquals(200, $client->get()->send()->getStatusCode());
$this->assertEquals(200, $client->get()->send()->getStatusCode());
$this->assertEquals(200, $client->get()->send()->getStatusCode());
} | 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 searchNew() {
global $db, $user;
//$this->params['query'] = str_ireplace('-','\-',$this->params['query']);
$sql = "select DISTINCT(p.id) as id, p.title, model, sef_url, f.id as fileid, ";
$sql .= "match (p.title,p.model,p.body) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) as relevance, ";
$sql .= "CASE when p.model like '" . $this->params['query'] . "%' then 1 else 0 END as modelmatch, ";
$sql .= "CASE when p.title like '%" . $this->params['query'] . "%' then 1 else 0 END as titlematch ";
$sql .= "from " . $db->prefix . "product as p INNER JOIN " .
$db->prefix . "content_expFiles as cef ON p.id=cef.content_id AND cef.content_type IN ('product','eventregistration','donation','giftcard') AND cef.subtype='mainimage' INNER JOIN " . $db->prefix .
"expFiles as f ON cef.expFiles_id = f.id WHERE ";
if (!$user->isAdmin()) $sql .= '(p.active_type=0 OR p.active_type=1) AND ';
$sql .= " match (p.title,p.model,p.body) against ('" . $this->params['query'] . "*' IN BOOLEAN MODE) AND p.parent_id=0 ";
$sql .= " HAVING relevance > 0 ";
//$sql .= "GROUP BY p.id ";
$sql .= "order by modelmatch,titlematch,relevance desc LIMIT 10";
eDebug($sql);
$res = $db->selectObjectsBySql($sql);
eDebug($res, true);
$ar = new expAjaxReply(200, gt('Here\'s the items you wanted'), $res);
$ar->send();
} | 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 displayRecoveryRequestForm($errormessage = '')
{
if (!empty($errormessage)) {
echo "<div class='errormessage' style='width: 400px;'><img class='errormessage' src='" . OX::assetPath() . "/images/errormessage.gif' align='absmiddle'>";
echo "<span class='tab-r'>{$errormessage}</span></div>";
}
echo "<form method='post' action='password-recovery.php'>\n";
echo "<input type='hidden' name='token' value='".phpAds_SessionGetToken()."'/>\n";
echo "<div class='install'>".$GLOBALS['strPwdRecEnterEmail']."</div>";
echo "<table cellpadding='0' cellspacing='0' border='0'>";
echo "<tr><td colspan='2'><img src='" . OX::assetPath() . "/images/break-el.gif' width='400' height='1' vspace='8'></td></tr>";
echo "<tr height='24'><td>".$GLOBALS['strEMail'].": </td><td><input type='text' name='email' /></td></tr>";
echo "<tr height='24'><td> </td><td><input type='submit' value='".$GLOBALS['strProceed']."' /></td></tr>";
echo "<tr><td colspan='2'><img src='" . OX::assetPath() . "/images/break-el.gif' width='400' height='1' vspace='8'></td></tr>";
echo "</table>";
echo "</form>\n";
} | 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 |
$sql = array(
'table' => 'menus',
'id' => Typo::int($k),
'key' => $v,
);
Db::update($sql);
} | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function updateTab($id, $array)
{
if (!$id || $id == '') {
$this->setAPIResponse('error', 'id was not set', 422);
return null;
}
if (!$array) {
$this->setAPIResponse('error', 'no data was sent', 422);
return null;
}
$tabInfo = $this->getTabById($id);
if ($tabInfo) {
$array = $this->checkKeys($tabInfo, $array);
} else {
$this->setAPIResponse('error', 'No tab info found', 404);
return false;
}
if (array_key_exists('name', $array)) {
$array['name'] = htmlspecialchars($array['name']);
if ($this->isTabNameTaken($array['name'], $id)) {
$this->setAPIResponse('error', 'Tab name: ' . $array['name'] . ' is already taken', 409);
return false;
}
}
if (array_key_exists('default', $array)) {
if ($array['default']) {
$this->clearTabDefault();
}
}
$response = [
array(
'function' => 'query',
'query' => array(
'UPDATE tabs SET',
$array,
'WHERE id = ?',
$id
)
),
];
$this->setAPIResponse(null, 'Tab info updated');
$this->setLoggerChannel('Tab Management');
$this->logger->debug('Edited Tab Info for [' . $tabInfo['name'] . ']');
return $this->processQueries($response);
} | 0 | PHP | CWE-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 prepareInputForAdd($input) {
//If it's the first ldap directory then set it as the default directory
if (!self::getNumberOfServers()) {
$input['is_default'] = 1;
}
if (isset($input["rootdn_passwd"]) && !empty($input["rootdn_passwd"])) {
$input["rootdn_passwd"] = Toolbox::encrypt(stripslashes($input["rootdn_passwd"]), GLPIKEY);
}
return $input;
} | 0 | PHP | CWE-327 | Use of a Broken or Risky Cryptographic Algorithm | The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information. | https://cwe.mitre.org/data/definitions/327.html | vulnerable |
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 check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
if ( -1 === $action ) {
_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
}
$adminurl = strtolower( admin_url() );
$referer = strtolower( wp_get_referer() );
$result = isset( $_REQUEST[ $query_arg ] ) ? wp_verify_nonce( $_REQUEST[ $query_arg ], $action ) : false;
/**
* Fires once the admin request has been validated or not.
*
* @since 1.5.1
*
* @param string $action The nonce action.
* @param false|int $result False if the nonce is invalid, 1 if the nonce is valid and generated between
* 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
*/
do_action( 'check_admin_referer', $action, $result );
if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) {
wp_nonce_ays( $action );
die();
}
return $result;
} | 1 | PHP | CWE-843 | Access of Resource Using Incompatible Type ('Type Confusion') | The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type. | https://cwe.mitre.org/data/definitions/843.html | safe |
$name = ucfirst($module->name);
if (in_array($name, $skipModules)) {
continue;
}
if($name != 'Document'){
$controllerName = $name.'Controller';
if(file_exists('protected/modules/'.$module->name.'/controllers/'.$controllerName.'.php')){
Yii::import("application.modules.$module->name.controllers.$controllerName");
$controller = new $controllerName($controllerName);
$model = $controller->modelClass;
if(class_exists($model)){
$moduleList[$model] = Yii::t('app', $module->title);
}
}
}
}
return $moduleList;
} | 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 enable()
{
$this->checkCSRFParam();
$project = $this->getProject();
$swimlane_id = $this->request->getIntegerParam('swimlane_id');
if ($this->swimlaneModel->enable($project['id'], $swimlane_id)) {
$this->flash->success(t('Swimlane updated successfully.'));
} else {
$this->flash->failure(t('Unable to update this swimlane.'));
}
$this->response->redirect($this->helper->url->to('SwimlaneController', 'index', array('project_id' => $project['id'])));
} | 0 | PHP | CWE-639 | Authorization Bypass Through User-Controlled Key | The system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. | https://cwe.mitre.org/data/definitions/639.html | vulnerable |
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 delete() {
global $db, $history;
/* 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['id'])) {
flash('error', gt('Missing id for the comment you would like to delete'));
$lastUrl = expHistory::getLast('editable');
}
// delete the note
$simplenote = new expSimpleNote($this->params['id']);
$rows = $simplenote->delete();
// delete the assocication too
$db->delete($simplenote->attachable_table, 'expsimplenote_id='.$this->params['id']);
// send the user back where they came from.
$lastUrl = expHistory::getLast('editable');
if (!empty($this->params['tab']))
{
$lastUrl .= "#".$this->params['tab'];
}
redirect_to($lastUrl);
} | 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
static function description() {
return gt("This module is for managing categories in your store.");
} | 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 getChildren()
{
return $this->children;
} | 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 insertObject($object, $table) {
//if ($table=="text") eDebug($object,true);
$sql = "INSERT INTO `" . $this->prefix . "$table` (";
$values = ") VALUES (";
foreach (get_object_vars($object) as $var => $val) {
//We do not want to save any fields that start with an '_'
if ($var{0} != '_') {
$sql .= "`$var`,";
if ($values != ") VALUES (") {
$values .= ",";
}
$values .= "'" . $this->escapeString($val) . "'";
}
}
$sql = substr($sql, 0, -1) . substr($values, 0) . ")";
//if($table=='text')eDebug($sql,true);
if (@mysqli_query($this->connection, $sql) != false) {
$id = mysqli_insert_id($this->connection);
return $id;
} else
return 0;
} | 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 |
serendipity_db_query("INSERT INTO {$serendipity['dbPrefix']}entrycat (entryid, categoryid) VALUES ({$entry['id']}, " . (int)$cat . ")");
}
} elseif ($had_categories) { | 1 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | safe |
public function __construct () {
global $vars;
if(DB_DRIVER == 'mysql') {
mysql_connect(DB_HOST, DB_USER, DB_PASS);
mysql_select_db(DB_NAME);
}elseif(DB_DRIVER == 'mysqli') {
try {
self::$mysqli = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);
if (self::$mysqli->connect_error) {
Control::error('db', self::$mysqli->connect_error);
exit;
}else{
return true;
}
} catch (exception $e) {
Control::error('db', $e->getMessage() );
}
//return self::$mysqli;
}
} | 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 |
$vars = self::$mysqli->escape_string($vars);
}else{
$vars = $vars;
}
return $vars;
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
public function testConstructor()
{
$dompdf = new Dompdf();
$this->assertInstanceOf(CPDF::class, $dompdf->getCanvas());
$this->assertSame("", $dompdf->getProtocol());
$this->assertSame("", $dompdf->getBaseHost());
$this->assertSame("", $dompdf->getBasePath());
$this->assertIsArray($dompdf->getCallbacks());
$this->assertInstanceOf(Stylesheet::class, $dompdf->getCss());
$this->assertNull($dompdf->getDom());
$this->assertNull($dompdf->getHttpContext());
$this->assertInstanceOf(Options::class, $dompdf->getOptions());
$this->assertFalse($dompdf->getQuirksmode());
$this->assertNull($dompdf->getTree());
} | 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 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-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 searchCategory() {
return gt('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 |
$evs = $this->event->find('all', "id=" . $edate->event_id . $featuresql);
foreach ($evs as $key=>$event) {
if ($condense) {
$eventid = $event->id;
$multiday_event = array_filter($events, create_function('$event', 'global $eventid; return $event->id === $eventid;'));
if (!empty($multiday_event)) {
unset($evs[$key]);
continue;
}
}
$evs[$key]->eventstart += $edate->date;
$evs[$key]->eventend += $edate->date;
$evs[$key]->date_id = $edate->id;
if (!empty($event->expCat)) {
$catcolor = empty($event->expCat[0]->color) ? null : trim($event->expCat[0]->color);
// if (substr($catcolor,0,1)=='#') $catcolor = '" style="color:'.$catcolor.';';
$evs[$key]->color = $catcolor;
}
}
if (count($events) < 500) { // magic number to not crash loop?
$events = array_merge($events, $evs);
} else {
// $evs[$key]->title = gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!');
// $events = array_merge($events, $evs);
flash('notice',gt('Too many events to list').', '.(count($edates)-count($events)).' '.gt('not displayed!'));
break; // keep from breaking system by too much data
}
} | 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 __construct(Frame $frame, Dompdf $dompdf)
{
parent::__construct($frame, $dompdf);
$url = $frame->get_node()->getAttribute("src");
$debug_png = $dompdf->getOptions()->getDebugPng();
if ($debug_png) {
print '[__construct ' . $url . ']';
}
list($this->_image_url, /*$type*/, $this->_image_msg) = Cache::resolve_url(
$url,
$dompdf->getProtocol(),
$dompdf->getBaseHost(),
$dompdf->getBasePath(),
$dompdf
);
if (Cache::is_broken($this->_image_url) &&
$alt = $frame->get_node()->getAttribute("alt")
) {
$fontMetrics = $dompdf->getFontMetrics();
$style = $frame->get_style();
$font = $style->font_family;
$size = $style->font_size;
$word_spacing = $style->word_spacing;
$letter_spacing = $style->letter_spacing;
$style->width = (4 / 3) * $fontMetrics->getTextWidth($alt, $font, $size, $word_spacing, $letter_spacing);
$style->height = $fontMetrics->getFontHeight($font, $size);
}
} | 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 draw_cdef_preview($cdef_id) {
?>
<tr class='even'>
<td style='padding:4px'>
<pre>cdef=<?php print get_cdef($cdef_id, true);?></pre>
</td>
</tr>
<?php
} | 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 |
$this->error = $langs->trans("ErrorBadCharIntoLoginName");
return -1;
}
$this->db->begin();
// Check if login already exists in same entity or into entity 0.
if (!empty($this->oldcopy) && $this->oldcopy->login != $this->login) {
$sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND login = '".$this->db->escape($this->login)."'";
$resqltochecklogin = $this->db->query($sqltochecklogin);
if ($resqltochecklogin) {
$objtochecklogin = $this->db->fetch_object($resqltochecklogin);
if ($objtochecklogin && $objtochecklogin->nb > 0) {
$langs->load("errors");
$this->error = $langs->trans("ErrorLoginAlreadyExists", $this->login);
dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG);
$this->db->rollback();
return -1;
}
}
}
if (!empty($this->oldcopy) && $this->email !== '' && $this->oldcopy->email != $this->email) {
$sqltochecklogin = "SELECT COUNT(*) as nb FROM ".MAIN_DB_PREFIX."user WHERE entity IN (".$this->db->sanitize((int) $this->entity).", 0) AND email = '".$this->db->escape($this->email)."'";
$resqltochecklogin = $this->db->query($sqltochecklogin);
if ($resqltochecklogin) {
$objtochecklogin = $this->db->fetch_object($resqltochecklogin);
if ($objtochecklogin && $objtochecklogin->nb > 0) {
$langs->load("errors");
$this->error = $langs->trans("ErrorEmailAlreadyExists", $this->email);
dol_syslog(get_class($this)."::create ".$this->error, LOG_DEBUG);
$this->db->rollback();
return -1;
}
}
}
// Update datas
$sql = "UPDATE ".MAIN_DB_PREFIX."user SET";
$sql .= " civility = '".$this->db->escape($this->civility_code)."'";
$sql .= ", lastname = '".$this->db->escape($this->lastname)."'";
$sql .= ", firstname = '".$this->db->escape($this->firstname)."'";
$sql .= ", employee = ".(int) $this->employee; | 1 | PHP | CWE-863 | Incorrect Authorization | The software performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions. | https://cwe.mitre.org/data/definitions/863.html | safe |
} elseif ($def) {
// This will occur even if $new_def is standalone. In practice,
// this will usually result in a full replacement.
$def->mergeIn($new_def);
} else { | 1 | PHP | CWE-79 | Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') | The software does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. | https://cwe.mitre.org/data/definitions/79.html | safe |
private function deleteDir($dirPath)
{
if (!is_dir($dirPath)) {
$success = unlink($dirPath);
} else {
$success = true;
foreach (array_reverse(elFinderVolumeFTP::listFilesInDirectory($dirPath, false)) as $path) {
$path = $dirPath . DIRECTORY_SEPARATOR . $path;
if(is_link($path)) {
unlink($path);
} else if (is_dir($path)) {
$success = rmdir($path);
} else {
$success = unlink($path);
}
if (!$success) {
break;
}
}
if($success) {
$success = rmdir($dirPath);
}
}
if(!$success) {
$this->setError(elFinder::ERROR_RM, $dirPath);
return false;
}
return $success;
} | 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 install () {
include(GX_PATH.'/inc/lib/Control/Install/default.control.php');
}
| 0 | PHP | CWE-89 | Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') | The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. | https://cwe.mitre.org/data/definitions/89.html | vulnerable |
foreach ($days as $value) {
$regitem[] = $value;
} | 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 PMA_getCentralColumnsCount($db)
{
$cfgCentralColumns = PMA_centralColumnsGetParams();
if (empty($cfgCentralColumns)) {
return 0;
}
$pmadb = $cfgCentralColumns['db'];
$GLOBALS['dbi']->selectDb($pmadb, $GLOBALS['controllink']);
$central_list_table = $cfgCentralColumns['table'];
$query = 'SELECT count(db_name) FROM ' .
Util::backquote($central_list_table) . ' '
. 'WHERE db_name = \'' . Util::sqlAddSlashes($db) . '\';';
$res = $GLOBALS['dbi']->fetchResult(
$query, null, null, $GLOBALS['controllink']
);
if (isset($res[0])) {
return $res[0];
} else {
return 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 |
} elseif (is_string($config)) {
$protocols[$config] = [];
}
} | 1 | 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 | safe |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.