Skip to content

Commit

Permalink
Merge pull request #1491 from RaspAP/fix/sanitize-ajax
Browse files Browse the repository at this point in the history
Security roundup
  • Loading branch information
billz committed Dec 31, 2023
2 parents fd38a22 + ebfb138 commit b2c78ff
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 97 deletions.
93 changes: 0 additions & 93 deletions ajax/networking/save_net_dev_config.php

This file was deleted.

5 changes: 3 additions & 2 deletions ajax/system/sys_get_logfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
require '../../includes/csrf.php';
require_once '../../includes/config.php';

$filePath = $_GET['filePath'];
$tempDir = sys_get_temp_dir();
$filePath = $tempDir . DIRECTORY_SEPARATOR . RASPI_DEBUG_LOG;

if (isset($filePath) && strpos($filePath, RASPI_DEBUG_LOG) !== false) {
if (isset($filePath)) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.basename($filePath));
header('Expires: 0');
Expand Down
3 changes: 1 addition & 2 deletions app/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,7 @@ function setDHCPToggles(state) {
$('#debugModal').on('shown.bs.modal', function (e) {
var csrfToken = $('meta[name=csrf_token]').attr('content');
$.post('ajax/system/sys_debug.php',{'csrf_token': csrfToken},function(data){
var filePath = JSON.parse(data);
window.location.replace('/ajax/system/sys_get_logfile.php?filePath='+filePath);
window.location.replace('/ajax/system/sys_get_logfile.php');
$('#debugModal').modal('hide');
});
});
Expand Down

0 comments on commit b2c78ff

Please sign in to comment.