Registry / testing / solium-plugin-security

solium-plugin-security

JSON →
library0.1.1jsnpmunverified

Official security lint plugin for Solium (Solidity linter). Version 0.1.1, last updated in 2018. Provides ~20 security-focused rules derived from Consensys Smart Contract Best Practices and community wishlist. Key differentiators: pre-installed with Solium v1.0.1+, includes rules like no-throw, no-tx-origin, enforce-explicit-visibility, and no-inline-assembly. Rule severities adjustable, some disabled by default (e.g., no-var, enforce-loop-bounds in 0.1.1). Automatic fixing available for no-throw and enforce-explicit-visibility. Designed for Solium v1.0.x ecosystem only.

npm install solium-plugin-security
INSTALL
IMPORT
SIG · SOLIUM-PLUGIN-SECU
S
solium-plugin-security
testingjavascriptv0.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

soliumPluginSecurity (npm package)
Install as global dependency: npm install -g solium-plugin-security
This is an npm package, not a JavaScript module. It extends Solium's .soliumrc.json config.
soliumrc.json configuration
"plugins": ["security"]
"plugin": "security" (singular, not array)
Add 'security' to plugins array in soliumrc.json. No ESM/CJS import.
Enable specific rule
"rules": { "security/no-throw": "warning" }
"rules": { "no-throw": "warning" } (missing plugin prefix)
Rules must be prefixed with 'security/' to avoid conflicts with core Solium rules.

Example soliumrc.json configuration enabling 10 security rules with recommended severities, disabling two disruptive rules.

{ "extends": "solium:all", "plugins": ["security"], "rules": { "security/no-throw": "warning", "security/no-tx-origin": "error", "security/enforce-explicit-visibility": "error", "security/no-block-members": ["warning", ["blockhash", "timestamp"]], "security/no-call-value": "warning", "security/no-assign-params": "error", "security/no-fixed": "error", "security/no-inline-assembly": "warning", "security/no-low-level-calls": ["warning", ["call", "callcode", "delegatecall"]], "security/no-modify-for-iter-var": "warning", "security/enforce-loop-bounds": "off", "security/no-var": "off" } }
solium --version
Debug
Known issues
breakingPlugin requires Solium v1.0.x and is incompatible with Solium v0.x or v2.x
fix
Use Solium v1.0.0 to v1.0.9. For newer Solium versions, use a different security plugin.
affects: >=0.1.0
deprecatedSolium project itself is deprecated since 2020; no further updates expected
fix
Migrate to solhint or slither for Solidity linting and security analysis.
affects: >=0.1.0
gotchaRules without explicit prefix 'security/' are shared with core Solium rules, causing potential conflicts
fix
Always prefix plugin rules with 'security/' (e.g., 'security/no-throw').
affects: >=0.1.0
breakingIn v0.1.1, rules 'no-var' and 'enforce-loop-bounds' are disabled by default due to disruption
fix
Explicitly enable them in .soliumrc.json if needed: 'security/no-var': 'warning'
affects: >=0.1.1
gotchaPlugin must be installed globally with -g flag; local install fails silently
fix
Install with `npm install -g solium-plugin-security`
affects: >=0.1.0
Errors
Common errors & fixes
Plugin 'security' not found. Make sure solium-plugin-security is installed.
Plugin not installed or installed locally instead of globally.
fix
Run `npm install -g solium-plugin-security` and ensure Solium is also installed globally.
Rule 'security/no-throw' is not defined in any plugin.
Missing 'security' plugin in soliumrc.json plugins array.
fix
Add "plugins": ["security"] to soliumrc.json.
Cannot find module 'solium-plugin-security'
Plugin is not installed or Node cannot resolve it.
fix
Global install: `npm install -g solium-plugin-security`. For local project, use `npm install --save-dev solium-plugin-security` (but prefer global).
Upgrade
Version history
0.1.1latest on npm
Audit
Dependencies
soliumrequiredPeer dependency; plugin only works with Solium v1.0.x linter
Agent activity
5 hits · last 30 days
node
4
Resources
solium-plugin-security — npm install solium-plugin-security · libregistry