bad-randomness-blackjack.sol
VSS-20261003-U2NB6NB6 · generated Oct 3, 2026, 7:53 PM
Verdict is derived from severity counts via the same deterministic formula every VegaSec report uses. bad-randomness-blackjack.sol was scanned from pasted source. This is static-analysis triage, not a certification or formal audit attestation.
PDF artifact
Queued artifact pipeline · not blocking on the scan
No PDF artifact has been requested for this report yet. The HTML report and the Markdown export already carry the full disclaimer and limitations inline. PDF synthesis is a queued artifact, not part of the scan path.
Status endpoint
GET /report/solidity/VSS-20261003-U2NB6NB6/export.pdf
Solidity evidence report
21 audit findings
Severity distribution
Executive summary
- 21 findings surfaced (0 critical, 2 high, 0 medium, 0 low, 19 informational).
- HIGH · Deck.deal(address,uint8) (bad-randomness-blackjack.sol#15-22) uses a weak PRNG: "uint8(uint256(keccak256()(block.blockhash(b),player,cardNumber,timestamp)) % 52 (deal) — exploitability medium.
- HIGH · BlackJack (bad-randomness-blackjack.sol#45-308) contract sets array length with a user-controlled value: (BlackJack) — exploitability medium.
- Automated static analysis only. A human operator review has not been attached to this report.
- highOracle manipulationConfidence: mediumExploitability: mediumDetector: slither
Deck.deal(address,uint8) (bad-randomness-blackjack.sol#15-22) uses a weak PRNG: "uint8(uint256(keccak256()(block.blockhash(b),player,cardNumber,timestamp)) % 52
Evidence
Deck.deal(address,uint8) (bad-randomness-blackjack.sol#15-22) uses a weak PRNG: "uint8(uint256(keccak256()(block.blockhash(b),player,cardNumber,timestamp)) % 52) (bad-randomness-blackjack.sol#21)"
Exploitability notes
Medium-confidence detection; manual review required before relying on the finding either way.
Remediation
Use multi-source price feeds (e.g. Chainlink + TWAPs) and validate freshness/deviation before consuming oracle data on-chain.
- highGas / DoSConfidence: mediumExploitability: mediumDetector: slither
BlackJack (bad-randomness-blackjack.sol#45-308) contract sets array length with a user-controlled value:
Evidence
BlackJack (bad-randomness-blackjack.sol#45-308) contract sets array length with a user-controlled value: - games[msg.sender].houseCards.push(newCard) (bad-randomness-blackjack.sol#149)
Exploitability notes
Medium-confidence detection; manual review required before relying on the finding either way.
Remediation
Cap loop bounds, paginate iteration, and ensure no user can grow a state structure the contract must traverse to make progress.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Version constraint ^0.4.9 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)
Evidence
Version constraint ^0.4.9 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - DirtyBytesArrayToStorage - KeccakCaching - EmptyByteArrayCopy - DynamicArrayCleanup - ImplicitConstructorCallvalueCheck - TupleAssignmentMultiStackSlotComponents - MemoryArrayCreationOverflow - privateCanBeOverridden - SignedArrayStorageCopy - UninitializedFunctionPointerInConstructor_0.4.x - IncorrectEventSignatureInLibraries_0.4.x - ExpExponentCleanup - NestedArrayFunctionCallDecoder - ZeroFunctionSelector - DelegateCallReturnValue - ECRecoverMalformedInput - SkipEmptyStringLiteral - ConstantOptimizerSubtraction. It is used by: - ^0.4.9 (bad-randomness-blackjack.sol#8)
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected uint8(uint256(keccak256()(block.blockhash(b),player,cardNumber,timestamp)) % 52) (bad-randomness-blackjack.sol#21):
Evidence
Deprecated standard detected uint8(uint256(keccak256()(block.blockhash(b),player,cardNumber,timestamp)) % 52) (bad-randomness-blackjack.sol#21): - Usage of "block.blockhash()" should be replaced with "blockhash()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
BlackJack.minBet (bad-randomness-blackjack.sol#48) should be constant
Evidence
BlackJack.minBet (bad-randomness-blackjack.sol#48) should be constant
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
BlackJack.maxBet (bad-randomness-blackjack.sol#49) should be constant
Evidence
BlackJack.maxBet (bad-randomness-blackjack.sol#49) should be constant
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
BlackJack.BLACKJACK (bad-randomness-blackjack.sol#51) should be constant
Evidence
BlackJack.BLACKJACK (bad-randomness-blackjack.sol#51) should be constant
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Variable BlackJack.BLACKJACK (bad-randomness-blackjack.sol#51) is not in mixedCase
Evidence
Variable BlackJack.BLACKJACK (bad-randomness-blackjack.sol#51) is not in mixedCase
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#70):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#70): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#102):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#102): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#106):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#106): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalReentrancyConfidence: mediumExploitability: lowDetector: slither
Reentrancy in BlackJack.checkGameResult(BlackJack.Game,bool) (bad-randomness-blackjack.sol#159-247):
Evidence
Reentrancy in BlackJack.checkGameResult(BlackJack.Game,bool) (bad-randomness-blackjack.sol#159-247): External calls: - ! msg.sender.send(game.bet * 2) (bad-randomness-blackjack.sol#240) State variables written after the call(s): - games[msg.sender].state = GameState.Player (bad-randomness-blackjack.sol#241)
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Apply the checks-effects-interactions pattern. State writes must happen before external calls, and consider OpenZeppelin's ReentrancyGuard for high-risk entry points.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#170):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#170): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#183):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#183): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#186):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#186): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#223):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#223): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#236):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#236): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#240):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#240): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#268):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#268): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#275):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#275): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
- informationalLogicConfidence: highExploitability: lowDetector: slither
Deprecated standard detected THROW (bad-randomness-blackjack.sol#290):
Evidence
Deprecated standard detected THROW (bad-randomness-blackjack.sol#290): - Usage of "throw" should be replaced with "revert()"
Exploitability notes
Informational signal; not directly exploitable without additional context.
Remediation
Re-derive the business rule by hand, write a property-based test that fails on the current path, and only then fix the implementation.
Exploit reasoning
Reference-grade reasoning tied to evidence
- 77561c06740e0877399a1f58d78ab8d9754526920887642439da28c13a474936 · oracle-manipulationhighConfidence: low
Conditions point at the exploit but at least one precondition needs operator confirmation.
Preconditions
- Price or rate read from an on-chain source that can be moved in the same block by the caller
- Decisions (mint amount, collateral check) derived from the manipulable price
Action
Attacker uses a flash loan or large swap to move the oracle price in the same block, triggers the price-dependent action, then reverts the price.
Impact
Mint of more shares than collateral warrants, undercollateralized borrow, or theft of liquidity by exploiting the manipulated rate.
False-positive caveats
- The oracle may be a time-weighted aggregator that resists single-block movement.
- The function may compare against a snapshot taken on a separate block.
Remediation checklist
- Use a TWAP (time-weighted average price) over multiple blocks.
- Cross-check at least two independent oracle sources before acting.
- Reject prices that diverge from a recent average by more than a documented threshold.
- 28fd5ca69c8dc9f8ea41a5c9a7472ea30a59df5829272801b3d5e0cc58ab3837 · gas-doshighConfidence: low
Conditions point at the exploit but at least one precondition needs operator confirmation.
Preconditions
- Loop over an unbounded data structure controlled by external input
- Single attacker-controlled entry that grows the data structure
Action
Attacker grows the data structure until the loop consumes more gas than the block can hold, blocking the function for everyone.
Impact
Permanent denial of service on critical functions (withdrawals, claim, settle).
False-positive caveats
- The loop may be bounded by other invariants the analyzer cannot prove.
- Pagination or pull-based design may mitigate the issue at a higher layer.
Remediation checklist
- Replace the unbounded loop with a pull-based or paginated pattern.
- Cap the data structure growth at the entry point with a documented limit.
- Add a stress test asserting the loop terminates under adversarial input.
Audit pipeline
Audit cockpit
Honest stage-by-stage view of what VegaSec ran against this contract. Automated stages do not replace a human operator review.
Audit intake
Passed320ms replay7:53 PMNormalize the submitted contract target and confirm it can enter the Solidity audit lane.
Source acquisition
Passed1.4s replay7:53 PMResolve pasted source or verified explorer source without treating malformed input as demo data.
Toolchain validation
Passed2.3s replay7:53 PMConfirm the configured static analyzers can run and produce parseable output.
Static analysis
Passed21 findings8.8s replay7:53 PMRun static analyzers against the sandboxed source and collect raw detector evidence.
Finding normalization
Passed21 findings1.1s replay7:53 PMDedupe detectors, classify vulnerability classes and compute severity-weighted risk.
Exploitability review
Partial21 findings1.9s replay7:53 PMFrame automated findings with conservative exploitability and limitation notes.
- Automated exploitability review is conservative and does not replace a manual exploitability assessment.
Remediation draft
Partial21 findings1.5s replay7:53 PMPrepare remediation-oriented evidence for the shareable report artifact.
- Remediation notes are generated from detector evidence and require project-specific engineering review.
Operator review
Blocked0ms replay7:53 PMRecord whether a human operator artifact exists before buyer escalation.
- No operator review artifact is attached to this automated scan.
- Human operator review has not been attached to this automated scan yet.
Finalization
Partial21 findings620ms replay7:53 PMPublish the automated report artifact or explain why the scan failed closed.
Artifact: Automated Solidity report · solidity-2f746d702f766567
- Final report is an automated static-analysis artifact; no operator review artifact is attached.
How to read this report
Score, confidence, ranking: four moving parts, no hand-tuning.
Generated Oct 3, 2026, 7:53 PM · Solidity · bad-randomness-blackjack.sol
Score bands
0-19
AVOID-style triage
Multiple high or critical findings, low source confidence, or unverified context. Public action should pause until a Private Review or a re-scan with better evidence.
20-49
High caution
Notable findings or thin evidence. Worth a Private Review before relying on the artifact.
50-69
Watch
Mixed signals: some evidence, some gaps. Re-scan after material changes to the target.
70-89
Clear surface (automated) · this report
No critical or high findings via static analysis. Not a safety claim: human review is still recommended for diligence work.
90-100
Strong surface (automated)
No critical or high findings, verified source, and high source confidence. Not a safety claim: human review is still recommended for diligence work.
- Score
- Deterministic 0-100 derived from severity counts. Same formula across every report. Lower means more risk.
- Confidence
- Separate axis. Measures how much VegaSec trusts the input data. Low confidence pushes the verdict toward UNKNOWN; the two are never collapsed into one number.
- Ranking / percentile
- Only meaningful within the eligible Trust Index set. Shown on /trust-index when the eligible pool is large enough. Today the public index is a controlled preview.
Private Review is separate
A paid Private Review does not raise the public score on this report. Public score reflects public-source evidence only. Private Review adds operator attestation and a confidential memo, never a score bump.