VaultSpace Revenge
Code Review
api_handler.php
// api_handler.php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
$contentType = $_SERVER['CONTENT_TYPE'] ?? '';
if (strpos($contentType, 'application/json') !== false) {
$input = json_decode(file_get_contents('php://input'), true);
$action = $input['action'] ?? '';
$params = $input['params'] ?? [];
} else {
$action = $_POST['action'] ?? '';
$params = $_POST['params'] ?? [];
}
$result = safe_call_function($action, $params);
echo json_encode(['status' => 'success', 'data' => $result]);
}functions.php
safe_call_function()
get_file_details()
Building the payload
What the API expects
Our Trick
Why alias the secret column as `0`?
`0`?Final payload
Exploitation steps
Step 1 — request a reset code for admin
admin Step 2 — Read the secret code back out via the router

Last updated