Skip to content
Snippets Groups Projects
Commit 9c6f079e authored by Afonso Cerejeira's avatar Afonso Cerejeira
Browse files

Merge branch 'afonso/T33502-fix-yourls-sql-injection' into 'main'

T33502 - Fix YOURLS SQL injection

See merge request !1
parents faebe71d 1ea2a63d
No related branches found
No related tags found
1 merge request!1T33502 - Fix YOURLS SQL injection
......@@ -24,7 +24,7 @@ services:
YOURLS_DB_NAME: "yourls"
YOURLS_DB_USER: "yourls"
YOURLS_DB_PASS: "youareells"
YOURLS_DEBUG: true
YOURLS_DEBUG: "true"
volumes:
- ./url-ownership/:/var/www/html/user/plugins/url-ownership/:z
......
......@@ -74,8 +74,9 @@ function uo_add_owner_cells_filter( $cells, $keyword, $url, $title, $ip, $clicks
global $ydb;
$table = YOURLS_DB_YOURLS_OWNER;
$sql = "SELECT owner FROM `$table` where `keyword` = '$keyword'";
$whoOwns = $ydb->fetchValue($sql);
$sql = "SELECT owner FROM `$table` where `keyword` = :keyword";
$binds = array('keyword' => $keyword);
$whoOwns = $ydb->fetchValue($sql, $binds);
if (!$whoOwns) {
$whoOwns = 'No Record';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment