Zum Hauptinhalt springen
Echtzeit-Radar & Feeds
Alle RSS Feeds ➔
👥 Community & Social
•
IT NachrichtenSamsung Galaxy S26 FE review: false economy(24.09.2026 um 22:07 Uhr)
••••••••••
IT NachrichtenSamsung Galaxy S26 FE review: false economy(24.09.2026 um 22:07 Uhr)
•••••••••
Intelligence View
⚡ tsecurity.de Intelligence

Vibe Coding vs Spec Coding: Same Refund Feature, Built Twice

Vibe coding is intoxicating. You describe what you want in plain language, the AI writes the code, and ten minutes later you have a working endpoint. I was sold — until I shipped a refund feature that way and spent the next two weeks p…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Vibe coding is intoxicating. You describe what you want in plain language, the AI writes the code, and ten minutes later you have a working endpoint.



I was sold — until I shipped a refund feature that way and spent the next two weeks patching bugs that a 90-minute spec would have prevented entirely.



This is the side-by-side, using the exact same requirement, so you can see where the gap opens up.






The requirement



An e-commerce platform needs an order refund feature. The PM's brief:




  • Support full and partial refunds

  • Call the payment gateway (Stripe-style) to reverse the charge

  • Track refund status: pending, processing, succeeded, failed

  • Support agents trigger refunds through an internal tool



Simple enough. Both paths start here.






Path A: vibe coding



The prompt:




"Build me an order refund API in Node.js. Support full and partial refunds. Call a payment gateway to reverse the charge. Track refund status. Use Express and Postgres."




Sixty seconds later: a clean RefundController with createRefund and getRefundStatus. It validates the order exists, checks the amount against the order total, calls paymentGateway.refund(), saves the result. The code looks professional. The happy path works.



Ship it.






Bug #1: the double refund



A support agent clicks refund, the page hangs for a second, they click again. Two refunds go through. No idempotency check.



Fix prompt: "Add a check to prevent duplicate refunds for the same order." The AI adds a query: if a refund exists for this order, reject. Works — until it doesn't.






Bug #2: partial refund overflow



A $200 order. Support issues $50, then $80, then $100. Total refunded: $230. The duplicate check only catches exact duplicates, not cumulative amounts.



Fix prompt: "Track cumulative refund amounts and reject refunds that would exceed the order total." The AI adds a SUM(amount) query — but it's not in a transaction with the insert, so two concurrent partials can both pass the check.






Bug #3: gateway timeout



The gateway times out. The refund row sits at processing forever. Support can't retry — the duplicate check blocks them. Did the money actually leave? Nobody knows.



Fix prompt: "Add retry logic for gateway timeouts." The AI adds a retry loop: no exponential backoff, no idempotency key on the gateway call, no cap. The retry can now create a duplicate charge on the gateway side.






Bug #4: the race condition



Two agents process refunds for the same order simultaneously. Both pass the cumulative check (neither refund is committed yet), both hit the gateway, both succeed. The customer is refunded twice.



Fix prompt: "Add locking…"



Four patches in, each reasonable in isolation, and the architecture is a patchwork: no state machine, no documented invariants, no tests for how the patches interact.






The real cost



The first version took 10 minutes. The four patches took two weeks — investigation, testing, support escalations, and one manual reconciliation against gateway records.



The "fast" approach wasn't fast. It front-loaded the dopamine and back-loaded the pain.






Path B: spec coding



Same requirement. Same AI. Different starting point — 90 minutes writing this before any code:




# Feature: Order Refund Processing

## Goal
Process refunds safely: no over-refund, no duplicate
processing, correct gateway reconciliation.

## Non-Goals
- Customer self-service refund portal (future phase)
- Refund reason analytics
- Automated approval rules

## State Machine
pending → processing → succeeded
pending → processing → failed → pending (retry)

Only ONE refund may be "processing" per order at any time.

## Acceptance Criteria

Given an order with total $200 and $0 previously refunded
When a support agent requests a $50 refund
Then a refund record is created with status "pending"
And the gateway is called with an idempotency key
And on gateway success, status moves to "succeeded"
And the refundable balance is now $150.

Given an order with total $200 and $150 already refunded
When a support agent requests a $75 refund
Then the request is rejected with "exceeds refundable balance"
And no gateway call is made.

Given a refund in "processing" state
When another refund request arrives for the same order
Then the request is rejected with "refund already in progress"
And no gateway call is made.

