mirror of
https://github.com/itflow-org/itflow
synced 2026-08-16 20:45:12 +00:00
Read API credential decrypt password from body instead of query string
Keeps the credential decryption secret out of the URL, so it no longer lands in web-server access logs, proxy logs, or browser history. credentials/read.php now reads api_key_decrypt_password from the request body, matching create/update. Consumers reading decrypted credentials must send it in the body, not the query string.
This commit is contained in:
@@ -9,7 +9,7 @@ require_once "includes/inc_all_admin.php";
|
|||||||
$sql = mysqli_query(
|
$sql = mysqli_query(
|
||||||
$mysqli,
|
$mysqli,
|
||||||
"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
"SELECT SQL_CALC_FOUND_ROWS * FROM api_keys
|
||||||
LEFT JOIN users on api_keys.api_key_user_id = users.user_id
|
LEFT JOIN users on api_key_user_id = user_id
|
||||||
WHERE (api_key_name LIKE '%$q%')
|
WHERE (api_key_name LIKE '%$q%')
|
||||||
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
ORDER BY $sort $order LIMIT $record_from, $record_to"
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ $key = randomString(32);
|
|||||||
$decryptPW = randomString(32);
|
$decryptPW = randomString(32);
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="modal-header bg-dark">
|
<div class="modal-header bg-dark">
|
||||||
|
|||||||
@@ -8,8 +8,10 @@ require_once '../require_get_method.php';
|
|||||||
$sql = false;
|
$sql = false;
|
||||||
|
|
||||||
$api_key_decrypt_password = '';
|
$api_key_decrypt_password = '';
|
||||||
if (isset($_GET['api_key_decrypt_password'])) {
|
if (isset($_POST['api_key_decrypt_password'])) {
|
||||||
$api_key_decrypt_password = $_GET['api_key_decrypt_password']; // No sanitization
|
// Read from the request body (parsed by validate_api_key.php), NOT the query string,
|
||||||
|
// so this decryption secret never lands in web-server access logs or browser history.
|
||||||
|
$api_key_decrypt_password = $_POST['api_key_decrypt_password'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Specific credential/login via ID (single)
|
// Specific credential/login via ID (single)
|
||||||
|
|||||||
Reference in New Issue
Block a user