plugin/AuthorizeNet/processPayment.json.php credits the logged-in user's wallet based only on the attacker-controlled amount POST parameter.
The endpoint contains a TODO for real Authorize.Net charging, hardcodes $paymentSuccess = true, and then calls YPTWallet::addBalance() without validating
any Authorize.Net transaction, webhook signature, hosted payment token, nonce, or server-side payment record.
This allows any logged-in user to add arbitrary funds to their own AVideo wallet when the AuthorizeNet and YPTWallet plugins are enabled.
Details
Affected file:
plugin/AuthorizeNet/processPayment.json.php
Relevant code:
$amount = isset($_POST['amount']) ? floatval($_POST['amount']) : 0;
$userData = isset($_POST['userData']) ? $_POST['userData'] : [];
if ($amount <= 0) {
echo json_encode(['error' => 'Invalid amount']);
exit;
}
// TODO: Implement payment logic using Authorize.Net API
// Example: Call Authorize.Net API here
// $result = $plugin->chargePayment($amount, $userData);
// Simulate payment success for now
$paymentSuccess = true;
$users_id = @User::getId();
if ($paymentSuccess && !empty($users_id)) {
$walletPlugin = AVideoPlugin::loadPluginIfEnabled("YPTWallet");
if ($walletPlugin) {
$walletPlugin->addBalance($users_id, $amount, 'Authorize.Net one-time payment');
echo json_encode(['success' => true, 'result' => 'Payment processed and wallet updated']);
exit;
}
}
Vulnerable flow:
$_POST['amount'] is read from the client.
The endpoint only checks that the amount is greater than zero.
The real Authorize.Net charge is not performed.
$paymentSuccess is hardcoded to true.
The logged-in user's wallet is credited with the client-supplied amount.
There is no verification of:
Authorize.Net transaction ID
payment token
webhook signature
pending payment record
expected server-side amount
currency
duplicate transaction/replay state
PoC
Prerequisites:
AVideo with AuthorizeNet plugin enabled
YPTWallet plugin enabled
Attacker has any valid user account
Steps:
Log in as a low-privileged user.
Open the wallet page and record the current balance.
Send the following request with the user's authenticated session cookie: