Skip to content

Commit

Permalink
Sanitize post data w/ escapeshellcmd()
Browse files Browse the repository at this point in the history
  • Loading branch information
billz committed Feb 17, 2023
1 parent d192497 commit 1fabc48
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ajax/logging/clearlog.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_once '../../includes/functions.php';

if (isset($_POST['logfile'])) {
$logfile = $_POST['logfile'];
$logfile = escapeshellcmd($_POST['logfile']);

// truncate requested log file
exec("sudo truncate -s 0 $logfile", $return);
Expand Down
2 changes: 1 addition & 1 deletion ajax/openvpn/activate_ovpncfg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_once '../../includes/functions.php';

if (isset($_POST['cfg_id'])) {
$ovpncfg_id = $_POST['cfg_id'];
$ovpncfg_id = escapeshellcmd($_POST['cfg_id']);
$ovpncfg_client = RASPI_OPENVPN_CLIENT_PATH.$ovpncfg_id.'_client.conf';
$ovpncfg_login = RASPI_OPENVPN_CLIENT_PATH.$ovpncfg_id.'_login.conf';

Expand Down
2 changes: 1 addition & 1 deletion ajax/openvpn/del_ovpncfg.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
require_once '../../includes/functions.php';

if (isset($_POST['cfg_id'])) {
$ovpncfg_id = $_POST['cfg_id'];
$ovpncfg_id = escapeshellcmd($_POST['cfg_id']);
$ovpncfg_files = pathinfo(RASPI_OPENVPN_CLIENT_LOGIN, PATHINFO_DIRNAME).'/'.$ovpncfg_id.'_*.conf';
exec("sudo rm $ovpncfg_files", $return);
$jsonData = ['return'=>$return];
Expand Down

1 comment on commit 1fabc48

@ismael0x00
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CVE-2022–39986

Please sign in to comment.