GHSA-v7c9-gjc9-fv7g

Suggest an improvement
Source
https://github.com/advisories/GHSA-v7c9-gjc9-fv7g
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-v7c9-gjc9-fv7g/GHSA-v7c9-gjc9-fv7g.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-v7c9-gjc9-fv7g
Aliases
Published
2026-12-03T00:38:15Z
Modified
2026-12-03T00:45:38Z
Severity
  • 8.6 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N CVSS Calculator
Summary
TastyIgniter: Forged Webhook Payload Leads to Order Fraud Without Payment
Details

Security Advisory: Forged Webhook Payload Leads to Order Fraud Without Payment

Summary

Field Details
Package tastyigniter/ti-ext-payregister
Affected File src/Payments/Stripe.php — getWebhookPayload() (lines 741–754)
Affected Versions All current versions (tested on v4.2.1)
CWE CWE-345 — Insufficient Verification of Data Authenticity
Reported 2026-04-20

Description

The Stripe payment gateway webhook handler accepts forged webhook payloads without signature verification when the webhook secret is not configured. Because the webhook secret is an optional field (not enforced by validation), an unauthenticated attacker can send a crafted payment_intent.succeeded webhook to mark any order as paid without making an actual payment.


Root Cause

In src/Payments/Stripe.php:

protected function getWebhookPayload(): array
{
    if (!$webhookSecret = $this->getWebhookSecret()) {
        // No webhook secret configured → payload accepted WITHOUT any verification
        return json_decode(request()->getContent(), true);
    }

    // Signature is only verified when the webhook secret IS configured
    $event = Webhook::constructEvent(
        request()->getContent(),
        request()->header('stripe-signature'),
        $webhookSecret,
    );

    return $event->toArray();
}

When no webhook secret is set, the handler returns the raw, unverified request body directly. The webhook secret fields (test_webhook_secret / live_webhook_secret) are optional in the admin payment settings form — only the Publishable Key and Secret Key are enforced by validation.

Additionally, the webhook endpoint is explicitly excluded from CSRF protection in Extension.php (line 161):

VerifyCsrfToken::except(['ti_payregister/*']);

This means the endpoint is both unauthenticated and CSRF-exempt, making it trivially exploitable from any external origin.


Proof of Concept

Step 1 — Confirm the webhook secret is not configured

Navigate to /admin/payments/edit/stripe. The Test Webhook Secret and Live Webhook Secret fields are empty by default and not required.

Step 2 — Send a forged webhook

curl -X POST https://[target]/ti_payregister/stripe_webhook/handle \
  -H "Content-Type: application/json" \
  -d '{
    "type": "payment_intent.succeeded",
    "data": {
      "object": {
        "id": "pi_forged_intent",
        "status": "succeeded",
        "metadata": {
          "order_id": 1
        }
      }
    }
  }'

Response: HTTP 200 — "Webhook Handled"

Step 3 — Verify order status

After ProcessStripeWebhookJob executes (dispatched with a 1-minute delay), the order's Payment Attempts tab shows:

"Payment successful via webhook"

The order is marked as paid and a Refund action button appears, confirming the forged webhook was fully processed.

Validated On

Environment Details Result
Local instance TastyIgniter v4.2.1, PHP 8.3.30, MySQL 8.0 ✅ Order marked processed = true
Official demo Created via tastyigniter.com demo feature ✅ HTTP 200, payment log entry created

Impact

  • Financial theft — Attackers place orders and receive goods or services without making any payment.
  • No authentication required — The webhook endpoint is fully public and CSRF-exempt.
  • Scalable — Any order_id can be targeted; an attacker only needs to know or enumerate order IDs.
  • Vulnerable by default — Webhook secrets are empty on fresh installations, making all new deployments immediately exploitable.

Recommended Fixes

Option A — Reject webhooks when no secret is configured (recommended)

protected function getWebhookPayload(): array
{
    if (!$webhookSecret = $this->getWebhookSecret()) {
        throw new \Exception('Webhook secret is not configured. Webhooks cannot be processed securely.');
    }

    $event = Webhook::constructEvent(
        request()->getContent(),
        request()->header('stripe-signature'),
        $webhookSecret,
    );

    return $event->toArray();
}

Option B — Make the webhook secret a required field

Enforce test_webhook_secret / live_webhook_secret as required in the payment settings validation rules when Stripe is enabled.

Option C — Verify via the Stripe API directly

Before marking any order as paid, verify the payment intent directly against the Stripe API regardless of webhook signature status.


Additional Finding: Insecure Deserialization (CWE-502)

Five instances of unserialize() were identified without the allowed_classes restriction across tastyigniter/core and tastyigniter/ti-ext-cart:

# File Location
1 src/System/Models/Settings.php getValueAttribute()
2 src/System/Traits/CombinesAssets.php getCache()
3 src/Main/Classes/MediaLibrary.php Cache handling
4 src/Flame/Database/Concerns/HasAttributes.php fromSerialized()
5 ti-ext-cart/src/Cart.php restore()

Fix: Add ['allowed_classes' => false] to all unserialize() calls, or migrate to json_decode() where the data format permits.


Disclosure Timeline

Date Event
2026-04-20 Vulnerability discovered and validated
2026-04-20 Report sent to support@tastyigniter.com

This report was submitted following responsible disclosure practices and was not publicly disclosed prior to vendor notification.

Database specific
{
    "cwe_ids":  [
        "CWE-345",
        "CWE-502"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-03T00:38:15Z",
    "nvd_published_at":  "2026-12-02T15:17:28Z",
    "severity":  "HIGH"
}
References

Affected packages

Packagist / tastyigniter/ti-ext-payregister

Package

Name
tastyigniter/ti-ext-payregister
Purl
pkg:composer/tastyigniter/ti-ext-payregister

Affected ranges

Type
ECOSYSTEM
Events
Introduced
4.0.0

Affected versions

v4.*
v4.0.0
v4.0.1
v4.0.2
v4.0.3
v4.0.4
v4.0.5
v4.0.6
v4.0.7
v4.0.8
v4.1.0
v4.1.1
v4.1.2
v4.2.0
v4.3.0
v4.3.1
v4.4.0
v4.4.1
v4.4.2
v4.4.3
v4.4.4
v4.4.5

Database specific

last_known_affected_version_range
"< 4.3.1"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-v7c9-gjc9-fv7g/GHSA-v7c9-gjc9-fv7g.json"