Skip to content

Instantly share code, notes, and snippets.

@monperrus
Created May 21, 2024 08:29
Show Gist options
  • Save monperrus/ca0272f295c6e6b667e0fcfeab2f33ce to your computer and use it in GitHub Desktop.
Save monperrus/ca0272f295c6e6b667e0fcfeab2f33ce to your computer and use it in GitHub Desktop.
curl 'https://www.computer.org/csdl/api/v1/graphql' -X POST --data-raw '{"variables":{"articleId":"1WXSS1AygtG"},"query":"query ($articleId: String!) {\n issue: periodicalIssueByArticleId(articleId: $articleId) {\n id\n title\n year\n issueNum\n idPrefix\n pubType\n volume\n year\n label\n downloadables {\n hasCover\n __typename\n }\n __typename\n }\n article: articleById(articleId: $articleId) {\n id\n doi\n abstract\n abstracts {\n abstractType\n content\n __typename\n }\n normalizedAbstract\n title\n normalizedTitle\n fno\n hasPdf\n idPrefix\n keywords\n authors {\n givenName\n surname\n fullName\n affiliation\n __typename\n }\n replicability {\n isEnabled\n codeDownloadUrl\n codeRepositoryUrl\n __typename\n }\n showBuyMe\n showRecommendedArticles\n isOpenAccess\n issueNum\n pubDate\n pubType\n pages\n year\n issn\n isbn\n notes\n notesType\n __typename\n }\n recommendedArticles: recommendedArticlesById(articleId: $articleId) {\n id\n title\n doi\n abstractUrl\n parentPublication {\n id\n title\n __typename\n }\n __typename\n }\n adjacentArticles: adjacentArticles(articleId: $articleId) {\n previous {\n fno\n articleId\n __typename\n }\n next {\n fno\n articleId\n __typename\n }\n __typename\n }\n webExtras: webExtrasByArticleId(articleId: $articleId) {\n id\n name\n location\n extension\n size\n __typename\n }\n articleVideos: videosByArticleId(articleId: $articleId) {\n id\n videoExt\n videoType {\n featured\n recommended\n sponsored\n __typename\n }\n article {\n id\n fno\n issueNum\n pubType\n volume\n year\n idPrefix\n doi\n title\n __typename\n }\n channel {\n id\n title\n status\n featured\n defaultVideoId\n category {\n id\n title\n type\n __typename\n }\n __typename\n }\n year\n title\n description\n keywords {\n id\n title\n status\n __typename\n }\n speakers {\n firstName\n lastName\n affiliation\n __typename\n }\n created\n updated\n imageThumbnailUrl\n runningTime\n aspectRatio\n metrics {\n views\n likes\n __typename\n }\n notShowInVideoLib\n __typename\n }\n}"}'
{
"data" : {
"adjacentArticles" : {
"__typename" : "AdjacentArticlesType",
"next" : {
"__typename" : "AdjacentArticleType",
"articleId" : "1X6br3Cdwnm",
"fno" : "10535119"
},
"previous" : {
"__typename" : "AdjacentArticleType",
"articleId" : "1WWe2j1YjL2",
"fno" : "10530516"
}
},
"article" : {
"__typename" : "ArticleType",
"abstract" : "The blockchain has been the main computing scenario for smart contracts, and the decentralized infrastructure of the blockchain is effectively implemented in a de-trusted and executable environment. However, vulnerabilities in smart contracts are particularly vulnerable to exploitation by malicious attackers and have always been a key issue in blockchain security. Existing traditional tools are inefficient in detecting vulnerabilities and have a high rate of false positives when detecting contracts. Some neural network methods have improved the detection efficiency, but they are not competent for fine-grained (code line level) vulnerability detection. We proposes the ContractCheck model for detecting contract vulnerabilities based on neural network methods. ContractCheck extracts fine-grained segments from the abstract syntax tree (AST) and function call graph of smart contract source code. Furthermore, the segments are parsed into token flow retaining semantic information as uint, which are used to generate numerical vector sequences that can be trained using neural network methods. We conduct multiple rounds of experiments using a dataset constructed from 36,885 smart contracts and identified the optimal ContractCheck model structure by employing the Fasttext embedding vector algorithm and constructing a composite model using CNN and BiGRU for training the network. Evaluation on other datasets demonstrates that ContractCheck exhibits significant improvement in contract-level detection performance compared to other methods, with an increase of 23.60% in F1 score over the best existing method. Particularly, it achieves fine-grained detection based on neural network methods. The cases provided indicate that ContractCheck can effectively assist developers in accurately locating the presence of vulnerabilities, thereby enhancing the security of Ethereum smart contracts.",
"abstracts" : [
{
"__typename" : "ArticleAbstractType",
"abstractType" : "Regular",
"content" : "The blockchain has been the main computing scenario for smart contracts, and the decentralized infrastructure of the blockchain is effectively implemented in a de-trusted and executable environment. However, vulnerabilities in smart contracts are particularly vulnerable to exploitation by malicious attackers and have always been a key issue in blockchain security. Existing traditional tools are inefficient in detecting vulnerabilities and have a high rate of false positives when detecting contracts. Some neural network methods have improved the detection efficiency, but they are not competent for fine-grained (code line level) vulnerability detection. We proposes the ContractCheck model for detecting contract vulnerabilities based on neural network methods. ContractCheck extracts fine-grained segments from the abstract syntax tree (AST) and function call graph of smart contract source code. Furthermore, the segments are parsed into token flow retaining semantic information as uint, which are used to generate numerical vector sequences that can be trained using neural network methods. We conduct multiple rounds of experiments using a dataset constructed from 36,885 smart contracts and identified the optimal ContractCheck model structure by employing the Fasttext embedding vector algorithm and constructing a composite model using CNN and BiGRU for training the network. Evaluation on other datasets demonstrates that ContractCheck exhibits significant improvement in contract-level detection performance compared to other methods, with an increase of 23.60% in F1 score over the best existing method. Particularly, it achieves fine-grained detection based on neural network methods. The cases provided indicate that ContractCheck can effectively assist developers in accurately locating the presence of vulnerabilities, thereby enhancing the security of Ethereum smart contracts."
}
],
"authors" : [
{
"__typename" : "ArticleAuthorType",
"affiliation" : "School of Automation Science and Engineering, South China University of Technology, Guangzhou, China",
"fullName" : "Xite Wang",
"givenName" : "Xite",
"surname" : "Wang"
},
{
"__typename" : "ArticleAuthorType",
"affiliation" : "School of Automation Science and Engineering, South China University of Technology, Guangzhou, China",
"fullName" : "Senping Tian",
"givenName" : "Senping",
"surname" : "Tian"
},
{
"__typename" : "ArticleAuthorType",
"affiliation" : "School of Automation Science and Engineering, South China University of Technology, Guangzhou, China",
"fullName" : "Wei Cui",
"givenName" : "Wei",
"surname" : "Cui"
}
],
"doi" : "10.1109/TSE.2024.3400294",
"fno" : "10531111",
"hasPdf" : true,
"id" : "1WXSS1AygtG",
"idPrefix" : "ts",
"isOpenAccess" : false,
"isbn" : null,
"issn" : "0098-5589",
"issueNum" : "01",
"keywords" : [
"Smart Contracts",
"Codes",
"Blockchains",
"Neural Networks",
"Semantics",
"Security",
"Vectors",
"Smart Contract",
"Blockchain Security",
"Vulnerability Detection",
"Neural Network"
],
"normalizedAbstract" : "The blockchain has been the main computing scenario for smart contracts, and the decentralized infrastructure of the blockchain is effectively implemented in a de-trusted and executable environment. However, vulnerabilities in smart contracts are particularly vulnerable to exploitation by malicious attackers and have always been a key issue in blockchain security. Existing traditional tools are inefficient in detecting vulnerabilities and have a high rate of false positives when detecting contracts. Some neural network methods have improved the detection efficiency, but they are not competent for fine-grained (code line level) vulnerability detection. We proposes the ContractCheck model for detecting contract vulnerabilities based on neural network methods. ContractCheck extracts fine-grained segments from the abstract syntax tree (AST) and function call graph of smart contract source code. Furthermore, the segments are parsed into token flow retaining semantic information as uint, which are used to generate numerical vector sequences that can be trained using neural network methods. We conduct multiple rounds of experiments using a dataset constructed from 36,885 smart contracts and identified the optimal ContractCheck model structure by employing the Fasttext embedding vector algorithm and constructing a composite model using CNN and BiGRU for training the network. Evaluation on other datasets demonstrates that ContractCheck exhibits significant improvement in contract-level detection performance compared to other methods, with an increase of 23.60% in F1 score over the best existing method. Particularly, it achieves fine-grained detection based on neural network methods. The cases provided indicate that ContractCheck can effectively assist developers in accurately locating the presence of vulnerabilities, thereby enhancing the security of Ethereum smart contracts.",
"normalizedTitle" : "ContractCheck: Checking Ethereum Smart Contracts in Fine-Grained Level",
"notes" : null,
"notesType" : null,
"pages" : "1-19",
"pubDate" : "2024-05-01",
"pubType" : "trans",
"replicability" : null,
"showBuyMe" : true,
"showRecommendedArticles" : true,
"title" : "ContractCheck: Checking Ethereum Smart Contracts in Fine-Grained Level",
"year" : "5555"
},
"articleVideos" : [],
"issue" : {
"__typename" : "PeriodicalIssue",
"downloadables" : {
"__typename" : "PeriodicalIssueDownloadablesType",
"hasCover" : false
},
"id" : "12OmNxvwoOe",
"idPrefix" : "ts",
"issueNum" : "01",
"label" : "PrePrints",
"pubType" : "journal",
"title" : "PrePrints",
"volume" : null,
"year" : "5555"
},
"recommendedArticles" : [
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/ase/2021/033700a630/1AjTfp9cYrS",
"doi" : null,
"id" : "proceedings/ase/2021/0337/0/033700a630",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/ase/2021/0337/0",
"title" : "2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE)"
},
"title" : "Characterizing Transaction-Reverting Statements in Ethereum Smart Contracts"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/secdev/2022/718200a003/1J6hlHoyb4c",
"doi" : null,
"id" : "proceedings/secdev/2022/7182/0/718200a003",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/secdev/2022/7182/0",
"title" : "2022 IEEE Secure Development Conference (SecDev)"
},
"title" : "Tutorial: Analyzing, Exploiting, and Patching Smart Contracts in Ethereum"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/wetseb/2023/019200a009/1P9jfcwBO6I",
"doi" : null,
"id" : "proceedings/wetseb/2023/0192/0/019200a009",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/wetseb/2023/0192/0",
"title" : "2023 IEEE/ACM 6th International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB)"
},
"title" : "TODLER: A Transaction Ordering Dependency anaLyzER - for Ethereum Smart Contracts"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/blockchain/2023/192900a047/1U85J7vefL2",
"doi" : null,
"id" : "proceedings/blockchain/2023/1929/0/192900a047",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/blockchain/2023/1929/0",
"title" : "2023 IEEE International Conference on Blockchain (Blockchain)"
},
"title" : "Statically Checking Missing Input Validations in Solidity Smart Contracts - A Case Study"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/bigcom/2023/312400a103/1UlmSANIEb6",
"doi" : null,
"id" : "proceedings/bigcom/2023/3124/0/312400a103",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/bigcom/2023/3124/0",
"title" : "2023 9th International Conference on Big Data Computing and Communications (BigCom)"
},
"title" : "EOSVERIF: An Automated Analyzer for EOSIO Smart Contracts"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/sp/2024/313000a220/1WPcYKIy2NG",
"doi" : null,
"id" : "proceedings/sp/2024/3130/0/313000a220",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/sp/2024/3130/0/",
"title" : "2024 IEEE Symposium on Security and Privacy (SP)"
},
"title" : "Large-Scale Study of Vulnerability Scanners for Ethereum Smart Contracts"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/journal/ts/2021/12/08979435/1h7zqKhSMne",
"doi" : null,
"id" : "trans/ts/2021/12/08979435",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "trans/ts",
"title" : "IEEE Transactions on Software Engineering"
},
"title" : "Checking Smart Contracts With Structural Code Embedding"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/iwbose/2020/09050260/1iES4PuwIs8",
"doi" : null,
"id" : "proceedings/iwbose/2020/6278/0/09050260",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/iwbose/2020/6278/0",
"title" : "2020 IEEE International Workshop on Blockchain Oriented Software Engineering (IWBOSE)"
},
"title" : "Reentrancy Vulnerability Identification in Ethereum Smart Contracts"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/proceedings-article/sp/2021/893400a982/1t0x8RwfKog",
"doi" : null,
"id" : "proceedings/sp/2021/8934/0/893400a982",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "proceedings/sp/2021/8934/0/",
"title" : "2021 IEEE Symposium on Security and Privacy (SP)"
},
"title" : "SGUARD: Towards Fixing Vulnerable Smart Contracts Automatically"
},
{
"__typename" : "RecommendedArticleType",
"abstractUrl" : "/journal/ts/2022/11/09591399/1y2FAAqvBjG",
"doi" : null,
"id" : "trans/ts/2022/11/09591399",
"parentPublication" : {
"__typename" : "ParentPublication",
"id" : "trans/ts",
"title" : "IEEE Transactions on Software Engineering"
},
"title" : "Aroc: An Automatic Repair Framework for On-Chain Smart Contracts"
}
],
"webExtras" : []
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment