VegaSec / Solidity scan report

VegaTokenVulnerable.sol

VSS-20260924-YTDDH6CD · generated Sep 24, 2026, 2:38 PM

AVOID-style triage14 findings1 critical3 highPasted source1 warningsemgrep 1.163.0

Verdict is derived from severity counts via the same deterministic formula every VegaSec report uses. VegaTokenVulnerable.sol was scanned from pasted source. This is static-analysis triage, not a certification or formal audit attestation.

Signature

signed

This report is signed. Anyone can verify that these exact bytes came from us, with no account, no wallet and no API key. The signature proves integrity and authorship. It does not prove the audited contract is safe: read the coverage status and the limitations above.

sha256
5cb1c941cabdeadc...43638079
Signed by
Ed25519 key vsig-2026-09
Canonical version
vss-canonical-1
Bytes served
stored canonical text, byte for byte

PDF artifact

Queued artifact pipeline · not blocking on the scan

Not requested

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-20260924-YTDDH6CD/export.pdf

Solidity evidence report

14 audit findings

critical: 1high: 3medium: 6low: 1informational: 3

Severity distribution

Executive summary

  • 14 findings surfaced (1 critical, 3 high, 6 medium, 1 low, 3 informational).
  • CRITICAL · selfdestruct call — exploitability unknown.
  • HIGH · VegaTokenVulnerable.unsafeReviewerLottery(address[]) (VegaTokenVulnerable.sol#28-34) uses a weak PRNG: "picked = reviewers[block.timestamp % reviewers.length] ( (unsafeReviewerLottery) — exploitability medium.
  • HIGH · Reentrancy in VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42): (withdrawReviewCredit) — exploitability medium.
  • Automated static analysis only. A human operator review has not been attached to this report.

Warnings (1)

  • · Unmapped detector slither:immutable-states — classified as 'other'
