Views
No views yet
| Component | Details |
|---|---|
| Graph type | Heterogeneous Code Property Graph (CPG) |
| GNN backbone | HGTConv (Heterogeneous Graph Transformer) |
| Node types | statement, variable, function, type, literal |
| Edge types | CFG, DFG, call graph, type edges, literal refs |
| Hidden dim | 256 |
| Attention heads | 8 |
| HGT layers | 6 |
| Total params | ~63.8M |
| Token encoder | CodeBERT (microsoft/codebert-base) |
| Training data | BigVul + D2A (CVE fix commits, C/C++) |
| AUROC (val) | ~0.87 |
Honest caveat: The model performs well on held-out benchmark data (~0.87 AUROC) but has a high false positive rate (~70% at threshold 0.80) on modern Chromium production code due to distribution shift — it was trained mostly on pre-2023 patterns that Chrome has already patched. Every candidate needs manual review. v4 (in progress) is being retrained on Chromium-specific CVE data from 2022–2026.
1pip install torch==2.4.1 torch-geometric==2.6.1
2pip install torch-scatter torch-sparse -f https://data.pyg.org/whl/torch-2.4.1+cu118.html
3pip install transformers==4.40.0 tree-sitter==0.20.41import torch
2from graph_builder import GraphBuilder
3from model import HetCPGModel
4
5device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
6builder = GraphBuilder()
7
8cpp_code = """
9void ProcessData(char* input, int size) {
10 char buffer[256];
11 memcpy(buffer, input, size); // overflow if size > 256
12 ProcessBuffer(buffer);
13}
14"""
15
16graph = builder.build_graph(cpp_code)
17# See inference.py for the full prediction pipelinepython inference.py /path/to/file.cc 0.80 cuda1from scanner import ChromiumScanner
2
3scanner = ChromiumScanner(model_path='best_model.pt', device='cuda')
4results = scanner.scan_directory('/path/to/chromium/src', threshold=0.80, max_files=5000)
5
6for r in results:
7 if r['probability'] > 0.90:
8 print(f"{r['file']} {r['func_name']} P={r['probability']:.3f}")□ Does input come from an untrusted source (renderer, network, file)?
□ Is there a bounds check before the suspicious operation?
□ Is object lifetime managed correctly (ref-counted, scoped, owned)?
□ Is this an intentional pattern with a documented safety gate?
- setHTMLUnsafe() with prior CheckHTML() gate → not a bug
- delete this after Cancel()+reset() → Chromium idiom, not UAF
- Unretained() on same SequencedTaskRunner → lifetime guaranteed
- UNSAFE_BUFFERS macro with audit comment → reviewed, not a bugunsafe block support1@misc{thetacpg2026,
2 title={ThetaCPG: Heterogeneous Code Property Graph for C++ Vulnerability Detection},
3 author={hoanghai2110},
4 year={2026},
5 url={https://huggingface.co/hoanghai2110/thetacpg-v3}
6}