코드 속성 그래프
Code property graph코드 속성 그래프(, CPG)는 속성 그래프에서 구문 구조, 제어 흐름 및 데이터 종속성을 캡처하는 컴퓨터 프로그램 표현입니다.이 개념은 원래 C와 C++ 시스템 [1]코드에서 보안 취약점을 식별하기 위해 도입되었지만, 이후 웹 애플리케이션,[2][3][4][5] 클라우드 [6]배포 및 스마트 [7]계약을 분석하는 데 사용되었습니다.코드 속성 그래프는 취약성 검색 외에도 코드 클론 탐지,[8][9] 공격-표면 탐지,[10] 익스플로잇 생성,[11] 코드 테스트 [12]가능성 측정 [13]및 보안 패치의 백포팅에서 응용 프로그램을 찾습니다.
정의.
프로그램의 코드 속성 그래프는 문 및 술어 노드에서 추상 구문 트리(AST), 제어 흐름 그래프(CFG) 및 프로그램 종속성 그래프(PDG)를 병합하여 얻은 프로그램의 그래프 표현입니다.결과 그래프는 속성 그래프로, Neo4j, JanusGraph 및 OrientDB와 같은 그래프 데이터베이스의 기본 그래프 모델로, 노드와 에지에 데이터가 키-값 쌍으로 저장됩니다.실제로 코드 속성 그래프는 그래프 데이터베이스에 저장되고 그래프 쿼리 언어를 사용하여 쿼리할 수 있습니다.
예
C 프로그램의 기능을 고려합니다.
무효의 푸() { 인트 x = 원천(); 한다면 (x < 맥스.) { 인트 y = 2 * x; 가라앉다(y); } } 함수의 코드 속성 그래프는 다음 그림과 같이 구문의 추상 트리, 제어 흐름 그래프 및 프로그램 의존성 그래프를 문과 술어로 병합하여 얻을 수 있습니다.
구현
존 CPG.원래 코드 속성 그래프는 2013년 괴팅겐 대학교에서 오픈 소스 코드 분석 도구 [14]Joern의 일부로 C/C++용으로 구현되었습니다.이 원본 버전은 중단되었고 여러 프로그래밍 언어에 적용할 수 있는 공식 코드[16] 속성 그래프 사양을 제공하는 오픈 소스 [15]Joern Project로 대체되었습니다.이 프로젝트는 C/C++, Java, Java 바이트코드, Kotlin, Python, JavaScript, TypeScript, LLVM 비트코드 및 x86 바이너리(Ghidra 디스어셈블러를 통해)에 대한 코드 속성 그래프 생성기를 제공합니다.
플룸 CPG.2020년에 스텔렌보쉬 대학교에서 개발되고 아마존 사이언스가 후원하는 오픈 소스[17] 플룸 프로젝트는 Joern 프로젝트에서 제공하는 코드 속성 그래프 사양과 호환되는 자바 바이트 코드에 대한 코드 속성 그래프를 제공합니다.두 프로젝트는 2021년에 합병되었습니다.
프라운호퍼 AIESEC CPG.Fraunhofer Institute for Applied and Integrated Security [는 C/C++, Java, Golang 및 [18]Python에 대한 오픈 소스 코드 속성 그래프 생성기를 제공하지만, 공식 스키마 사양은 제공하지 않습니다.또한 클라우드 배포의 세부 정보를 모델링하는 코드 속성 그래프 개념의 확장인 클라우드 속성 [19]그래프도 제공합니다.
LLVM에 대한 Galois의 CPG.Galois Inc.는 LLVM [20]컴파일러를 기반으로 하는 코드 속성 그래프를 제공합니다.그래프는 컴파일의 다른 단계에 있는 코드와 이러한 표현 사이의 매핑을 나타냅니다.문서에 정의된 사용자 정의 스키마를 따릅니다.
코드 속성 그래프에 대한 기계 학습
코드 속성 그래프는 취약성 발견에 대한 몇 가지 기계 학습 기반 접근 방식의 기초를 제공합니다.특히, 그래프 신경망(GNN)은 취약성 [21][22][23][24][25][26][27]탐지기를 도출하기 위해 사용되었습니다.
참고 항목
- 추상 구문 트리(AST)
- 제어 흐름 그래프(CFG)
- 프로그램 종속성 그래프(PDG)
- 그래프 데이터베이스
레퍼런스
- ^ Yamaguchi, Fabian; Golde, Nico; Arp, Daniel; Rieck, Konrad (May 2014). "Modeling and Discovering Vulnerabilities with Code Property Graphs". 2014 IEEE Symposium on Security and Privacy. pp. 590–604. doi:10.1109/SP.2014.44. ISBN 978-1-4799-4686-0. S2CID 2231082.
- ^ Backes, Michael; Rieck, Konrad; Skoruppa, Malte; Stock, Ben; Yamaguchi, Fabian (April 2017). "Efficient and Flexible Discovery of PHP Application Vulnerabilities". 2017 IEEE European Symposium on Security and Privacy (EuroS&P). pp. 334–349. doi:10.1109/EuroSP.2017.14. ISBN 978-1-5090-5762-7. S2CID 206649536.
- ^ Li, Song; Kang, Mingqing; Hou, Jianwei; Cao, Yinzhi (2022). Mining Node.js Vulnerabilities via Object Dependence Graph and Query. pp. 143–160. ISBN 9781939133311.
- ^ Brito, Tiago; Lopes, Pedro; Santos, Nuno; Santos, José Fragoso (1 July 2022). "Wasmati: An efficient static vulnerability scanner for WebAssembly". Computers & Security. 118: 102745. arXiv:2204.12575. doi:10.1016/j.cose.2022.102745. S2CID 248405811.
- ^ Khodayari, Soheil; Pellegrino, Giancarlo (2021). JAW: Studying Client-side CSRF with Hybrid Property Graphs and Declarative Traversals. pp. 2525–2542. ISBN 9781939133243.
- ^ Banse, Christian; Kunz, Immanuel; Schneider, Angelika; Weiss, Konrad (September 2021). "Cloud Property Graph: Connecting Cloud Security Assessments with Static Code Analysis". 2021 IEEE 14th International Conference on Cloud Computing (CLOUD). pp. 13–19. arXiv:2206.06938. doi:10.1109/CLOUD53861.2021.00014. ISBN 978-1-6654-0060-2. S2CID 243946828.
- ^ Giesen, Jens-Rene; Andreina, Sebastien; Rodler, Michael; Karame, Ghassan; Davi, Lucas. "Practical Mitigation of Smart Contract Bugs TeraFlow". www.teraflow-h2020.eu.
- ^ Wi, Seongil; Woo, Sijae; Whang, Joyce Jiyoung; Son, Sooel (25 April 2022). "HiddenCPG: Large-Scale Vulnerable Clone Detection Using Subgraph Isomorphism of Code Property Graphs". Proceedings of the ACM Web Conference 2022: 755–766. doi:10.1145/3485447.3512235. ISBN 9781450390965. S2CID 248367462.
- ^ Bowman, Benjamin; Huang, H. Howie (September 2020). "VGRAPH: A Robust Vulnerable Code Clone Detection System Using Code Property Triplets". 2020 IEEE European Symposium on Security and Privacy (EuroS&P). pp. 53–69. doi:10.1109/EuroSP48549.2020.00012. ISBN 978-1-7281-5087-1. S2CID 226268429.
- ^ Du, Xiaoning; Chen, Bihuan; Li, Yuekang; Guo, Jianmin; Zhou, Yaqin; Liu, Yang; Jiang, Yu (May 2019). "LEOPARD: Identifying Vulnerable Code for Vulnerability Assessment Through Program Metrics". 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE). pp. 60–71. arXiv:1901.11479. doi:10.1109/ICSE.2019.00024. ISBN 978-1-7281-0869-8. S2CID 59523689.
- ^ Alhuzali, Abeer; Gjomemo, Rigel; Eshete, Birhanu; Venkatakrishnan, V. N. (2018). NAVEX: Precise and Scalable Exploit Generation for Dynamic Web Applications. pp. 377–392. ISBN 9781939133045.
- ^ Al Kassar, Feras; Clerici, Giulia; Compagna, Luca; Balzarotti, Davide; Yamaguchi, Fabian. "Testability Tarpits: the Impact of Code Patterns on the Security Testing of Web Applications – NDSS Symposium". NDSS Symposium.
- ^ Shi, Youkun; Zhang, Yuan; Luo, Tianhan; Mao, Xiangyu; Cao, Yinzhi; Wang, Ziwen; Zhao, Yudi; Huang, Zongan; Yang, Min (2022). Backporting Security Patches of Web Applications: A Prototype Design and Implementation on Injection Vulnerability Patches. pp. 1993–2010. ISBN 9781939133311.
- ^ "Joern - A Robust Code Analysis Platform for C/C++". www.mlsec.org.
- ^ "Joern - The Bug Hunter's Workbench". Joern - The Bug Hunter's Workbench.
- ^ "Code Property Graph Specification". cpg-spec.github.io.
- ^ "Plume". plume-oss.github.io.
- ^ "Code Property Graph". Fraunhofer AISEC. 31 August 2022.
- ^ Banse, Christian; Kunz, Immanuel; Schneider, Angelika; Weiss, Konrad (September 2021). "Cloud Property Graph: Connecting Cloud Security Assessments with Static Code Analysis". 2021 IEEE 14th International Conference on Cloud Computing (CLOUD). pp. 13–19. arXiv:2206.06938. doi:10.1109/CLOUD53861.2021.00014. ISBN 978-1-6654-0060-2. S2CID 243946828.
- ^ "The Code Property Graph — MATE 0.1.0.0 documentation". galoisinc.github.io.
- ^ Zhou, Yaqin; Liu, Shangqing; Siow, Jingkai; Du, Xiaoning; Liu, Yang (8 December 2019). "Devign: effective vulnerability identification by learning comprehensive program semantics via graph neural networks". Proceedings of the 33rd International Conference on Neural Information Processing Systems. Curran Associates Inc.: 10197–10207. arXiv:1909.03496.
- ^ Haojie, Zhang; Yujun, Li; Yiwei, Liu; Nanxin, Zhou (December 2021). "Vulmg: A Static Detection Solution for Source Code Vulnerabilities Based on Code Property Graph and Graph Attention Network". 2021 18th International Computer Conference on Wavelet Active Media Technology and Information Processing (ICCWAMTIP). pp. 250–255. doi:10.1109/ICCWAMTIP53232.2021.9674145. ISBN 978-1-6654-1364-0. S2CID 246039350.
- ^ Zheng, Weining; Jiang, Yuan; Su, Xiaohong (October 2021). "Vu1SPG: Vulnerability detection based on slice property graph representation learning". 2021 IEEE 32nd International Symposium on Software Reliability Engineering (ISSRE). pp. 457–467. doi:10.1109/ISSRE52982.2021.00054. ISBN 978-1-6654-2587-2. S2CID 246751595.
- ^ Chakraborty, Saikat; Krishna, Rahul; Ding, Yangruibo; Ray, Baishakhi (2021). "Deep Learning based Vulnerability Detection: Are We There Yet". IEEE Transactions on Software Engineering. 48 (9): 3280–3296. arXiv:2009.07235. doi:10.1109/TSE.2021.3087402. S2CID 221703797.
- ^ Zhou, Li; Huang, Minhuan; Li, Yujun; Nie, Yuanping; Li, Jin; Liu, Yiwei (October 2021). "GraphEye: A Novel Solution for Detecting Vulnerable Functions Based on Graph Attention Network". 2021 IEEE Sixth International Conference on Data Science in Cyberspace (DSC). pp. 381–388. arXiv:2202.02501. doi:10.1109/DSC53577.2021.00060. ISBN 978-1-6654-1815-7. S2CID 246634824.
- ^ Ganz, Tom; Härterich, Martin; Warnecke, Alexander; Rieck, Konrad (15 November 2021). "Explaining Graph Neural Networks for Vulnerability Discovery". Proceedings of the 14th ACM Workshop on Artificial Intelligence and Security: 145–156. doi:10.1145/3474369.3486866. ISBN 9781450386579. S2CID 240001850.
- ^ Duan, Xu; Wu, Jingzheng; Ji, Shouling; Rui, Zhiqing; Luo, Tianyue; Yang, Mutian; Wu, Yanjun (August 2019). "VulSniper: Focus Your Attention to Shoot Fine-Grained Vulnerabilities". Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence: 4665–4671. doi:10.24963/ijcai.2019/648. ISBN 978-0-9992411-4-1. S2CID 199466292.