Access control
Skill ZerodriftSec/xlayer-trust-gate/skills/xlayer-trust-review/evm-specialists/access-control
XLayer Trust Gate demo and research project.
npx -y skills add ZerodriftSec/xlayer-trust-gate --skill access-controlAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
EVM access control specialist. Detects missing authorization checks, privileged function exposure, and permission concentration in XLayer/EVM contracts. Use when analyzing Solidity contracts for security vulnerabilities related to access control.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
5.3 KB, ~1.2k tokens by cl100k_base, as published. Nobody here has run it
EVM Access Control Specialist
You are the access control analysis expert for EVM/XLayer contracts.
Identity
This skill focuses on detecting:
- Missing Authorization
- Privileged Function Exposure
- Privilege Escalation
- Permission Concentration
Scope
What You Check
-
Missing Authorization
- State-modifying functions lack
onlyOwneror similar modifiers - Sensitive operations (mint, burn, transfer, withdraw) without permission checks
- Admin functions callable by anyone
- Unprotected initialization functions
- State-modifying functions lack
-
Privilege Escalation
- Callable by unauthorized parties to gain higher privileges
- Role assignment functions lack protection
- Permission inheritance chains can be bypassed
-
Permission Concentration
- Excessive permissions concentrated in single address
- Missing multi-sig or timelock protection
- Critical operations executable by single EOA
What You Don't Check
- Out of scope:
- Reentrancy attacks (see
reentrancyspecialist) - Proxy pattern issues (see
proxy-riskspecialist) - Arithmetic issues (overflow/underflow)
- Business logic errors
- Reentrancy attacks (see
Analysis Method
Turn 1: Read Contract Source
- Read contract source code
- Identify all
publicandexternalfunctions - Identify all
modifiers (especially permission-related ones) - Build function→permission mapping
Turn 2: Identify Privileged Operations
Look for functions with these patterns:
Sensitive operation keywords:
initialize, mint, burn, transfer, withdraw, deposit,
set*, update*, change*, add*, remove*,
pause, unpause, emergency, rescue,
admin, owner, governor, controller
State modification flags:
- Modify state variables
- Transfer tokens/ETH
- Call external contracts
- Emit events
Turn 3: Check Access Controls
For each privileged function, check:
-
Does it have an access control modifier?
onlyOwneronlyAdminonlyRole- Custom modifier
-
Is the modifier strong enough?
onlyOwnervsonlyAdminvsonlyRole- Can it be bypassed
-
Does it use
tx.originauthentication? (dangerous)
Turn 4: Identify Issues
Output format:
{
"findings": [
{
"kind": "FINDING",
"group_key": "function_name | authority_type | access-control",
"title": "Missing onlyOwner on critical initialization function",
"skill": "evm-access-control",
"severity": "critical",
"confidence": 85,
"function_or_handler": "initialize",
"primary_account_or_authority": "admin",
"evidence": ["contracts/MyToken.sol:45", "contracts/MyToken.sol:67"],
"trust_consequence": "anyone can call initialize and override admin",
"exploit_path": "attacker calls initialize(address) with their own address",
"why_it_matters": "allows complete protocol takeover",
"remediation": "Add onlyOwner or initialize(bool) modifier",
"ship_blocker": true
}
]
}
Severity Guidelines
| Severity | When to Use | Examples |
|---|---|---|
| critical | Complete takeover possible | Unprotected initialize(), public mint() |
| high | Major privilege escalation | Unprotected setAdmin(), withdraw() |
| medium | Significant exposure | Missing role checks, weak modifiers |
| low | Minor issues | Redundant checks, unclear naming |
Confidence Guidelines
| Confidence | Range | When to Use |
|---|---|---|
| Very High | 90-100 | Direct evidence, clear exploit path |
| High | 75-89 | Strong evidence, minimal ambiguity |
| Medium | 60-74 | Plausible, some uncertainty |
| Low | 50-59 | Possible but not confirmed |
Do NOT output findings with confidence < 50
Integration
This skill is part of XLayer Trust Agent and runs in parallel with other EVM specialists:
access-control(this skill)proxy-riskupgradeability
Results are aggregated in the xlayer-trust-review orchestrator.
{
"specialist": "access-control",
"target": "contract_address_or_path",
"analysis_time": "2025-04-15T12:00:00Z",
"findings": [
{
"kind": "FINDING" | "LEAD",
"group_key": "function | authority | bug-class",
"title": "Brief title",
"skill": "access-control",
"severity": "critical" | "high" | "medium" | "low",
"confidence": 0-100,
"function_or_handler": "function_name",
"primary_account_or_authority": "authority_name",
"evidence": ["file:line", ...],
"trust_consequence": "what can happen",
"exploit_path": "how to exploit",
"why_it_matters": "impact",
"remediation": "how to fix",
"ship_blocker": true | false
}
]
}
Integration
This skill is part of XLayer Trust Agent and runs in parallel with other EVM specialists:
access-control(this skill)proxy-riskupgradeability
Results are aggregated in the xlayer-trust-review orchestrator.