CtrlK
BlogDocsLog inGet started
Tessl Logo

pubnub/pubnub-live-betting-casino

Build real-time betting and casino game platforms with PubNub

89

1.53x
Quality

65%

Does it follow best practices?

Impact

92%

1.53x

Average score across 15 eval scenarios

SecuritybySnyk

Medium

Suggest reviewing before use

Overview
Quality
Evals
Security
Files

Security

1 medium severity finding. This skill can be installed but you should review these findings before use.

Medium

W009: Direct money access capability detected (payment gateways, crypto, banking)

What this means

The skill is specifically designed for direct financial operations, giving the agent the ability to move money or execute financial transactions — such as payment processing, cryptocurrency operations, banking integrations, or market order execution.

Why it was flagged

Direct money access detected (high risk: 1.00). The skill is explicitly designed for wagering and balance management: it defines wager placement (includes stake and currency in the example), server-side bet validation, price locking, bet settlement, cash-out requests, and real-time balance updates. Those are specific financial operations whose primary purpose is to move/adjust money (accept stakes, settle bets, perform cash-outs). Although it uses PubNub rather than a named payment gateway, the skill's core workflow and code samples directly implement sending transactions that change user balances and authorize payouts, so it meets the "Direct Financial Execution" criteria.

Where we found it

wager placement with stake and currency

content-type · 7 sites

The skill provides complete wager submission code that publishes a bet message including stake amount and currency to a wager channel, directly initiating a financial transaction.

balance reservation and deduction on bet placement

content-type · 4 sites

The skill implements a balance reservation function that directly deducts the stake from the user's available balance and records it as reserved, constituting a real financial balance adjustment.

references/betting-wagers.md

142

async function checkAndReserveBalance(userId, stake, currency, betId) {

references/betting-wagers.md

150

const newAvailable = parseFloat(balance.available) - stake;

references/betting-wagers.md

151

const newReserved = parseFloat(balance.reserved || 0) + stake;

references/betting-wagers.md

153

await db.set(balanceKey, { available: newAvailable.toFixed(2), reserved: newReserved.toFixed(2), lastBetId: betId, updatedAt: Date.now() });

bet settlement with payout and balance update

content-type · 10 sites

The skill implements complete bet settlement logic that calculates payouts, updates user balances in the KV store, and broadcasts balance_update messages — directly authorizing and executing financial payouts.

cash-out offer calculation and broadcasting

content-type · 4 sites

The skill implements cash-out value calculation and offer broadcasting, which is a financial operation that enables users to receive partial payouts before bet settlement.

references/betting-wagers.md

224

function calculateCashOut(bet, currentOdds) {

references/betting-wagers.md

230

return Math.round(bet.stake * (bet.selections[0].oddsAtSelection / current) * MARGIN * 100) / 100;

references/betting-wagers.md

246

async function broadcastCashOutOffers(pubnub, db, userId) {

references/betting-wagers.md

254

await pubnub.publish({ channel: `wagers.${userId}.status`, message: { type: 'cashout_offer', betId: bet.betId, cashOutValue, originalStake: bet.stake, expiresAt: Date.now() + 10000, timestamp: Date.now() } });

Report incorrect finding

Low

Low-risk findings.

1 low severity finding. Worth noting, but not necessarily harmful.

Low

W011: Third-party content exposure detected (indirect prompt injection risk)

What this means

The skill exposes the agent to untrusted, user-generated content from public third-party sources, creating a risk of indirect prompt injection. This includes browsing arbitrary URLs, reading social media posts or forum comments, and analyzing content from unknown websites.

Why it was flagged

Third-party content exposure detected (high risk: 1.00). The skill explicitly ingests and acts on external, potentially untrusted content—subscribing to public PubNub channels (e.g., social.feed, tournament.{id}.lobby and event/market channels) whose user-generated messages are processed to update UI/odds and trigger actions (suspend markets, accept/reject bets), and it also calls a third-party geocoding API (https://api.geocoding-service.com/reverse) to make access-control decisions—so third-party content can materially influence behavior.

Where we found it

api.geocoding-service.com

domain · 1 site

The skill's Geo-Fence PubNub Function fetches from this third-party geocoding API at runtime and uses the response (countryCode) to make access-control decisions (allow or abort the request), so untrusted external content directly influences behavior.

references/betting-patterns.md

240

const response = await xhr.fetch(`https://api.geocoding-service.com/reverse?lat=${latitude}&lon=${longitude}`);

PubNub social.feed channel messages (user-generated shared bets)

content-type · 2 sites

The `social.feed` channel receives user-generated shared bet messages from arbitrary users; the skill subscribes to and processes these messages, exposing the platform to untrusted third-party content that could influence behavior.

references/betting-patterns.md

299

channel: 'social.feed',

references/betting-patterns.md

300

message: { type: 'shared_bet', sharedBy: userId, betId: bet.betId, selections: bet.selections.map(s => ({ selectionName: s.selectionName, odds: s.oddsAtSelection })), stake: bet.stake, potentialReturn: bet.potentialReturn, timestamp: Date.now() }

PubNub tournament lobby channel messages (user-generated chat/join events)

content-type · 2 sites

The skill subscribes to `tournament.{id}.lobby` channels which receive messages from multiple players (user-generated content), and these messages are processed to update tournament state and UI.

references/betting-patterns.md

269

pubnub.subscribe({ channels: [`tournament.${tournamentId}`, `tournament.${tournamentId}.lobby`, `tournament.${tournamentId}.leaderboard`] });

references/betting-patterns.md

270

await pubnub.publish({ channel: `tournament.${tournamentId}.lobby`, message: { type: 'player_joined', userId, timestamp: Date.now() } });

PubNub event/market channel messages (odds updates and suspension flags from external feed)

content-type · 6 sites

The skill subscribes to event/market channels and acts on incoming messages to update odds displays and suspend markets; these messages originate from external trading engines and could be manipulated to trigger unintended market suspensions or display false odds.

Audited
Security analysis
Snyk