-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 NEFARIOUSPLAN-CANONICAL-V1 {"body_md":"## The body is the TODO\n\nRead the file from top to bottom.\n\n```php\n 'Invalid amount']);\n exit;\n}\n// TODO: Implement payment logic using Authorize.Net API\n// Example: Call Authorize.Net API here\n// $result = $plugin->chargePayment($amount, $userData);\n\n// Simulate payment success for now\n$paymentSuccess = true;\n$users_id = @User::getId();\nif ($paymentSuccess && !empty($users_id)) {\n // Add funds to wallet\n $walletPlugin = AVideoPlugin::loadPluginIfEnabled(\"YPTWallet\");\n if ($walletPlugin) {\n $walletPlugin->addBalance($users_id, $amount, 'Authorize.Net one-time payment');\n echo json_encode(['success' => true, 'result' => 'Payment processed and wallet updated']);\n exit;\n }\n}\necho json_encode(['error' => 'Payment failed or user not logged in']);\n```\n\nThere is no authentication check beyond the implicit `@User::getId()` at line nineteen, which returns null for callers without a session and is gated only by `!empty($users_id)`. There is no nonce, no session token validation, no Authorize.Net transaction lookup, no webhook receipt verification, no comparison against any server-side record of an issued payment, no SDK call, no network request to authorize.net. There is `$paymentSuccess = true;`.\n\nA logged-in caller on any v29.0-or-earlier deployment that runs both the AuthorizeNet and YPTWallet plugins sends:\n\n```bash\ncurl -X POST 'https://avideo.example.com/plugin/AuthorizeNet/processPayment.json.php' \\\n -b 'PHPSESSID=' \\\n --data 'amount=10000'\n```\n\nand receives:\n\n```json\n{\"success\":true,\"result\":\"Payment processed and wallet updated\"}\n```\n\nThe wallet ledger gains a new credit of ten thousand units, with the description `Authorize.Net one-time payment`. The audit trail from the wallet's perspective is indistinguishable from a real Authorize.Net charge. The audit trail from the bank's perspective is empty. No one called the bank.\n\nThe `$userData = isset($_POST['userData']) ? $_POST['userData'] : [];` on line eight reads a parameter the file never uses. The variable's only consumer in the TODO block is the example comment one line below it, which invokes `$plugin->chargePayment($amount, $userData)`. The developer was setting up the call's arguments. They wrote the arguments. They did not write the call.\n\n## The method the comment told you to call does not exist\n\nThe line `// $result = $plugin->chargePayment($amount, $userData);` invokes `AuthorizeNet::chargePayment()`. The class lives at `plugin/AuthorizeNet/AuthorizeNet.php`. It is two thousand one hundred and seventy-eight lines long. It defines public methods for generating Accept Hosted tokens (`generateHostedPaymentPage`), registering webhooks (`createWebhookIfNotExists`), processing approved transactions (`processApprovedTransaction`), fetching transaction details (`getTransactionDetails`), and recording pending payments (`createPendingPayment`). It does not define `chargePayment`. It has never defined `chargePayment`. The git log across every branch records zero commits that ever introduced a method by that name to this file.\n\nThe example comment is not the developer linking to code they wrote elsewhere and forgot to wire up. It is a sketch of a method the codebase did not have, written in the moment the rest of the file was written, by an author who knew what the implementation should look like and did not write it.\n\n## The fix was not validation. The fix was deletion.\n\nThe patch commit, [`822402444b`](https://github.com/WWBN/AVideo/commit/822402444b4db4e9442779c8c789ffe5312b3627), May 19, 2026:\n\n```\nRemove deprecated processPayment endpoint to prevent wallet fraud\n\nhttps://github.com/WWBN/AVideo/security/advisories/GHSA-9392-pj54-qqf8\n\n plugin/AuthorizeNet/processPayment.json.php | 29 -----------------------------\n 1 file changed, 29 deletions(-)\n```\n\nTwenty-nine lines removed, zero added. The remediation for a wallet-credit bypass is `git rm`.\n\nThe commit message calls the endpoint `deprecated`. The word describes a feature that worked and is being retired. The file was introduced ten months before this commit and was never anything other than what the deletion deleted. There was no version of `processPayment.json.php` that ran the Authorize.Net SDK. There was no point at which the file was the documented payment processor and was later superseded by a better one. The file's entire history across the only commit that ever touched its body was the TODO comment and `$paymentSuccess = true;`. Deprecated describes a feature that was. The vendor's word for what was removed is the word for the thing the file was never able to be.\n\n## What real Authorize.Net charging looks like in this codebase\n\nIn the same directory, around the stub, the actual Authorize.Net integration grew up over the ten months the stub was live. The flow the codebase eventually wired:\n\n1. `getAcceptHostedToken.json.php`: an authenticated user POSTs an `amount` (or a `plans_id` that resolves to an amount). The server creates a row in `Anet_pending_payment` recording the amount, the user, and a fresh `refId`. It calls `AuthorizeNet::generateHostedPaymentPage()`, which exchanges the metadata for an Authorize.Net Accept Hosted token. The server returns the token plus the Authorize.Net iframe URL. The user pays on Authorize.Net's hosted page. AVideo does not see the card.\n\n2. `webhook.php`: Authorize.Net's notification system POSTs a signed event to this endpoint. The handler verifies the HMAC signature, looks up the `refId` against `Anet_pending_payment`, and only then calls `AuthorizeNet::processApprovedTransaction()`, which is the function that eventually calls `YPTWallet::addBalance()`.\n\n3. `processTransaction.json.php`: an admin-only fallback \"for when a payment succeeded but the webhook failed to credit the wallet.\" The handler gates on `User::isAdmin()`, fetches transaction details from Authorize.Net by transaction ID, and calls `processApprovedTransaction` only when the lookup returns approved.\n\nThe real payment authority is the webhook receipt, signature-verified, cross-referenced to a server-side pending payment, mediated by an Authorize.Net API lookup. `addBalance` is reached from `processApprovedTransaction`, which is reached from `webhook.php`, which has authenticated Authorize.Net as the caller via HMAC. The chain is what the integration is. The stub bypassed the chain.\n\nThe stub and the chain shipped in the same commit. [`e63ea73beb`](https://github.com/WWBN/AVideo/commit/e63ea73beb85efd738ceb4511e51131bcc273c63) on July 23, 2025 advertises both in its message. The eighth bullet promises `processPayment.json.php` \"for processing payments through Authorize.Net.\" The ninth bullet promises `webhook.php` to \"handle incoming webhooks from Authorize.Net.\" One of the two bullets describes working code. The other describes a file the author planned to write and committed before writing.\n\n## Two months before the deletion, the admin sweep walked past\n\nOn March 27, 2026, the same author pushed [`1729a955f8`](https://github.com/WWBN/AVideo/commit/1729a955f8de7e26552eb728b3d1e6f4b1b9352e), *fix: Restrict access to admin users for various JSON response endpoints*. The diff adds the four-line block:\n\n```php\nif (!User::isAdmin()) {\n die(json_encode(['error' => true, 'msg' => \"You can't do this\"]));\n}\n```\n\nto nineteen endpoints across eighteen files. One of those files is `plugin/AuthorizeNet/View/Anet_webhook_log/list.json.php`, two directory levels below the stub. The audit walked into the AuthorizeNet plugin, found a `list.json.php` that exposed webhook log entries to non-admin callers, added the admin gate, and walked back out without touching `processPayment.json.php`, which sat in the same plugin directory and credited any logged-in user's wallet for any POSTed amount.\n\nThe sweep was a response to a different advisory, GHSA-wprj-9cvc-5w37, named in the commit body. Its scope was list endpoints in plugin view directories. The shape of the stub did not match the shape the sweep was looking for; the stub was not a list endpoint and did not live in a view directory. The audit was not designed to find it. It was designed to find what it found.\n\nEight weeks later, a separate researcher (`proochicken`) filed GHSA-9392-pj54-qqf8 against the file the sweep had walked past.\n\n## The release tag carries the file\n\nThe deletion landed on main on May 19, 2026. The most recent tagged release is v29.0, cut April 7, 2026, which contains the stub. The advisory's *Patched versions* field is empty. As of CVE publication, no tagged AVideo release carries the fix; a fresh `git clone --branch 29.0` produces a tree with `plugin/AuthorizeNet/processPayment.json.php` intact. The patch is `git rm` on main, and on main only. Operators have it available as a hand-applied delete and as nothing else.\n\nCounting from the stub's introduction in commit `e63ea73beb`: the file appears in v21.0 (February 20, 2026), v22.0, v24.0, v25.0, v26.0, and v29.0. Six tagged releases over five and a half months, every one carrying twenty-nine lines that credit attacker-supplied amounts into the wallet ledger as Authorize.Net payments.\n\n## AVideo has shipped this pattern before\n\nThe catalog names this shape [todo-that-shipped](/patterns/todo-that-shipped): a comment that names a security-relevant control, sitting above code that operates without that control, in a release the project ships. The canonical exhibits have the comment naming a missing call (Open WebUI's `# TODO: Granular access control for chats`, free5GC's four `// TODO: Authorize the AF` comments in the NEF PFD handlers) and shipping the function body without the call.\n\nCVE-2026-47696 sits at the high-stakes end of the pattern. The TODO does not name a missing access-control check above otherwise-functional code. The TODO is the entire payment authority. The thing the developer told themselves to implement, and did not implement, was the file's only reason to exist. The closest catalog kin in shape is [Drupal's CVE-2026-9082](/posts/drupal-cve-2026-9082-the-comment-said-values), where the named control had existed and a 2020 refactor deleted it; AVideo's variant is the bluntest form, where the control was never written.\n\nThis is also the second todo-that-shipped CVE assigned to WWBN AVideo in three weeks. The first was [CVE-2026-43873](/posts/avideo-cve-2026-43873-reject-branch-echoes-the-key), authored by the same maintainer, where a 2019 commit's in-place `echo \"$objClone->myKey !== $argv[1]\";` debug print sat in the reject branch of a federation-key auth check for seven years and fifteen days. The line was scaffolding the developer added to verify a code path worked during development. It survived a rename pass that touched the same line eight months later. The CVE patch removed one character of scaffolding. The fix did not have to be authored. It had to be deleted.\n\n`processPayment.json.php` is the same shape with the artifact swapped from one line of scaffolding to a whole file of it. `$paymentSuccess = true;` is the developer's in-place statement to make the rest of the file's path return success, so that the call to `addBalance` can be exercised and verified to work end-to-end. The check worked. The author moved on. The scaffolding stayed in place across six release tags. The codebase's reject-branch `echo` did not authenticate anyone in 2019, did not authenticate anyone in 2026, and was never going to. The codebase's `$paymentSuccess = true;` did not process a payment in 2025 and was never going to.\n\nThe pattern's playbook clause is the operative instruction: grep your security-sensitive code paths for `TODO`, `FIXME`, `XXX`, `HACK`, sort by age, treat anything older than eighteen months as a shipped vulnerability. AVideo's reject-branch echo cleared eighteen months by a factor of more than four. AVideo's `$paymentSuccess = true;` did not clear eighteen months and shipped through six release tags anyway. The age threshold is a guidance for prioritization; the maintenance culture that lets these comments outlive a single release cycle is what produces the CVEs.\n\nPoC: [GHSA-9392-pj54-qqf8](https://github.com/WWBN/AVideo/security/advisories/GHSA-9392-pj54-qqf8)","closing_line":"The implementation never existed. The wallet credit did.","hook_md":"WWBN AVideo's `plugin/AuthorizeNet/processPayment.json.php` is twenty-nine lines long. Two of them validate that `$_POST['amount']` is positive. Eight of them compute the calling user's ID and call `YPTWallet::addBalance()` with that amount and the ledger description `'Authorize.Net one-time payment'`. The lines in between are a `// TODO: Implement payment logic using Authorize.Net API` comment, an example comment invoking a method (`$plugin->chargePayment`) that does not exist anywhere in the codebase, and the statement `$paymentSuccess = true;`.\n\nThe commit that introduced this file on July 23, 2025 has a fifteen-bullet message. The eighth bullet, verbatim: \"Implemented processPayment.json.php for processing payments through Authorize.Net.\" CVE-2026-47696 is the gap between the commit's verb and the file's body.","post_id":558,"slug":"avideo-cve-2026-47696-processpayment-was-a-todo","title":"CVE-2026-47696: AVideo's processPayment Was a TODO. The Commit Message Called It an Implementation.","type":"initial","unreadable_sentence":"The remediation for a wallet-credit bypass is `git rm`."} -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQRf0htP5+SjynlxywneZjl4jgkQJgUCaqmaygAKCRDeZjl4jgkQ Jt28AQCOk4p+nBMMstjHokapZXe5jjl+dAPC+zypdJ9iIt/gfQD8Cv6IfFsXiZIt tDBmDL8sscksRdHAW0hIUhU5O9g4mQQ= =rt4x -----END PGP SIGNATURE-----