semgrep 1.163.0
  • criticalCentralizationConfidence: unknownExploitability: unknownDetector: semgrep

    selfdestruct call

    Affected location
    VegaTokenVulnerable.sol:47
    Detector / source
    semgrep · semgrep:vegasec-selfdestruct

    Evidence

    selfdestruct call. Even with access control, selfdestruct introduces upgrade risk and historical state loss. Audit access control carefully or remove.

    Exploitability notes

    Analyzer did not report a confidence level; treat as unverified until reviewed.

    Remediation

    Document the trust boundary, set up time-locked multisig ownership, and surface admin-only functions in the deployment runbook.

    Limitations

    • Analyzer did not report confidence; fail closed and treat the finding as unverified.
    • Static analysis did not prove exploitability; do not present this as an exploit claim.
    • Analyzer output did not include a source excerpt for this finding.
  • highOracle manipulationConfidence: mediumExploitability: mediumDetector: slither

    VegaTokenVulnerable.unsafeReviewerLottery(address[]) (VegaTokenVulnerable.sol#28-34) uses a weak PRNG: "picked = reviewers[block.timestamp % reviewers.length] (

    Affected location
    VegaTokenVulnerable.sol:28-34 · unsafeReviewerLottery
    Detector / source
    slither · slither:weak-prng

    Evidence

    VegaTokenVulnerable.unsafeReviewerLottery(address[]) (VegaTokenVulnerable.sol#28-34) uses a weak PRNG: "picked = reviewers[block.timestamp % reviewers.length] (VegaTokenVulnerable.sol#31)"

    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.

    Limitations

    • Medium analyzer confidence; manual review should confirm the code path and preconditions.
    • Exploitability depends on deployment context, permissions, balances, and reachable preconditions.
    • Analyzer output did not include a source excerpt for this finding.
  • highReentrancyConfidence: mediumExploitability: mediumDetector: slither

    Reentrancy in VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42):

    Affected location
    VegaTokenVulnerable.sol:36-42 · withdrawReviewCredit
    Detector / source
    slither · slither:reentrancy-eth

    Evidence

    Reentrancy in VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42): External calls: - (ok,None) = address(msg.sender).call{value: amount}() (VegaTokenVulnerable.sol#39) State variables written after the call(s): - balances[msg.sender] -= amount (VegaTokenVulnerable.sol#41) VegaTokenVulnerable.balances (VegaTokenVulnerable.sol#10) can be used in cross function reentrancies: - VegaTokenVulnerable.balances (VegaTokenVulnerable.sol#10) - VegaTokenVulnerable.constructor() (VegaTokenVulnerable.sol#15-18) - VegaTokenVulnerable.mintForReview(address,uint256) (VegaTokenVulnerable.sol#22-26) - VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42)

    Exploitability notes

    Medium-confidence detection; manual review required before relying on the finding either way.

    Remediation

    Apply the checks-effects-interactions pattern. State writes must happen before external calls, and consider OpenZeppelin's ReentrancyGuard for high-risk entry points.

    Limitations

    • Medium analyzer confidence; manual review should confirm the code path and preconditions.
    • Exploitability depends on deployment context, permissions, balances, and reachable preconditions.
    • Analyzer output did not include a source excerpt for this finding.
  • highAccess controlConfidence: highExploitability: highDetector: slither

    VegaTokenVulnerable.retireFixture() (VegaTokenVulnerable.sol#44-48) allows anyone to destruct the contract

    Affected location
    VegaTokenVulnerable.sol:44-48 · retireFixture
    Detector / source
    slither · slither:suicidal

    Evidence

    VegaTokenVulnerable.retireFixture() (VegaTokenVulnerable.sol#44-48) allows anyone to destruct the contract

    Exploitability notes

    High-confidence detection of a severe pattern; treat as exploitable until disproven by manual review.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • High analyzer confidence, still requires source-level review before promotion.
    • Exploitability is inferred from a severe high-confidence static signal, not from a live exploit proof.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumAccess controlConfidence: mediumExploitability: mediumDetector: slither

    VegaTokenVulnerable.mintForReview(address,uint256) (VegaTokenVulnerable.sol#22-26) uses tx.origin for authorization: require(bool,string)(tx.origin == owner,ori

    Affected location
    VegaTokenVulnerable.sol:22-26 · mintForReview
    Detector / source
    slither · slither:tx-origin

    Evidence

    VegaTokenVulnerable.mintForReview(address,uint256) (VegaTokenVulnerable.sol#22-26) uses tx.origin for authorization: require(bool,string)(tx.origin == owner,origin owner only) (VegaTokenVulnerable.sol#24)

    Exploitability notes

    Medium-confidence detection; manual review required before relying on the finding either way.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • Medium analyzer confidence; manual review should confirm the code path and preconditions.
    • Exploitability depends on deployment context, permissions, balances, and reachable preconditions.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumAccess controlConfidence: unknownExploitability: unknownDetector: semgrep

    Use of tx.origin for authorization

    Affected location
    VegaTokenVulnerable.sol:24
    Detector / source
    semgrep · semgrep:vegasec-tx-origin-auth

    Evidence

    Use of tx.origin for authorization. tx.origin can be tricked via phishing contracts. Prefer msg.sender.

    Exploitability notes

    Analyzer did not report a confidence level; treat as unverified until reviewed.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • Analyzer did not report confidence; fail closed and treat the finding as unverified.
    • Static analysis did not prove exploitability; do not present this as an exploit claim.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumTimestamp dependenceConfidence: unknownExploitability: unknownDetector: semgrep

    block.timestamp used in a value computation

    Affected location
    VegaTokenVulnerable.sol:31
    Detector / source
    semgrep · semgrep:vegasec-block-timestamp-rng

    Evidence

    block.timestamp used in a value computation. Miners can adjust block.timestamp within ~15s; do not use it for randomness or time-critical comparisons.

    Exploitability notes

    Analyzer did not report a confidence level; treat as unverified until reviewed.

    Remediation

    Treat block.timestamp as a coarse value with miner influence; prefer block-number windows for short-term invariants and add tolerance bands.

    Limitations

    • Analyzer did not report confidence; fail closed and treat the finding as unverified.
    • Static analysis did not prove exploitability; do not present this as an exploit claim.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumUnchecked callConfidence: unknownExploitability: unknownDetector: semgrep

    Low-level .call to an externally-controlled target

    Affected location
    VegaTokenVulnerable.sol:39
    Detector / source
    semgrep · semgrep:vegasec-low-level-call-untrusted

    Evidence

    Low-level .call to an externally-controlled target. Combined with reentrancy or unchecked return values, this is a common fund-draining pattern.

    Exploitability notes

    Analyzer did not report a confidence level; treat as unverified until reviewed.

    Remediation

    Check the boolean return of low-level call/delegatecall/send and revert on failure with a descriptive reason string.

    Limitations

    • Analyzer did not report confidence; fail closed and treat the finding as unverified.
    • Static analysis did not prove exploitability; do not present this as an exploit claim.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumAccess controlConfidence: mediumExploitability: mediumDetector: slither

    VegaTokenVulnerable.retireFixture() (VegaTokenVulnerable.sol#44-48) uses tx.origin for authorization: require(bool,string)(tx.origin == owner,origin owner only)

    Affected location
    VegaTokenVulnerable.sol:44-48 · retireFixture
    Detector / source
    slither · slither:tx-origin

    Evidence

    VegaTokenVulnerable.retireFixture() (VegaTokenVulnerable.sol#44-48) uses tx.origin for authorization: require(bool,string)(tx.origin == owner,origin owner only) (VegaTokenVulnerable.sol#46)

    Exploitability notes

    Medium-confidence detection; manual review required before relying on the finding either way.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • Medium analyzer confidence; manual review should confirm the code path and preconditions.
    • Exploitability depends on deployment context, permissions, balances, and reachable preconditions.
    • Analyzer output did not include a source excerpt for this finding.
  • mediumAccess controlConfidence: unknownExploitability: unknownDetector: semgrep

    Use of tx.origin for authorization

    Affected location
    VegaTokenVulnerable.sol:46
    Detector / source
    semgrep · semgrep:vegasec-tx-origin-auth

    Evidence

    Use of tx.origin for authorization. tx.origin can be tricked via phishing contracts. Prefer msg.sender.

    Exploitability notes

    Analyzer did not report a confidence level; treat as unverified until reviewed.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • Analyzer did not report confidence; fail closed and treat the finding as unverified.
    • Static analysis did not prove exploitability; do not present this as an exploit claim.
    • Analyzer output did not include a source excerpt for this finding.
  • lowAccess controlConfidence: mediumExploitability: mediumDetector: slither

    VegaTokenVulnerable.unsafeReviewerLottery(address[]).picked (VegaTokenVulnerable.sol#28) lacks a zero-check on :

    Affected location
    VegaTokenVulnerable.sol:28 · picked
    Detector / source
    slither · slither:missing-zero-check

    Evidence

    VegaTokenVulnerable.unsafeReviewerLottery(address[]).picked (VegaTokenVulnerable.sol#28) lacks a zero-check on : - reviewer = picked (VegaTokenVulnerable.sol#32)

    Exploitability notes

    Medium-confidence detection; manual review required before relying on the finding either way.

    Remediation

    Gate privileged functions behind a tested role/ownership pattern (e.g. OpenZeppelin Ownable/AccessControl). Avoid tx.origin for authorization.

    Limitations

    • Medium analyzer confidence; manual review should confirm the code path and preconditions.
    • Exploitability depends on deployment context, permissions, balances, and reachable preconditions.
    • Analyzer output did not include a source excerpt for this finding.
  • informationalLogicConfidence: highExploitability: lowDetector: slither

    Version constraint ^0.8.20 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html)

    Affected location
    VegaTokenVulnerable.sol:2 · ^0.8.20
    Detector / source
    slither · slither:solc-version

    Evidence

    Version constraint ^0.8.20 contains known severe issues (https://solidity.readthedocs.io/en/latest/bugs.html) - VerbatimInvalidDeduplication - FullInlinerNonExpressionSplitArgumentEvaluationOrder - MissingSideEffectsOnSelectorAccess. It is used by: - ^0.8.20 (VegaTokenVulnerable.sol#2)

    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.

    Limitations

    • High analyzer confidence, still requires source-level review before promotion.
    • Direct exploitability is not established; keep the signal as a remediation/checklist item.
    • Analyzer output did not include a source excerpt for this finding.
  • informationalOtherConfidence: highExploitability: lowDetector: slither

    VegaTokenVulnerable.owner (VegaTokenVulnerable.sol#11) should be immutable

    Affected location
    VegaTokenVulnerable.sol:11 · owner
    Detector / source
    slither · slither:immutable-states

    Evidence

    VegaTokenVulnerable.owner (VegaTokenVulnerable.sol#11) should be immutable

    Exploitability notes

    Informational signal; not directly exploitable without additional context.

    Remediation

    Review the detector output against the source manually; if exploitable, design a fix and add a regression test before deploying.

    Limitations

    • High analyzer confidence, still requires source-level review before promotion.
    • Direct exploitability is not established; keep the signal as a remediation/checklist item.
    • Analyzer output did not include a source excerpt for this finding.
  • informationalUnchecked callConfidence: highExploitability: lowDetector: slither

    Low level call in VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42):

    Affected location
    VegaTokenVulnerable.sol:36-42 · withdrawReviewCredit
    Detector / source
    slither · slither:low-level-calls

    Evidence

    Low level call in VegaTokenVulnerable.withdrawReviewCredit(uint256) (VegaTokenVulnerable.sol#36-42): - (ok,None) = address(msg.sender).call{value: amount}() (VegaTokenVulnerable.sol#39)

    Exploitability notes

    Informational signal; not directly exploitable without additional context.

    Remediation

    Check the boolean return of low-level call/delegatecall/send and revert on failure with a descriptive reason string.

    Limitations

    • High analyzer confidence, still requires source-level review before promotion.
    • Direct exploitability is not established; keep the signal as a remediation/checklist item.
    • Analyzer output did not include a source excerpt for this finding.

Limitations

  • VegaSec runs static analysis only. Findings can include false positives, miss patterns the configured detectors do not cover, and never replace manual auditor judgement.
  • Scan ran slither and semgrep against a single sandboxed copy of the source. Multi-file dependency analysis beyond what slither resolves automatically is out of scope.
  • Some detectors emitted warnings (see `warnings`); their output was still ingested but should be read with extra care.
  • This report is not a certification, audit attestation, or financial advice.

Exploit reasoning

Reference-grade reasoning tied to evidence

  • 025d746d5dc01028d99ab6f083342b2f9b382eca5b913ce3121b6ef8656c9c07 · centralizationcritical

    Not determined

    Question: Is this finding exploitable in this specific contract?

    Reason: Analyzer confidence or exploitability is unknown; the narrative would overclaim without operator review.

  • 9e9cc0e9cfc74f54891b411b93c7449f2e172aa1da0a998e8e7b976ae04def6b · oracle-manipulationhigh
    Confidence: 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.
  • e3c81b2bb05292a33bb195f5efdac2095dcb7378274eb86ee20c848b965cd13e · reentrancyhigh
    Confidence: low

    Conditions point at the exploit but at least one precondition needs operator confirmation.

    Preconditions

    • External call to an untrusted address before the contract's own state is updated
    • Contract or callback path reachable from the external caller
    • No nonReentrant guard or equivalent on the entry-point function

    Action

    Attacker contract receives control during the external call and re-enters the original function before the original state write completes, repeating the state-changing side effect.

    Impact

    Duplicated withdrawals, double-spend on accounting balances, or out-of-order updates to invariants the function relies on.

    False-positive caveats

    • The external call may be to a known, trusted contract whose behavior is provable.
    • The function may be guarded indirectly by a flag or external lock not visible to the analyzer.

    Remediation checklist

    • Apply checks-effects-interactions: update internal state before any external call.
    • Add a nonReentrant guard on the entry-point function.
    • Where feasible, pull-payment instead of push-payment on user balances.
  • 7d9b78b620334b47ab494454ec49b378daf245c24264ec5ee94fd81ae25ca8a0 · access-controlhigh
    Confidence: high

    Conditions for the exploit are met by the analyzer evidence; treat as likely until disproven by operator review.

    Preconditions

    • Sensitive function lacks an explicit caller restriction or relies on tx.origin
    • Caller controls the path that reaches the function

    Action

    Attacker calls the unprotected function from an attacker-controlled address, bypassing the intended restriction.

    Impact

    Unauthorized state mutation: ownership transfer, parameter changes, balance writes, or admin-only operations executed by a non-admin.

    False-positive caveats

    • The function may be intentionally callable by anyone (e.g. a public mint with a price guard).
    • Access control may live in a modifier the analyzer did not parse.

    Remediation checklist

    • Replace tx.origin checks with msg.sender against a role registry.
    • Add a `onlyRole(...)` or equivalent modifier from a vetted access control library.
    • Add unit tests that assert non-admin callers revert.
  • 8d94c22f92bfff04d2cec20f538c96db7e75d788478a91bc7ffd1cceea98d7a0 · access-controlmedium
    Confidence: low

    Conditions point at the exploit but at least one precondition needs operator confirmation.

    Preconditions

    • Sensitive function lacks an explicit caller restriction or relies on tx.origin
    • Caller controls the path that reaches the function

    Action

    Attacker calls the unprotected function from an attacker-controlled address, bypassing the intended restriction.

    Impact

    Unauthorized state mutation: ownership transfer, parameter changes, balance writes, or admin-only operations executed by a non-admin.

    False-positive caveats

    • The function may be intentionally callable by anyone (e.g. a public mint with a price guard).
    • Access control may live in a modifier the analyzer did not parse.

    Remediation checklist

    • Replace tx.origin checks with msg.sender against a role registry.
    • Add a `onlyRole(...)` or equivalent modifier from a vetted access control library.
    • Add unit tests that assert non-admin callers revert.
  • d3a46569a601f7bdcf08c52c1ce6a464f24ea0d6035d39fa18437b6c940bbc00 · access-controlmedium

    Not determined

    Question: Is this finding exploitable in this specific contract?

    Reason: Analyzer confidence or exploitability is unknown; the narrative would overclaim without operator review.

  • 4bf225cdc0c238c3ce62538e80d89916562e5eb0b7ed3c988eaf7bb73b29c755 · timestamp-dependencemedium

    Not determined

    Question: Is this finding exploitable in this specific contract?

    Reason: Analyzer confidence or exploitability is unknown; the narrative would overclaim without operator review.

  • 24612734790f3f6ca717a5032967841c609ae6046549b32eb41f771d29f905a2 · unchecked-callmedium

    Not determined

    Question: Is this finding exploitable in this specific contract?

    Reason: Analyzer confidence or exploitability is unknown; the narrative would overclaim without operator review.

  • b85d4c6b14a005cc536ebad1f32253f03512ff61c8e9c49a7cbf0952e914f482 · access-controlmedium
    Confidence: low

    Conditions point at the exploit but at least one precondition needs operator confirmation.

    Preconditions

    • Sensitive function lacks an explicit caller restriction or relies on tx.origin
    • Caller controls the path that reaches the function

    Action

    Attacker calls the unprotected function from an attacker-controlled address, bypassing the intended restriction.

    Impact

    Unauthorized state mutation: ownership transfer, parameter changes, balance writes, or admin-only operations executed by a non-admin.

    False-positive caveats

    • The function may be intentionally callable by anyone (e.g. a public mint with a price guard).
    • Access control may live in a modifier the analyzer did not parse.

    Remediation checklist

    • Replace tx.origin checks with msg.sender against a role registry.
    • Add a `onlyRole(...)` or equivalent modifier from a vetted access control library.
    • Add unit tests that assert non-admin callers revert.
  • 2b383bb32009d69610ac628adccd9eee4b96f1e5449289991c5149e18497756b · access-controlmedium

    Not determined

    Question: Is this finding exploitable in this specific contract?

    Reason: Analyzer confidence or exploitability is unknown; the narrative would overclaim without operator review.

Judgment

Triage of the findings, in reading order

Draft · not reviewed by an operator

The ranking, the explanations and the remediation order below were produced by a language model from the findings this report already carries (model deepseek/deepseek-v4.1-flash) generated Sep 27, 2026, 3:58 AM. It is a triage layer, not a detection layer: every finding comes from the analyzers above.

An operator has not reviewed this draft yet. It is shown as a draft for that reason, and nothing here is presented as reviewed.

Ranking

  1. #1 · 025d746d5dc01028d99ab6f083342b2f9b382eca5b913ce3121b6ef8656c9c07 · centralizationcritical

    Critical: selfdestruct in retireFixture. Contract destruction plus historical state loss is the highest-impact item in the report.

  2. #2 · 7d9b78b620334b47ab494454ec49b378daf245c24264ec5ee94fd81ae25ca8a0 · access-controlhigh

    High confidence, high severity: the tx.origin gate on retireFixture is the reachable path to the selfdestruct above, so it should be triaged together with it.

  3. #3 · e3c81b2bb05292a33bb195f5efdac2095dcb7378274eb86ee20c848b965cd13e · reentrancyhigh

    High: state is written after an external call in withdrawReviewCredit, so any reentrant callee can drain balances before the debit lands.

  4. #4 · 9e9cc0e9cfc74f54891b411b93c7449f2e172aa1da0a998e8e7b976ae04def6b · oracle-manipulationhigh

    High: block.timestamp used to pick a reviewer is validator-influenced, so the selection is predictable and manipulable.

  5. #5 · 8d94c22f92bfff04d2cec20f538c96db7e75d788478a91bc7ffd1cceea98d7a0 · access-controlmedium

    Medium but impactful: tx.origin authorization on mintForReview lets a phishing contract mint to arbitrary accounts if owner is tricked.

  6. #6 · b85d4c6b14a005cc536ebad1f32253f03512ff61c8e9c49a7cbf0952e914f482 · access-controlmedium

    Medium: same tx.origin weakness on retireFixture, the function that also holds the selfdestruct; fix alongside the two items above.

  7. #7 · d3a46569a601f7bdcf08c52c1ce6a464f24ea0d6035d39fa18437b6c940bbc00 · access-controlmedium

    Medium: semgrep duplicate of the tx.origin check on line 24 already covered by the slither mintForReview finding.

  8. #8 · 2b383bb32009d69610ac628adccd9eee4b96f1e5449289991c5149e18497756b · access-controlmedium

    Medium: semgrep duplicate of the tx.origin check inside retireFixture, line 46.

  9. #9 · 24612734790f3f6ca717a5032967841c609ae6046549b32eb41f771d29f905a2 · unchecked-callmedium

    Medium: the low-level value call to msg.sender is the mechanism behind the withdrawReviewCredit reentrancy; remediate jointly.

  10. #10 · 4bf225cdc0c238c3ce62538e80d89916562e5eb0b7ed3c988eaf7bb73b29c755 · timestamp-dependencemedium

    Medium: semgrep view of the same block.timestamp arithmetic already reported by the weak-PRNG finding.

  11. #11 · c95e896eba0879481c44b2f622b6ae140a700984244981b4404ff41210f6c2d3 · unchecked-callinformational

    Informational: notes the low-level call in withdrawReviewCredit without adding a new class beyond the reentrancy and unchecked-call items.

  12. #12 · 0e297411d10f1e4a0ee9692c268471424d3d570524701f41a065fe7ac3d700e9 · access-controllow

    Low: zero-check on picked is a return value derived from a caller-supplied array, so exploitability is limited.

  13. #13 · 5000022c8e54141e1f7c204b377ec3cddd18eb4f224def2ddcfff5238884b60b · logicinformational

    Informational: pragma ^0.8.20 known-issue warning; build-configuration hygiene, not contract logic.

  14. #14 · a2093d5f0250fce2f6c8bbc1c6c8c09b8ac4c01d16989600d7b91a130bb8aded · otherinformational

    Informational: owner is never reassigned, so making it immutable is a gas and clarity suggestion only.

Why it matters

  • 025d746d5dc01028d99ab6f083342b2f9b382eca5b913ce3121b6ef8656c9c07

    retireFixture ends in selfdestruct(payable(owner)), which erases the contract code and storage. Anyone who can satisfy the gate can trigger permanent destruction of balances and review state rather than a reversible shutdown. The detector flags this as critical centralization because a single privileged path controls an irreversible action.

    Cited line · VegaTokenVulnerable.sol:47

    selfdestruct(payable(owner));
  • 7d9b78b620334b47ab494454ec49b378daf245c24264ec5ee94fd81ae25ca8a0

    The gate in front of the selfdestruct is tx.origin comparison, and the comment in the body states the tx.origin gate plus selfdestruct combination is unsafe. Because tx.origin is the original transaction sender, a contract the owner interacts with can relay the call and pass the check, so the destruction path is reachable without the owner calling retireFixture directly.

    Cited line · VegaTokenVulnerable.sol:46

    require(tx.origin == owner, "origin owner only");
  • e3c81b2bb05292a33bb195f5efdac2095dcb7378274eb86ee20c848b965cd13e

    withdrawReviewCredit sends value with a low-level call to msg.sender and only then subtracts balances[msg.sender]. While the recipient is executing its receive or fallback, its balance is still the pre-withdrawal amount, so it can re-enter withdrawReviewCredit and pass the require again, draining the contract before the first debit is applied.

    Cited line · VegaTokenVulnerable.sol:39

    (bool ok,) = payable(msg.sender).call{value: amount}("");
  • 9e9cc0e9cfc74f54891b411b93c7449f2e172aa1da0a998e8e7b976ae04def6b

    unsafeReviewerLottery picks the reviewer by indexing the caller-supplied array with block.timestamp modulo its length. Block producers can shift the timestamp within a small window, and the remaining inputs are public, so a caller can influence or predict who is selected and set reviewer and reviewRound accordingly.

    Cited line · VegaTokenVulnerable.sol:31

    picked = reviewers[block.timestamp % reviewers.length];
  • 8d94c22f92bfff04d2cec20f538c96db7e75d788478a91bc7ffd1cceea98d7a0

    mintForReview authorizes on tx.origin rather than msg.sender, then credits an arbitrary account. If the owner is routed through a malicious contract, that contract can call mintForReview and pass the check, minting balances to an account of its choosing. The same check appears verbatim in retireFixture.

    Cited line · VegaTokenVulnerable.sol:24

    require(tx.origin == owner, "origin owner only");

Remediation order

  1. Remove selfdestruct from retireFixture. If retirement is required, replace it with a state flag or pause switch that blocks minting and withdrawals without destroying code and storage.025d746d5dc01028d99ab6f083342b2f9b382eca5b913ce3121b6ef8656c9c07
  2. Replace the tx.origin gate in retireFixture with an owner or role check on msg.sender, and keep the function as a no-op or paused-state setter once selfdestruct is gone.7d9b78b620334b47ab494454ec49b378daf245c24264ec5ee94fd81ae25ca8a0
  3. In withdrawReviewCredit, debit balances[msg.sender] before the external call (checks-effects-interactions) and add a reentrancy guard; keep the require(ok) after the call.e3c81b2bb05292a33bb195f5efdac2095dcb7378274eb86ee20c848b965cd13e
  4. Stop deriving the reviewer index from block.timestamp. Use a commit-reveal scheme or a verifiable randomness source, and validate that the selected address is non-zero.9e9cc0e9cfc74f54891b411b93c7449f2e172aa1da0a998e8e7b976ae04def6b
  5. Change mintForReview authorization from tx.origin to msg.sender against owner or a role, matching the fix applied to retireFixture.8d94c22f92bfff04d2cec20f538c96db7e75d788478a91bc7ffd1cceea98d7a0
  6. Covered by the msg.sender change to retireFixture; verify no other function still compares tx.origin.b85d4c6b14a005cc536ebad1f32253f03512ff61c8e9c49a7cbf0952e914f482
  7. Duplicate of the line 24 tx.origin check; close it once mintForReview uses msg.sender.d3a46569a601f7bdcf08c52c1ce6a464f24ea0d6035d39fa18437b6c940bbc00
  8. Duplicate of the line 46 tx.origin check inside retireFixture; close it with the same rewrite.2b383bb32009d69610ac628adccd9eee4b96f1e5449289991c5149e18497756b
  9. Low-level value call to msg.sender is the reentrancy vector in withdrawReviewCredit; the checks-effects-interactions reorder and guard resolve this item.24612734790f3f6ca717a5032967841c609ae6046549b32eb41f771d29f905a2
  10. Same timestamp arithmetic as the weak-PRNG finding; closes when the lottery no longer indexes on block.timestamp.4bf225cdc0c238c3ce62538e80d89916562e5eb0b7ed3c988eaf7bb73b29c755
  11. Informational note on the withdrawReviewCredit low-level call; no separate fix beyond the reentrancy remediation.c95e896eba0879481c44b2f622b6ae140a700984244981b4404ff41210f6c2d3
  12. When reworking unsafeReviewerLottery, reject the zero address before assigning picked to reviewer.0e297411d10f1e4a0ee9692c268471424d3d570524701f41a065fe7ac3d700e9
  13. Pin the pragma to a specific tested compiler version instead of the ^0.8.20 range and confirm against the documented compiler bugs list.5000022c8e54141e1f7c204b377ec3cddd18eb4f224def2ddcfff5238884b60b
  14. Set owner in the constructor and mark it immutable if no setter is intended.a2093d5f0250fce2f6c8bbc1c6c8c09b8ac4c01d16989600d7b91a130bb8aded

Uncertain

  • 025d746d5dc01028d99ab6f083342b2f9b382eca5b913ce3121b6ef8656c9c07
  • d3a46569a601f7bdcf08c52c1ce6a464f24ea0d6035d39fa18437b6c940bbc00
  • 4bf225cdc0c238c3ce62538e80d89916562e5eb0b7ed3c988eaf7bb73b29c755
  • 24612734790f3f6ca717a5032967841c609ae6046549b32eb41f771d29f905a2
  • 2b383bb32009d69610ac628adccd9eee4b96f1e5449289991c5149e18497756b
  • 0e297411d10f1e4a0ee9692c268471424d3d570524701f41a065fe7ac3d700e9
  • c95e896eba0879481c44b2f622b6ae140a700984244981b4404ff41210f6c2d3

Citation check

40 of 40 produced items were kept; 5quoted line(s) were checked against the report's own source; nothing was discarded.

What this section does not claim

  • It does not detect anything: the finding set is the input, never an output.
  • It is not a human review. A machine triage is not an audit, and this section is not evidence that the contract is free of defects.
  • An empty or short triage is not evidence of anything either: no finding set here means the analyzers raised nothing on this source.
  • Ordering is one reading of the report, not a verdict on exploitability.

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.

Passed: 3Partial: 5Blocked: 1
  1. Audit intake

    Passed320ms replay2:38 PM

    Normalize the submitted contract target and confirm it can enter the Solidity audit lane.

    Next: Acquire verified source or scan the pasted Solidity source.

  2. Source acquisition

    Passed1.4s replay2:38 PM

    Resolve pasted source or verified explorer source without treating malformed input as demo data.

    Next: Validate the analyzer toolchain against the acquired source.

  3. Toolchain validation

    Partial2.3s replay2:38 PM

    Confirm the configured static analyzers can run and produce parseable output.

    Next: Run static analysis and capture raw detector evidence.

    • One or more analyzers emitted warnings; report findings remain usable but should be read with limitations.
  4. Static analysis

    Partial14 findings8.8s replay2:38 PM

    Run static analyzers against the sandboxed source and collect raw detector evidence.

    Next: Normalize detector output into one deduped finding set.

    • One or more analyzers emitted warnings; report findings remain usable but should be read with limitations.
  5. Finding normalization

    Passed14 findings1.1s replay2:38 PM

    Dedupe detectors, classify vulnerability classes and compute severity-weighted risk.

    Next: Review exploitability conservatively against confidence and limitations.

  6. Exploitability review

    Partial14 findings1.9s replay2:38 PM

    Frame automated findings with conservative exploitability and limitation notes.

    Next: Draft remediation notes from the normalized evidence.

    • Automated exploitability review is conservative and does not replace a manual exploitability assessment.
  7. Remediation draft

    Partial14 findings1.5s replay2:38 PM

    Prepare remediation-oriented evidence for the shareable report artifact.

    Next: Attach an operator review artifact before claiming human review.

    • Remediation notes are generated from detector evidence and require project-specific engineering review.
  8. Operator review

    Blocked0ms replay2:38 PM

    Record whether a human operator artifact exists before buyer escalation.

    Next: Attach a real operator review artifact before claiming human review.

    • No operator review artifact is attached to this automated scan.
    • Human operator review has not been attached to this automated scan yet.
  9. Finalization

    Partial14 findings620ms replay2:38 PM

    Publish the automated report artifact or explain why the scan failed closed.

    Next: Share the report with explicit limitations and review state.

    Artifact: Automated Solidity report · solidity-2f746d702f766567

    • Final report is an automated static-analysis artifact; no operator review artifact is attached.

Report badges

Verified source

Badges describe the evidence carried by this report artifact, not financial value or future pricing. Operator-reviewed is never granted automatically.

How to read this report

Score, confidence, ranking: four moving parts, no hand-tuning.

Generated Sep 24, 2026, 2:38 PM · Solidity · VegaTokenVulnerable.sol

Score bands

  • 0-19

    AVOID-style triage · this report

    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)

    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.

Export and share

  • · Shareable public URL: copy from the report actions panel.
  • · Markdown export: every export carries the report id, target, verdict, generated timestamp, and the public-data disclaimer.
  • · PDF export: not in this MVP. Tracked as a follow-up. The Markdown export contains the same content and prints cleanly to PDF from a browser today.

Source provenance

This report scanned a Solidity source provided directly by the submitter (paste). No on-chain address is associated.

Scanned source (2,036 chars)

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/// @title VegaTokenVulnerable
/// @notice Fictional internal VegaSec self-audit fixture only. Not deployed, not sold, no financial promise.
/// @dev This intentionally unsafe contract exists so VegaSec can prove vulnerable-vs-fixed audit deltas.
contract VegaTokenVulnerable {
    string public constant FIXTURE_SCOPE = "VegaSec fictional internal self-audit fixture";

    mapping(address => uint256) public balances;
    address public owner;
    address public reviewer = 0x1111111111111111111111111111111111111111;
    uint256 public reviewRound;

    constructor() payable {
        owner = msg.sender;
        balances[msg.sender] = 1_000_000;
    }

    receive() external payable {}

    function mintForReview(address account, uint256 amount) external {
        // Intentional issue: tx.origin authorization can be phished through another contract.
        require(tx.origin == owner, "origin owner only");
        balances[account] += amount;
    }

    function unsafeReviewerLottery(address[] calldata reviewers) external returns (address picked) {
        require(reviewers.length > 0, "reviewers required");
        // Intentional issue: block.timestamp is miner/validator-influenced and unsafe as randomness.
        picked = reviewers[block.timestamp % reviewers.length];
        reviewer = picked;
        reviewRound += 1;
    }

    function withdrawReviewCredit(uint256 amount) external {
        require(balances[msg.sender] >= amount, "insufficient credits");
        // Intentional issue: external low-level call before effects enables reentrancy-style drains.
        (bool ok,) = payable(msg.sender).call{value: amount}("");
        require(ok, "transfer failed");
        balances[msg.sender] -= amount;
    }

    function retireFixture() external {
        // Intentional issue: tx.origin gate plus selfdestruct is unsafe and should never ship.
        require(tx.origin == owner, "origin owner only");
        selfdestruct(payable(owner));
    }
}

Public-data disclaimer

Solidity scans are triage based on slither + semgrep static analysis. Output is not a certification, audit attestation or financial advice. Findings can include false positives and may miss patterns the configured detectors do not cover.