Given a refund in "processing" state
When the gateway times out
Then the status remains "processing"
And a background job retries with exponential backoff
And the retry uses the SAME idempotency key
And after 3 failures, status moves to "failed"
And an alert goes to the payments team.

## Edge Cases
- Concurrency: SELECT FOR UPDATE on the order row before
checking refundable balance
- Idempotency: each refund attempt gets a UUID, passed to
the gateway as the idempotency key
- Precision: all amounts in cents (integer), no floats
- Reconciliation: nightly job compares local records
against the gateway settlement report

## Rollback Plan
- Feature flag: refund_processing_v2
- Rollback disables new refunds; in-flight ones continue
via the background job
- Additive schema only — no migration rollback needed






Then the prompt:




"Implement the refund feature described in this spec. Follow the state machine exactly. Use SELECT FOR UPDATE for concurrency control. Include the idempotency key in all gateway calls. All amounts in cents." [paste spec]







The output is structurally different



The AI generates, in the first version:





  • processRefund wrapped in a transaction with SELECT FOR UPDATE

  • Cumulative balance check inside the transaction — no race window

  • Idempotency UUID minted at creation, passed to every gateway call

  • Background retry with exponential backoff, capped at 3 attempts

  • State transitions that match the spec's machine exactly



Every bug from Path A is pre-handled. Double refund? The lock plus the idempotency key. Overflow? Balance check in the same transaction as the insert. Timeout? Same-key retry that the gateway treats as safe.



Same AI. Same capability. Dramatically different output — because the input was dramatically different. The AI didn't get smarter; it got better constraints.






The honest math




























Vibe coding Spec coding
Time to first version 10 min ~2.5 hours
Production bugs 4 (one involving real money) 0 in this scenario
Total time to stable ~2 weeks ~half a day


Vibe coding is great for prototypes, internal tools, and anything where a bug costs you a shrug. The moment money, state machines, or concurrency enter the picture, the 90 minutes you "save" by skipping the spec gets repaid at loan-shark interest.






Adapted from the full case study on Spec Coding. The site maintains free spec templates and a browser-based spec packet generator for exactly this workflow.

CTI Threat Relationship Graph3 Knoten / 2 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Remote Code Execution (RCE) Defense
Syntax validiert (0 Fehler)
title: Detect Exploitation - Vibe Coding vs Spec Coding: Same Refund Feature, Built Twice
id: 6c55b943-7cae-4ebc-bab1-8b8d58b807ef
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
Syntax validiert (0 Fehler)
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "Vibe Coding vs Spec Coding: Sa" ascii wide
    condition:
        any of them
}
Syntax validiert (0 Fehler)
index=security sourcetype IN ("cisco:asa", "pan:traffic", "zeek_conn", "suricata", "WinEventLog:Security")
("Vibe Coding vs Spec Coding Same Refund F")
| stats count earliest(_time) as first_seen latest(_time) as last_seen by src_ip, dest_ip, dest_host, signature
| eval first_seen=strftime(first_seen, "%Y-%m-%d %H:%M:%S"), last_seen=strftime(last_seen, "%Y-%m-%d %H:%M:%S")
| sort - count
Syntax validiert (0 Fehler)
message: "*Vibe Coding vs Spec Coding Same Refund F*"
Syntax validiert (0 Fehler)
CommonSecurityLog
| where Message has "Vibe Coding vs Spec Coding Same Refund F"
| summarize EventCount = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated) by SourceIP, DestinationIP, DestinationPort, Activity
| extend DetectionRule = "iShareStuff-CTI-Compiled"
| sort by EventCount desc
🎯
MITRE ATT&CK Matrix Navigator 14 Taktiken
Reconnaissance
-
Resource Development
-
Initial Access
Execution
Persistence
-
Privilege Escalation
Defense Evasion
Credential Access
-
Discovery
-
Lateral Movement
-
Collection
-
Command and Control
Exfiltration
-
Impact
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich Vibe Coding vs Spec Coding: Same Refund .... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

⚡ Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten Vibe Coding vs Spec Coding: Same Refund Feature, Built Twice

Thematisch verwandte Begriffe: Vibe, Coding, Spec, Same · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-81473 | Dell Rugged Control Center (RCC), versions prior to 5.2.206, contain an …
Advisory →
tsecurity.de Icon
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel • Rechts: nächster Artikel • unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...
↗ Original-Quelle