rust-lang / rust-lang/rust-clippy
Figure out which Common Weakness Enumerations Rust or Clippy eliminates or mitgates
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 13.5k
- Forks
- 2.2k
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 32
Description
The top 25 can be found here: http://cwe.mitre.org/top25/index.html
The next 16 candidates for the top 25 are here: http://cwe.mitre.org/top25/archive/2011/2011_onthecusp.html
I made a list out of them. Check the box if solved, move into the other list if mitgated
Unreviewed and Solved issues
- Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
- solution: detect
format!containing SQL code, or simply strings containing it and suggestdieselor sth.
- solution: detect
- Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- solution: trace the source of strings given as arguments, env vars or executable. E-hard
- Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- Missing Authentication for Critical Function
- Missing Authorization
- Use of Hard-coded Credentials
- impossible to fix for creative cases, but easy in case we just check for common variable names (
password,pw,pwd,passwd, ...) being checked against a statically available information.
- impossible to fix for creative cases, but easy in case we just check for common variable names (
- Missing Encryption of Sensitive Data
- Unrestricted Upload of File with Dangerous Type
- Reliance on Untrusted Inputs in a Security Decision
- requires taint analysis and marking branches as a "security decision"
- Execution with Unnecessary Privileges
- Cross-Site Request Forgery (CSRF)
- Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
- taint analysis +
Path,PathBuf
- taint analysis +
- Download of Code Without Integrity Check
- Incorrect Authorization
- Inclusion of Functionality from Untrusted Control Sphere
- Incorrect Permission Assignment for Critical Resource
- Use of a Broken or Risky Cryptographic Algorithm
- E-easy: blacklist things named after said algorithms
- Improper Restriction of Excessive Authentication Attempts
- URL Redirection to Untrusted Site ('Open Redirect')
- Use of a One-Way Hash without a Salt
- E-hard, need to look at rust-impls of hash functions to get a feel for this.
- Allocation of Resources Without Limits or Throttling
- Use of Insufficiently Random Values
- Improper Cross-boundary Removal of Sensitive Data
- Improper Enforcement of Behavioral Workflow
- Information Exposure Through an Error Message
- Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
(note: Only solved for data races. - Uncontrolled Format String
- Inappropriate Encoding for Output Context
- Incorrect Conversion between Numeric Types
- Missing Release of Resource after Effective Lifetime
- Buffer Copy without Checking Size of Input ('Classic Buffer Overflow')
- Use of Potentially Dangerous Function
- solved in my opinion (@oli-obk), slap an
unsafeonto the function if it is that dangerous - move to partially resolved if you disagree, we've had things like
Cstring::from_str("").as_ptr()
- solved in my opinion (@oli-obk), slap an
- Incorrect Calculation of Buffer Size
- Integer Overflow or Wraparound
- Improper Validation of Array Index
- Buffer Access with Incorrect Length Value
- Expired Pointer Dereference
- Missing Initialization
- Untrusted Pointer Dereference
- NULL Pointer Dereference
Reviewed issues found to not be fully solved
- Improper Check for Unusual or Exceptional Conditions
- partially solved by
Result+Option. Panics can still occur.
- partially solved by
Unsolvable issues (please supply reason)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CWE Top 25 and on-the-cusp links in the issue, then review the listed solved, unreviewed, and partially solved entries. Determine which weaknesses Rust or Clippy actually eliminates or mitigates, and document the reason for each classification. Done means the list is reviewed with unresolved cases and limitations clearly identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- security, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100