Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tintinweb/smart-contract-vulndb
🍋 An open dataset containing smart contract audit issues from various sources.
https://github.com/tintinweb/smart-contract-vulndb
smart-contract-security vulnerabilities
Last synced: 1 day ago
JSON representation
🍋 An open dataset containing smart contract audit issues from various sources.
- Host: GitHub
- URL: https://github.com/tintinweb/smart-contract-vulndb
- Owner: tintinweb
- Created: 2023-06-22T13:03:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-21T13:47:39.000Z (10 months ago)
- Last Synced: 2024-12-26T00:08:00.576Z (8 days ago)
- Topics: smart-contract-security, vulnerabilities
- Language: JavaScript
- Homepage: https://tintinweb.github.io/smart-contract-vulndb/
- Size: 63.7 MB
- Stars: 193
- Watchers: 3
- Forks: 19
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://thecreed.xyz/)
[[ 🌐 ](https://thecreed.xyz/)[ 🫂 ](https://community.thecreed.xyz/c/start-here)]# Smart Contract VulnDB
An open dataset of publicly available smart contract issues aggregated from various audit reports. The dataset can be accessed at 🌻 [vulns.json](dataset/vulns.json), is updated once a day, and a live demo is available 🌐 [here](https://tintinweb.github.io/smart-contract-vulndb/
).
LMK if you're building cool things with this dataset and I'll list them here 😊🙏## 🔸 DataSet
⚠️ NOTE: Breaking Change due to [GIT Large File Policy](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github#file-size-limits)
Switching from one big `vulns.json` to files a 25k issues `vulns-1.json`, `vulns-2.json`, ...[](https://github.com/tintinweb/smart-contract-vulndb/blob/main/dataset/vulns.json)
```typescript
const issue: Issue = {
title: "",
severity: Severity.Medium,
body: "",
dataSource: {
name: "",
repo: "",
url: ""
}
};
```To work around [GitHub File Size Limits](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github#file-size-limits) we'll split the database into equal files of 25k issues
* [vulns-1.json](dataset/vulns-1.json) - a 25k issues
* [vulns-2.json](dataset/vulns-2.json)## 🔸 Live Demo
[](https://tintinweb.github.io/smart-contract-vulndb/)
* [Demo](https://tintinweb.github.io/smart-contract-vulndb/)
## 🔸 Accessing the Latest Snapshot
- Shell
```
⇒ curl https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-1.json
⇒ curl https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-2.json
```- JavaScript
```javascript
const all_issues = []
for(let idx=1; idx<10; idx++){
try {
const all = await (await fetch(`https://tintinweb.github.io/smart-contract-vulndb/cache/vulns-${idx}.json`)).text();
for(let line of all.split("\n")){
if(line.trim().length == 0){
continue;
}
try{
all_issues.push(JSON.parse(line))
} catch(e){
console.log(line)
throw e
}
}
} catch (e){
console.log(e)
break;
}
}
```- JavaScript Local
```javascript
const fs = require("fs")
let issues = [];
for(let idx=1; idx<10; idx++){
if(!fs.existsSync(`./dataset/vulns-${idx}.json`)) {
break;
}
const data = fs.readFileSync(`./dataset/vulns-${idx}.json`, "utf-8");
const part = data.split('\n').filter(l => l.trim().length > 0).map(l => JSON.parse(l))
issues = [...issues, ...part]
}
console.log(issues.length)
// 39125
[... new Set(issues.map(i => i.severity))]
/*
[
'medium', 'minor',
null, 'major',
'critical', undefined,
'info'
]
*/
```- [NodeJs](./examples/javascript/example.js)
- [TypeScript](./examples/typescript/example.ts)
- [Python](./examples/python/example.py)## 🤓 For Nerds
First, run the development server:
```bash
npm run dev
# or
yarn dev
```Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
## 🎓 Citation
If you are using this dataset in your research and paper, here's how you can cite this dataset:
- APA6
```
Ortner, M. (n.d.). Smart Contract VulnDB. Retrieved from https://github.com/tintinweb/smart-contract-vulndb.
```- LateX (Bib)
```
@article{smart_contract_vulndb,
title={Smart Contract VulnDB},
url={https://github.com/tintinweb/smart-contract-vulndb},
author={Ortner, Martin}}
```