Dataset Viewer
Auto-converted to Parquet Duplicate
task
stringclasses
5 values
language
stringclasses
8 values
cwe
stringclasses
190 values
source
stringclasses
13 values
instruction
stringclasses
80 values
input
stringlengths
28
3.5k
output
stringlengths
211
7.46k
ast_vuln_detection
c
CWE-264
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static int cg_rmdir(const char *path) { struct fuse_context *fc = fuse_get_context(); char *fpath = NULL, *cgdir = NULL, *controller; const char *cgroup; int ret; if (!fc) return -EIO; controller = pick_controller_from_path(fc, path); if (!controller) return -EINVAL; cgroup = find_cgroup_in_path(pa...
{ "vulnerable": true, "cwe": "CWE-264", "cwe_name": "Permissions/Privileges/Access Control", "severity": "high", "cve": "CVE-2015-1342", "project": "lxcfs", "vulnerable_lines": [ 4, 25, 26 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "function_def...
supply_chain_sca
javascript
CWE-346
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: npm Manifest: package.json Package: parse-server Installed version: 9.0.0 Summary: GraphQL API endpoint ignores CORS origin restriction
{ "vulnerable": true, "advisory_id": "GHSA-q3p6-g7c4-829c", "cve": "CVE-2026-34373", "aliases": [ "BIT-parse-2026-34373", "CVE-2026-34373" ], "cwe": "CWE-346", "ecosystem": "npm", "package": "parse-server", "severity": "moderate", "affected_versions": ">=9.0.0, <9.7.0-alpha.10", "fixed_ver...
supply_chain_sca
go
CWE-200
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Go Manifest: go.mod Package: github.com/basekick-labs/arc Installed version: <0.0.0-20260615165136-bb7d9761ad98 Summary: Arc has unauthenticated application log disclosure via `/api/v1/logs`
{ "vulnerable": true, "advisory_id": "GHSA-m3qr-fvp4-78xj", "cve": null, "aliases": [ "GO-2026-6907" ], "cwe": "CWE-200", "ecosystem": "Go", "package": "github.com/basekick-labs/arc", "severity": "low", "affected_versions": ">=0, <0.0.0-20260615165136-bb7d9761ad98", "fixed_version": "0.0.0-202...
supply_chain_sca
java
CWE-444
OSV (osv.dev) / GitHub Advisory Database
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: org.http4s:http4s-ember-core_2.12 Installed version: <0.23.31 Summary: Http4s vulnerable to HTTP Request Smuggling due to improper handling of HTTP trailer section
{ "vulnerable": true, "advisory_id": "GHSA-wcwh-7gfw-5wrr", "cve": "CVE-2025-59822", "aliases": [ "CVE-2025-59822" ], "cwe": "CWE-444", "ecosystem": "Maven", "package": "org.http4s:http4s-ember-core_2.12", "severity": "moderate", "affected_versions": ">=0, <0.23.31", "fixed_version": "0.23.31"...
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
void kernel_restart(char *cmd) { kernel_restart_prepare(cmd); if (!cmd) printk(KERN_EMERG "Restarting system.\n"); else printk(KERN_EMERG "Restarting system with command '%s'.\n", cmd); machine_restart(cmd); }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
supply_chain_sca
python
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: PyPI Manifest: requirements.txt Package: tensorflow-cpu Installed version: <2.10.1 Summary: Seg fault in `ndarray_tensor_bridge` due to zero and large inputs
{ "vulnerable": true, "advisory_id": "PYSEC-2026-3345", "cve": "CVE-2022-41884", "aliases": [ "BIT-tensorflow-2022-41884", "CVE-2022-41884", "GHSA-jq6x-99hj-q636", "PYSEC-2026-1013", "PYSEC-2026-3208" ], "cwe": null, "ecosystem": "PyPI", "package": "tensorflow-cpu", "severity": "un...
vuln_patch
c
CWE-476
BigVul (real CVE fix pairs)
Remediate the vulnerability in this C function. Return the fixed code and a short rationale as JSON.
static int unimac_mdio_probe(struct platform_device *pdev) { struct unimac_mdio_pdata *pdata = pdev->dev.platform_data; struct unimac_mdio_priv *priv; struct device_node *np; struct mii_bus *bus; struct resource *r; int ret; np = pdev->dev.of_node; priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); ...
{ "vulnerable": true, "cwe": "CWE-476", "cwe_name": "NULL Pointer Dereference", "cve": "CVE-2018-8043", "fixed_code": "static int unimac_mdio_probe(struct platform_device *pdev)\n{\n\tstruct unimac_mdio_pdata *pdata = pdev->dev.platform_data;\n\tstruct unimac_mdio_priv *priv;\n\tstruct device_node *np;\n\tstr...
ast_vuln_detection
c
null
BigVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static int midi_setup_sysex_roland_drum_track(struct _mdi *mdi, uint8_t channel, uint16_t setting) { MIDI_EVENT_DEBUG(__FUNCTION__,channel, setting); _WM_CheckEventMemoryPool(mdi); mdi->events[mdi->event_count].do_event = _WM_do_sysex_roland_drum_track; mdi-...
{ "vulnerable": false, "cwe": null, "findings": [], "project": "wildmidi", "note": "Non-vulnerable function from a real project (BigVul label vul=0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static int ieee80211_read_qos_info_element(struct ieee80211_qos_information_element *element_info, struct ieee80211_info_element *info_element) { int ret = 0; u16 size = sizeof(struct ieee80211_qos_information_element) - 2; if (element_info == NULL) return -1; if (info_element == NULL) ...
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
CWE-125
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
int common_timer_set(struct k_itimer *timr, int flags, struct itimerspec64 *new_setting, struct itimerspec64 *old_setting) { const struct k_clock *kc = timr->kclock; bool sigev_none; ktime_t expires; if (old_setting) common_timer_get(timr, old_setting); /* Prevent rearming by clearing the interva...
{ "vulnerable": true, "cwe": "CWE-125", "cwe_name": "Out-of-bounds Read", "severity": "high", "cve": "CVE-2017-18344", "project": "linux", "vulnerable_lines": [ 32 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "function_definition" ], "token_ast_map": ...
supply_chain_sca
python
null
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: PyPI Manifest: requirements.txt Package: tensorflow Installed version: <2.9.1 Summary: TensorFlow segfault TFLite converter on per-channel quantized transposed convolutions
{ "vulnerable": true, "advisory_id": "PYSEC-2026-3128", "cve": "CVE-2022-36027", "aliases": [ "BIT-tensorflow-2022-36027", "CVE-2022-36027", "GHSA-79h2-q768-fpxr", "PYSEC-2026-3291", "PYSEC-2026-965" ], "cwe": null, "ecosystem": "PyPI", "package": "tensorflow", "severity": "unknown...
ast_vuln_detection
c
CWE-20
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static int netbk_count_requests(struct xenvif *vif, struct xen_netif_tx_request *first, struct xen_netif_tx_request *txp, int work_to_do) { RING_IDX cons = vif->tx.req_cons; int frags = 0; if (!(first->flags & XEN_NETTXF_more_data)) return 0; do { if (frags >= work_to_do) { netdev_dbg(vif...
{ "vulnerable": true, "cwe": "CWE-20", "cwe_name": "Improper Input Validation", "severity": "high", "cve": "CVE-2013-0216", "project": "linux", "vulnerable_lines": [ 14, 19, 26, 34 ], "sink_node_type": "if_statement", "ast_path": [ "translation_unit", "function_definition", ...
supply_chain_sca
go
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Go Manifest: go.mod Package: github.com/hyperledger/fabric-ca Installed version: 1.5.21 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Go", "package": "github.com/hyperledger/fabric-ca", "installed_version": "1.5.21", "note": "github.com/hyperledger/fabric-ca 1.5.21 is at or above the fixed version for GHSA-xghw-p77p-3r7x; no known advisory applies to this version." }
ast_vuln_detection
c
CWE-125
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static int asepcos_parse_sec_attr(sc_card_t *card, sc_file_t *file, const u8 *buf, size_t len) { const u8 *p = buf; while (len != 0) { unsigned int amode, tlen = 3; if (len < 5 && p[0] != 0x80 && p[1] != 0x01) { sc_debug(card->ctx, SC_LOG_DEBUG_NORMAL, "invalid access mode encoding"); return SC_ERROR...
{ "vulnerable": true, "cwe": "CWE-125", "cwe_name": "Out-of-bounds Read", "severity": "high", "cve": "CVE-2018-16427", "project": "OpenSC", "vulnerable_lines": [ 8 ], "sink_node_type": "while_statement", "ast_path": [ "translation_unit", "function_definition", "compound_statement", ...
ast_vuln_detection
c
CWE-20
DiverseVul (real labeled functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
void beforeSleep(struct aeEventLoop *eventLoop) { REDIS_NOTUSED(eventLoop); listNode *ln; redisClient *c; /* Awake clients that got all the swapped keys they requested */ if (server.vm_enabled && listLength(server.io_ready_clients)) { listIter li; listRewind(server.io_ready_clients...
{ "vulnerable": true, "cwe": "CWE-20", "cwe_name": "Improper Input Validation", "severity": "high", "project": "redis", "note": "Function labeled vulnerable in a real project (DiverseVul). Function-level label; inspect memory/bounds/lifetime operations.", "ast_top_level": [ "translation_unit", "fu...
supply_chain_sca
python
null
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: PyPI Manifest: requirements.txt Package: werkzeug Installed version: <3.1.4 Summary: Werkzeug safe_join() allows Windows special device names
{ "vulnerable": true, "advisory_id": "PYSEC-2026-2046", "cve": "CVE-2025-66221", "aliases": [ "CVE-2025-66221", "GHSA-hgf8-39gv-g3f2" ], "cwe": null, "ecosystem": "PyPI", "package": "werkzeug", "severity": "unknown", "affected_versions": ">=0, <3.1.4", "fixed_version": "3.1.4", "finding"...
supply_chain_sca
java
CWE-200
OSV (osv.dev) / GitHub Advisory Database
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: com.arcadedb:arcadedb-server Installed version: <26.7.2 Summary: ArcadeDB has cross-database IDOR: /ts/*, /batch/*, Prometheus and Grafana handlers bypass authorization
{ "vulnerable": true, "advisory_id": "GHSA-x8mg-6r4p-87pf", "cve": "CVE-2026-67342", "aliases": [ "CVE-2026-67342" ], "cwe": "CWE-200", "ecosystem": "Maven", "package": "com.arcadedb:arcadedb-server", "severity": "high", "affected_versions": ">=0, <26.7.2", "fixed_version": "26.7.2", "findin...
supply_chain_sca
python
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: PyPI Manifest: requirements.txt Package: glance Installed version: <11.0.0a0 Summary: OpenStack Image Registry and Delivery Service (Glance) 2014.2 through 2014.2.2 does not properly remove images, which allows remote authenticated users to cause a denial of service (disk consumption) ...
{ "vulnerable": true, "advisory_id": "PYSEC-2015-37", "cve": "CVE-2014-9684", "aliases": [ "CVE-2014-9684", "GHSA-h737-q6g6-8wr6" ], "cwe": null, "ecosystem": "PyPI", "package": "glance", "severity": "unknown", "affected_versions": ">=0, <11.0.0a0", "fixed_version": "11.0.0a0", "finding"...
supply_chain_sca
javascript
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: npm Manifest: package.json Package: bower Installed version: 1.8.8 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "npm", "package": "bower", "installed_version": "1.8.8", "note": "bower 1.8.8 is at or above the fixed version for GHSA-p6mr-pxg4-68hx; no known advisory applies to this version." }
ast_vuln_detection
c
CWE-119
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static unsigned int help(struct sk_buff *skb, enum ip_conntrack_info ctinfo, unsigned int protoff, unsigned int matchoff, unsigned int matchlen, struct nf_conntrack_expect *exp) { char buffer[sizeof("4294967296 65635")]; u_int16_t port; unsigned int ret; /* Reply comes from server. */ ...
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "severity": "high", "cve": "CVE-2014-1690", "project": "linux", "vulnerable_lines": [ 32, 36, 37, 38, 40 ], "sink_node_type": "if_statement", "ast_path": [ "t...
ast_vuln_detection
c
null
BigVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static inline bool intel_pmu_needs_lbr_smpl(struct perf_event *event) { /* user explicitly requested branch sampling */ if (has_branch_stack(event)) return true; /* implicit branch sampling to correct PEBS skid */ if (x86_pmu.intel_cap.pebs_trap && event->attr.precise_ip > 1) return true; return false; }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux", "note": "Non-vulnerable function from a real project (BigVul label vul=0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
vuln_patch
c
CWE-119
BigVul (real CVE fix pairs)
Remediate the vulnerability in this C function. Return the fixed code and a short rationale as JSON.
static int cx24116_send_diseqc_msg(struct dvb_frontend *fe, struct dvb_diseqc_master_cmd *d) { struct cx24116_state *state = fe->demodulator_priv; int i, ret; /* Dump DiSEqC message */ if (debug) { printk(KERN_INFO "cx24116: %s(", __func__); for (i = 0 ; i < d->msg_len ;) { printk(KERN_INFO "0x%02x",...
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "cve": "CVE-2015-9289", "fixed_code": "static int cx24116_send_diseqc_msg(struct dvb_frontend *fe,\n\tstruct dvb_diseqc_master_cmd *d)\n{\n \tstruct cx24116_state *state = fe->demodulator_priv...
vuln_patch
c
CWE-20
BigVul (real CVE fix pairs)
The following C function contains a known security vulnerability (CWE-20). Produce the patched version and explain the fix. Output JSON.
int DecodeTeredo(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, uint16_t len, PacketQueue *pq) { if (!g_teredo_enabled) return TM_ECODE_FAILED; uint8_t *start = pkt; /* Is this packet to short to contain an IPv6 packet ? */ if (len < IPV6_HEADER_LEN) return TM_ECODE_FA...
{ "vulnerable": true, "cwe": "CWE-20", "cwe_name": "Improper Input Validation", "cve": "CVE-2019-1010251", "fixed_code": "int DecodeTeredo(ThreadVars *tv, DecodeThreadVars *dtv, Packet *p, uint8_t *pkt, uint16_t len, PacketQueue *pq)\n{\n if (!g_teredo_enabled)\n return TM_ECODE_FAILED;\n\n uint8...
supply_chain_sca
csharp
CWE-787
OSV (osv.dev) / GitHub Advisory Database
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: NuGet Manifest: packages.config / .csproj (NuGet) Package: Microsoft.ChakraCore Installed version: <1.11.4 Summary: ChakraCore Remote code execution Vulnerability
{ "vulnerable": true, "advisory_id": "GHSA-2xrc-27mc-638q", "cve": "CVE-2018-8624", "aliases": [ "CVE-2018-8624" ], "cwe": "CWE-787", "ecosystem": "NuGet", "package": "Microsoft.ChakraCore", "severity": "high", "affected_versions": ">=0, <1.11.4", "fixed_version": "1.11.4", "finding": "Chakr...
ast_vuln_detection
c
null
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
bool_t auth_gssapi_unwrap_data( OM_uint32 *major, OM_uint32 *minor, gss_ctx_id_t context, uint32_t seq_num, XDR *in_xdrs, bool_t (*xdr_func)(), caddr_t xdr_ptr) { gss_buffer_desc in_buf, out_buf; XDR temp_xdrs; uint32_t verf_seq_num; int conf, qop; unsigned in...
{ "vulnerable": true, "cwe": null, "cwe_name": null, "severity": "high", "cve": "CVE-2014-9421", "project": "krb5", "vulnerable_lines": [ 65 ], "sink_node_type": "if_statement", "ast_path": [ "translation_unit", "function_definition", "compound_statement", "if_statement" ], "...
ast_vuln_detection
c
CWE-120
curated SAST pattern + tree-sitter AST
Perform AST-based static analysis on the following C code. Detect the security vulnerability, locate the vulnerable tokens and their AST nodes, and output a structured finding.
void handle(char *data) { char buf[64]; strcpy(buf, data); }
{ "vulnerable": true, "cwe": "CWE-120", "cwe_name": "Classic Buffer Overflow", "title": "Buffer overflow via strcpy into fixed buffer", "severity": "critical", "vulnerable_lines": [ 3 ], "sink_node_type": "call_expression", "ast_path": [ "translation_unit", "function_definition", "comp...
ast_vuln_detection
c
null
DiverseVul (real labeled functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static int clone_file(const char *from, const char *to, const char **err_status, int copy_if_rename_fails) { FILE *from_fp = NULL, *to_fp = NULL; char buf[BUFSIZ]; size_t len; int result = -1; if (rename(from, to) == 0) return 0; if ((errno != EXDEV && errno != EBU...
{ "vulnerable": true, "cwe": null, "cwe_name": null, "severity": "high", "project": "augeas", "note": "Function labeled vulnerable in a real project (DiverseVul). Function-level label; inspect memory/bounds/lifetime operations.", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
python
CWE-502
curated SAST pattern + tree-sitter AST
You are a static application security testing (SAST) engine. Parse the python source into its AST, map each token to its AST node, identify the vulnerable sink, and report the vulnerability as JSON.
import pickle def load(): input = sys.argv[1] return pickle.loads(input)
{ "vulnerable": true, "cwe": "CWE-502", "cwe_name": "Insecure Deserialization", "title": "Insecure deserialization via pickle", "severity": "critical", "vulnerable_lines": [ 4 ], "sink_node_type": "call", "ast_path": [ "module", "function_definition", "block", "return_statement", ...
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static int ioc_settimeout(unsigned int fd, unsigned int cmd, unsigned long arg) { return rw_long(fd, AUTOFS_IOC_SETTIMEOUT, arg); }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
supply_chain_sca
c
null
OSV (osv.dev) / Debian & Alpine security trackers
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Debian:12 Manifest: distro package manager (apt/apk) Package: python-django Installed version: 2:2.2.20-1 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Debian:12", "package": "python-django", "installed_version": "2:2.2.20-1", "note": "python-django 2:2.2.20-1 is at or above the fixed version for DEBIAN-CVE-2021-28658; no known advisory applies to this version." }
supply_chain_sca
csharp
CWE-119
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: NuGet Manifest: packages.config / .csproj (NuGet) Package: Microsoft.ChakraCore Installed version: <1.2.1 Summary: ChakraCore RCE Vulnerability
{ "vulnerable": true, "advisory_id": "GHSA-wv44-9w69-w43j", "cve": "CVE-2016-3377", "aliases": [ "CVE-2016-3377" ], "cwe": "CWE-119", "ecosystem": "NuGet", "package": "Microsoft.ChakraCore", "severity": "high", "affected_versions": ">=0, <1.2.1", "fixed_version": "1.2.1", "finding": "ChakraC...
supply_chain_sca
c
null
OSV (osv.dev) / Debian & Alpine security trackers
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: Debian:12 Manifest: distro package manager (apt/apk) Package: ghostscript Installed version: <10.0.0~dfsg-11+deb12u7 Summary: An issue was discovered in Artifex Ghostscript before 10.05.0. A buffer overflow occurs during serialization of DollarBlend in a font, for base/write_t1.c and psi/zfapi.c.
{ "vulnerable": true, "advisory_id": "DEBIAN-CVE-2025-27830", "cve": null, "aliases": [], "cwe": null, "ecosystem": "Debian:12", "package": "ghostscript", "severity": "unknown", "affected_versions": ">=0, <10.0.0~dfsg-11+deb12u7", "fixed_version": "10.0.0~dfsg-11+deb12u7", "finding": "An issue was...
ast_vuln_detection
cpp
CWE-264
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C++ function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
nsPluginInstance::setupCookies(const std::string& pageurl) { std::string::size_type pos; pos = pageurl.find("/", pageurl.find("//", 0) + 2) + 1; std::string url = pageurl.substr(0, pos); std::string ncookie; char *cookie = 0; uint32_t length = 0; NPError rv = NPERR_GENERIC_ERROR; #if NPA...
{ "vulnerable": true, "cwe": "CWE-264", "cwe_name": "Permissions/Privileges/Access Control", "severity": "high", "cve": "CVE-2011-4328", "project": "savannah", "vulnerable_lines": [], "sink_node_type": null, "ast_path": null, "token_ast_map": null, "explanation": "Function was modified by the secu...
ast_vuln_detection
python
CWE-22
curated SAST pattern + tree-sitter AST
You are a static application security testing (SAST) engine. Parse the python source into its AST, map each token to its AST node, identify the vulnerable sink, and report the vulnerability as JSON.
def read(): data = request.args.get('url') with open('/srv/files/' + data) as f: return f.read()
{ "vulnerable": true, "cwe": "CWE-22", "cwe_name": "Path Traversal", "title": "Path traversal in open()", "severity": "high", "vulnerable_lines": [ 3 ], "sink_node_type": "call", "ast_path": [ "module", "function_definition", "block", "with_statement", "with_clause", "with_...
supply_chain_sca
python
CWE-20
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: PyPI Manifest: requirements.txt Package: guard-core Installed version: 1.0.0 Summary: Guard Core: Unvalidated X-Forwarded-For-derived string used as a Redis key component and interpolated into a KEYS glob pattern
{ "vulnerable": true, "advisory_id": "GHSA-gm9r-hvc9-96gv", "cve": "CVE-2026-129304", "aliases": [ "CVE-2026-129304" ], "cwe": "CWE-20", "ecosystem": "PyPI", "package": "guard-core", "severity": "moderate", "affected_versions": ">=1.0.0, <3.13.0", "fixed_version": "3.13.0", "finding": "Guard...
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
int fat_search_long(struct inode *inode, const unsigned char *name, int name_len, struct fat_slot_info *sinfo) { struct super_block *sb = inode->i_sb; struct msdos_sb_info *sbi = MSDOS_SB(sb); struct buffer_head *bh = NULL; struct msdos_dir_entry *de; struct nls_table *nls_io = sbi->nls_io; struct nls_table...
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
CWE-310
DiverseVul (real labeled functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static void dummy_wait(record_parameters_st * params, gnutls_datum_t* plaintext, unsigned pad_failed, unsigned int pad, unsigned total) { /* this hack is only needed on CBC ciphers */ if (_gnutls_cipher_is_block (params->cipher_algorithm) == CIPHER_BLOCK) { unsigned len; /* ...
{ "vulnerable": true, "cwe": "CWE-310", "cwe_name": "see MITRE CWE", "severity": "high", "project": "gnutls", "note": "Function labeled vulnerable in a real project (DiverseVul). Function-level label; inspect memory/bounds/lifetime operations.", "ast_top_level": [ "translation_unit", "function_def...
ast_vuln_detection
c
null
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
int sas_discover_sata(struct domain_device *dev) { int res; if (dev->dev_type == SAS_SATA_PM) return -ENODEV; dev->sata_dev.class = sas_get_ata_command_set(dev); sas_fill_in_rphy(dev, dev->rphy); res = sas_notify_lldd_dev_found(dev); if (res) return res; sas_discover_event(dev->port, DISCE_PROBE); r...
{ "vulnerable": true, "cwe": null, "cwe_name": null, "severity": "high", "cve": "CVE-2017-18232", "project": "linux", "vulnerable_lines": [ 15 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "function_definition" ], "token_ast_map": [ { "token"...
supply_chain_sca
java
null
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: org.jenkins-ci.plugins:ssh-slaves Installed version: 1.15 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Maven", "package": "org.jenkins-ci.plugins:ssh-slaves", "installed_version": "1.15", "note": "org.jenkins-ci.plugins:ssh-slaves 1.15 is at or above the fixed version for GHSA-x654-4wjh-74q6; no known advisory applies to this version." }
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
asmlinkage long sys_setfsuid(uid_t uid) { int old_fsuid; old_fsuid = current->fsuid; if (security_task_setuid(uid, (uid_t)-1, (uid_t)-1, LSM_SETID_FS)) return old_fsuid; if (uid == current->uid || uid == current->euid || uid == current->suid || uid == current->fsuid || capable(CAP_SETUID)) { if (ui...
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static void pwc_cleanup(struct pwc_device *pdev) { pwc_remove_sysfs_files(pdev->vdev); video_unregister_device(pdev->vdev); }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
CWE-20
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static gboolean nbd_negotiate_continue(QIOChannel *ioc, GIOCondition condition, void *opaque) { qemu_coroutine_enter(opaque); return TRUE; }
{ "vulnerable": true, "cwe": "CWE-20", "cwe_name": "Improper Input Validation", "severity": "high", "cve": "CVE-2017-7539", "project": "qemu", "vulnerable_lines": [ 2, 3, 4, 5, 6, 7 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "functio...
ast_vuln_detection
c
CWE-22
DiverseVul (real labeled functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static NTSTATUS smb_set_file_unix_link(connection_struct *conn, struct smb_request *req, const char *pdata, int total_data, const struct smb_filename *smb_fname) { char *link_target = NULL; const char *newname = smb_fname->base_name; NTSTATUS status = NT_STATUS_OK; TALLOC...
{ "vulnerable": true, "cwe": "CWE-22", "cwe_name": "Path Traversal", "severity": "high", "project": "samba", "note": "Function labeled vulnerable in a real project (DiverseVul). Function-level label; inspect memory/bounds/lifetime operations.", "ast_top_level": [ "translation_unit", "function_defi...
supply_chain_sca
java
CWE-295
OSV (osv.dev) / GitHub Advisory Database
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: org.apache.beam:beam-sdks-java-io-mongodb Installed version: 2.10.0 Summary: Improper Certificate Validation in Apache Beam
{ "vulnerable": true, "advisory_id": "GHSA-2m7g-9q74-9m3q", "cve": "CVE-2020-1929", "aliases": [ "CVE-2020-1929" ], "cwe": "CWE-295", "ecosystem": "Maven", "package": "org.apache.beam:beam-sdks-java-io-mongodb", "severity": "high", "affected_versions": ">=2.10.0, <2.17.0", "fixed_version": "2....
vuln_patch
c
CWE-119
BigVul (real CVE fix pairs)
Remediate the vulnerability in this C function. Return the fixed code and a short rationale as JSON.
int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type) { struct hexline *hx; u8 reset; int ret,pos=0; hx = kmalloc(sizeof(*hx), GFP_KERNEL); if (!hx) return -ENOMEM; /* stop the CPU */ reset = 1; if ((ret = usb_cypress_writemem(udev,cypress[type].cpu_cs_register,&...
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "cve": "CVE-2017-8061", "fixed_code": " int usb_cypress_load_firmware(struct usb_device *udev, const struct firmware *fw, int type)\n {\n \tstruct hexline *hx;\n\tu8 *buf;\n\tint ret, pos = 0;...
supply_chain_sca
java
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: org.sonatype.nexus.ci:nexus-jenkins-plugin Installed version: 3.18.1-01 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Maven", "package": "org.sonatype.nexus.ci:nexus-jenkins-plugin", "installed_version": "3.18.1-01", "note": "org.sonatype.nexus.ci:nexus-jenkins-plugin 3.18.1-01 is at or above the fixed version for GHSA-4g5f-w3mh-w99m; no known advisory applies to this version." }
ast_vuln_detection
c
CWE-119
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static ssize_t eth_rx(NetClientState *nc, const uint8_t *buf, size_t size) { struct xlx_ethlite *s = qemu_get_nic_opaque(nc); unsigned int rxbase = s->rxbuf * (0x800 / 4); /* DA filter. */ if (!(buf[0] & 0x80) && memcmp(&s->conf.macaddr.a[0], buf, 6)) return size; if (s->regs[rxbase + R_R...
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "severity": "high", "cve": "CVE-2016-7161", "project": "qemu", "vulnerable_lines": [], "sink_node_type": null, "ast_path": null, "token_ast_map": null, "explanation": "Function was...
supply_chain_sca
javascript
CWE-79
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: npm Manifest: package.json Package: serve-static Installed version: <1.16.0 Summary: serve-static vulnerable to template injection that can lead to XSS
{ "vulnerable": true, "advisory_id": "GHSA-cm22-4g7w-348p", "cve": "CVE-2024-43800", "aliases": [ "CVE-2024-43800" ], "cwe": "CWE-79", "ecosystem": "npm", "package": "serve-static", "severity": "low", "affected_versions": ">=0, <1.16.0", "fixed_version": "1.16.0", "finding": "serve-static vu...
supply_chain_sca
java
CWE-94
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Maven Manifest: pom.xml (Maven) Package: org.jenkins-ci.plugins:templating-engine Installed version: <2.5.4 Summary: Jenkins Templating Engine Plugin Vulnerable to Arbitrary Code Execution
{ "vulnerable": true, "advisory_id": "GHSA-4vjp-327p-w4qv", "cve": "CVE-2025-31722", "aliases": [ "CVE-2025-31722" ], "cwe": "CWE-94", "ecosystem": "Maven", "package": "org.jenkins-ci.plugins:templating-engine", "severity": "high", "affected_versions": ">=0, <2.5.4", "fixed_version": "2.5.4", ...
supply_chain_sca
javascript
null
OSV (osv.dev) / GitHub Advisory Database
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: npm Manifest: package.json Package: @budibase/server Installed version: 3.35.3 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "npm", "package": "@budibase/server", "installed_version": "3.35.3", "note": "@budibase/server 3.35.3 is at or above the fixed version for GHSA-cv96-5348-p5p8; no known advisory applies to this version." }
supply_chain_sca
go
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: Go Manifest: go.mod Package: github.com/rabbitmq/amqp091-go Installed version: 1.13.0 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Go", "package": "github.com/rabbitmq/amqp091-go", "installed_version": "1.13.0", "note": "github.com/rabbitmq/amqp091-go 1.13.0 is at or above the fixed version for GHSA-4v58-74mf-rjx3; no known advisory applies to this version." }
supply_chain_sca
csharp
CWE-787
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: NuGet Manifest: packages.config / .csproj (NuGet) Package: Magick.NET-Q16-AnyCPU Installed version: <14.11.1 Summary: ImageMagick has an Out-of-Bounds write of a zero byte in its X11 display interaction
{ "vulnerable": true, "advisory_id": "GHSA-mw3m-pqr2-qv7c", "cve": "CVE-2026-33535", "aliases": [ "CVE-2026-33535" ], "cwe": "CWE-787", "ecosystem": "NuGet", "package": "Magick.NET-Q16-AnyCPU", "severity": "moderate", "affected_versions": ">=0, <14.11.1", "fixed_version": "14.11.1", "finding...
ast_vuln_detection
c
null
DiverseVul (real labeled functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
void do_notify_resume(int canrestart, struct pt_regs *regs, __u32 thread_info_flags) { /* deal with pending signal delivery */ if (thread_info_flags & _TIF_SIGPENDING) do_signal(canrestart,regs); if (thread_info_flags & _TIF_NOTIFY_RESUME) { clear_thread_flag(TIF_NOTIFY_RESUME); tracehook_notify_resum...
{ "vulnerable": true, "cwe": null, "cwe_name": null, "severity": "high", "project": "linux-2.6", "note": "Function labeled vulnerable in a real project (DiverseVul). Function-level label; inspect memory/bounds/lifetime operations.", "ast_top_level": [ "translation_unit", "function_definition" ] ...
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static void shmem_destroy_inode(struct inode *inode) { if ((inode->i_mode & S_IFMT) == S_IFREG) { /* only struct inode is valid if it's an inline symlink */ mpol_free_shared_policy(&SHMEM_I(inode)->policy); } shmem_acl_destroy_inode(inode); kmem_cache_free(shmem_inode_cachep, SHMEM_I(inode)); }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
int jpc_getuint32(jas_stream_t *in, uint_fast32_t *val) { uint_fast32_t v; int c; if ((c = jas_stream_getc(in)) == EOF) { return -1; } v = c; if ((c = jas_stream_getc(in)) == EOF) { return -1; } v = (v << 8) | c; if ((c = jas_stream_getc(in)) == EOF) { return -1; } v = (v << 8) | c; if ((c = jas_strea...
{ "vulnerable": false, "cwe": null, "findings": [], "project": "jasper", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
ast_vuln_detection
c
CWE-119
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
void CheckSad(unsigned int max_sad) { unsigned int reference_sad, exp_sad; reference_sad = ReferenceSAD(max_sad); exp_sad = SAD(max_sad); if (reference_sad <= max_sad) { ASSERT_EQ(exp_sad, reference_sad); } else { ASSERT_GE(exp_sad, reference_sad); } }
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "severity": "high", "cve": "CVE-2016-1621", "project": "Android", "vulnerable_lines": [ 2, 3, 4, 5, 6, 7, 8, 9, 10 ], "sink_node_type": "function_de...
supply_chain_sca
python
null
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: PyPI Manifest: requirements.txt Package: freeipa Installed version: 4.6.7 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "PyPI", "package": "freeipa", "installed_version": "4.6.7", "note": "freeipa 4.6.7 is at or above the fixed version for GHSA-w4q7-f34x-vpgc; no known advisory applies to this version." }
supply_chain_sca
python
CWE-22
OSV (osv.dev) / GitHub Advisory Database
Act as a SAST/SCA tool. Given the package and version in a project's dependency manifest, detect any known vulnerability and return a structured advisory.
Ecosystem: PyPI Manifest: requirements.txt Package: onnx Installed version: <1.21.0 Summary: ONNX: Arbitrary File Read via ExternalData Hardlink Bypass in ONNX load
{ "vulnerable": true, "advisory_id": "GHSA-cmw6-hcpp-c6jp", "cve": "CVE-2026-34446", "aliases": [ "CVE-2026-34446", "PYSEC-2026-2241" ], "cwe": "CWE-22", "ecosystem": "PyPI", "package": "onnx", "severity": "moderate", "affected_versions": ">=0, <1.21.0", "fixed_version": "1.21.0", "findi...
ast_vuln_detection
c
null
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static void ext4_end_io_work(struct work_struct *work) { ext4_io_end_t *io = container_of(work, ext4_io_end_t, work); struct inode *inode = io->inode; int ret = 0; mutex_lock(&inode->i_mutex); ret = ext4_end_io_nolock(io); if (ret >= 0) { if (!list_empty(&io->list)) list_del_init(&io->list); ext4_fr...
{ "vulnerable": true, "cwe": null, "cwe_name": null, "severity": "high", "cve": "CVE-2015-8324", "project": "linux", "vulnerable_lines": [ 3, 4, 5, 9, 10, 11, 12 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "function_definition" ...
vuln_patch
c
CWE-399
BigVul (real CVE fix pairs)
The following C function contains a known security vulnerability (CWE-399). Produce the patched version and explain the fix. Output JSON.
static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) { struct yam_port *yp = netdev_priv(dev); struct yamdrv_ioctl_cfg yi; struct yamdrv_ioctl_mcs *ym; int ioctl_cmd; if (copy_from_user(&ioctl_cmd, ifr->ifr_data, sizeof(int))) return -EFAULT; if (yp->magic != YAM_MAGIC) return -EINVAL; ...
{ "vulnerable": true, "cwe": "CWE-399", "cwe_name": "Resource Management Errors", "cve": "CVE-2014-1446", "fixed_code": "static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)\n{\n\tstruct yam_port *yp = netdev_priv(dev);\n\tstruct yamdrv_ioctl_cfg yi;\n\tstruct yamdrv_ioctl_mcs *ym;\n\tint ...
ast_vuln_detection
c
CWE-119
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static grub_err_t read_foo (struct grub_disk *disk, grub_disk_addr_t sector, grub_size_t size, char *buf) { if (disk != NULL) { const int blocksize = 512; // unhardcode 512 int ret; RIOBind *iob = disk->data; if (bio) iob = bio; ret = iob->read_at (iob->io, delta+(blocksize*sector), (ut8*)buf, size*block...
{ "vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds", "severity": "high", "cve": "CVE-2017-9763", "project": "radare2", "vulnerable_lines": [ 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 ], "sink_node_typ...
supply_chain_sca
go
CWE-532
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: Go Manifest: go.mod Package: github.com/projectcalico/calicoctl/v3 Installed version: <3.31.6 Summary: Calico Inserts Sensitive Information into Log File
{ "vulnerable": true, "advisory_id": "GHSA-3m4q-ggcj-j6m4", "cve": "CVE-2026-6720", "aliases": [ "CVE-2026-6720", "GO-2026-5893" ], "cwe": "CWE-532", "ecosystem": "Go", "package": "github.com/projectcalico/calicoctl/v3", "severity": "high", "affected_versions": ">=0, <3.31.6", "fixed_versi...
ast_vuln_detection
c
null
DiverseVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static inline int is_beacon(__le16 fc) { return (WLAN_FC_GET_STYPE(le16_to_cpu(fc)) == IEEE80211_STYPE_BEACON); }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "linux-2.6", "note": "Non-vulnerable function from a real project (DiverseVul label 0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
supply_chain_sca
c
null
OSV (osv.dev) / Debian & Alpine security trackers
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: Debian:12 Manifest: distro package manager (apt/apk) Package: linux Installed version: <5.18.5-1 Summary: In the Linux kernel, the following vulnerability has been resolved: powerpc/papr_scm: Fix leaking nvdimm_events_map elements Right now 'char *' elements allocated for individual 'stat_id' in 'papr_s...
{ "vulnerable": true, "advisory_id": "DEBIAN-CVE-2022-49436", "cve": null, "aliases": [], "cwe": null, "ecosystem": "Debian:12", "package": "linux", "severity": "unknown", "affected_versions": ">=0, <5.18.5-1", "fixed_version": "5.18.5-1", "finding": "In the Linux kernel, the following vulnerabili...
ast_vuln_detection
c
CWE-189
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
void oz_hcd_get_desc_cnf(void *hport, u8 req_id, int status, const u8 *desc, int length, int offset, int total_size) { struct oz_port *port = hport; struct urb *urb; int err = 0; oz_dbg(ON, "oz_hcd_get_desc_cnf length = %d offs = %d tot_size = %d\n", length, offset, total_size); urb = oz_find_urb_by...
{ "vulnerable": true, "cwe": "CWE-189", "cwe_name": "Numeric Errors", "severity": "high", "cve": "CVE-2015-4001", "project": "linux", "vulnerable_lines": [ 2, 14, 15 ], "sink_node_type": "function_definition", "ast_path": [ "translation_unit", "function_definition" ], "token_...
supply_chain_sca
javascript
CWE-1333
OSV (osv.dev) / GitHub Advisory Database
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: npm Manifest: package.json Package: js-toml Installed version: <1.1.2 Summary: js-toml vulnerable to CPU exhaustion via O(n^2) BigInt construction on radix-prefixed integer literals
{ "vulnerable": true, "advisory_id": "GHSA-wp3c-266w-4qfq", "cve": "CVE-2026-49293", "aliases": [ "CVE-2026-49293" ], "cwe": "CWE-1333", "ecosystem": "npm", "package": "js-toml", "severity": "high", "affected_versions": ">=0, <1.1.2", "fixed_version": "1.1.2", "finding": "js-toml vulnerable ...
supply_chain_sca
c
null
OSV (osv.dev) / Debian & Alpine security trackers
You are a software composition analysis (SCA) engine. Determine whether the dependency below is affected by a known supply-chain vulnerability and report the finding as JSON.
Ecosystem: Debian:12 Manifest: distro package manager (apt/apk) Package: chromium Installed version: <149.0.7827.102-1~deb12u1 Summary: Out of bounds read and write in V8 in Google Chrome prior to 149.0.7827.103 allowed a remote attacker to execute arbitrary code inside a sandbox via a crafted HTML page. (Chromium secu...
{ "vulnerable": true, "advisory_id": "DEBIAN-CVE-2026-11645", "cve": null, "aliases": [], "cwe": null, "ecosystem": "Debian:12", "package": "chromium", "severity": "unknown", "affected_versions": ">=0, <149.0.7827.102-1~deb12u1", "fixed_version": "149.0.7827.102-1~deb12u1", "finding": "Out of boun...
ast_vuln_detection
c
CWE-399
BigVul (real CVE-fixed functions)
You are a static application security testing (SAST) engine. Parse the C function into its AST, map tokens to AST nodes, decide whether it contains a security vulnerability, and report as JSON.
static void perf_event_interrupt(struct pt_regs *regs) { int i; struct cpu_hw_events *cpuhw = &__get_cpu_var(cpu_hw_events); struct perf_event *event; unsigned long val; int found = 0; int nmi; if (cpuhw->n_limited) freeze_limited_counters(cpuhw, mfspr(SPRN_PMC5), mfspr(SPRN_PMC6)); perf_read_regs(regs...
{ "vulnerable": true, "cwe": "CWE-399", "cwe_name": "Resource Management Errors", "severity": "high", "cve": "CVE-2011-2918", "project": "linux", "vulnerable_lines": [ 30 ], "sink_node_type": "if_statement", "ast_path": [ "translation_unit", "function_definition", "compound_statement...
ast_vuln_detection
c
null
BigVul (real non-vulnerable functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
static char IntToHex(int i) { DCHECK_GE(i, 0) << i << " not a hex value"; DCHECK_LE(i, 15) << i << " not a hex value"; return kHexString[i]; }
{ "vulnerable": false, "cwe": null, "findings": [], "project": "Chrome", "note": "Non-vulnerable function from a real project (BigVul label vul=0).", "ast_top_level": [ "translation_unit", "function_definition" ] }
vuln_patch
c
CWE-20
BigVul (real CVE fix pairs)
Remediate the vulnerability in this C function. Return the fixed code and a short rationale as JSON.
static ext3_fsblk_t get_sb_block(void **data, struct super_block *sb) { ext3_fsblk_t sb_block; char *options = (char *) *data; if (!options || strncmp(options, "sb=", 3) != 0) return 1; /* Default location */ options += 3; /*todo: use simple_strtoll with >32bit ext3 */ sb_block = simple_strtoul(options, &op...
{ "vulnerable": true, "cwe": "CWE-20", "cwe_name": "Improper Input Validation", "cve": "CVE-2013-1848", "fixed_code": "static ext3_fsblk_t get_sb_block(void **data, struct super_block *sb)\n{\n\text3_fsblk_t\tsb_block;\n\tchar\t\t*options = (char *) *data;\n\n\tif (!options || strncmp(options, \"sb=\", 3) != ...
ast_vuln_detection
c
CWE-125
BigVul (real CVE-fixed functions)
Perform AST-based static analysis on the following real-world C function. Determine if it is vulnerable, and if so locate the vulnerable region and report a structured finding.
int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb) { if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= (unsigned int)sk->sk_rcvbuf) return -ENOMEM; skb_orphan(skb); skb->sk = sk; skb->destructor = sock_rmem_free; atomic_add(skb->truesize, &sk->sk_rmem_alloc); /* before exiting rcu sec...
{ "vulnerable": true, "cwe": "CWE-125", "cwe_name": "Out-of-bounds Read", "severity": "high", "cve": "CVE-2017-7277", "project": "linux", "vulnerable_lines": [], "sink_node_type": null, "ast_path": null, "token_ast_map": null, "explanation": "Function was modified by the security fix for this CVE;...
vuln_patch
c
CWE-125
BigVul (real CVE fix pairs)
Remediate the vulnerability in this C function. Return the fixed code and a short rationale as JSON.
int ntlm_read_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields) { if (fields->Len > 0) { if ((fields->BufferOffset + fields->Len) > Stream_Length(s)) return -1; fields->Buffer = (PBYTE) malloc(fields->Len); if (!fields->Buffer) return -1; Stream_SetPosition(s, fields->BufferOffset)...
{ "vulnerable": true, "cwe": "CWE-125", "cwe_name": "Out-of-bounds Read", "cve": "CVE-2018-8789", "fixed_code": "int ntlm_read_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields)\nstatic int ntlm_read_message_fields_buffer(wStream* s, NTLM_MESSAGE_FIELDS* fields)\n {\n \tif (fields->Len > 0)\n \t{\...
supply_chain_sca
c
null
OSV (osv.dev) / Debian & Alpine security trackers
Analyze the following third-party dependency for known supply-chain security advisories and output the result as JSON.
Ecosystem: Debian:8 Manifest: distro package manager (apt/apk) Package: tomcat7 Installed version: 7.0.56-3+deb8u10 Summary: assess against known advisories
{ "vulnerable": false, "ecosystem": "Debian:8", "package": "tomcat7", "installed_version": "7.0.56-3+deb8u10", "note": "tomcat7 7.0.56-3+deb8u10 is at or above the fixed version for DSA-3842-1; no known advisory applies to this version." }
End of preview. Expand in Data Studio

SAST Multi-Language Vulnerability Detection

An instruction-tuning dataset for fine-tuning a model to perform static application security testing (SAST) across many languages and several analysis modes, combining real-world labeled vulnerable code with real supply-chain advisories and curated AST/obfuscation/assembly examples.

Records are instruction / input / output (Alpaca-style); the output field is a JSON string the model is trained to produce.

Languages

C & C++ · JavaScript / npm · Python / PyPI · Go · Java / Maven · C# / .NET / NuGet · x86/x64 Assembly.

Tasks (task field)

task what the model learns
ast_vuln_detection Decide if a function/snippet is vulnerable; for vulnerable code, locate the region and map tokens to AST nodes. Covers real C/C++ functions (BigVul, DiverseVul) and curated patterns for all languages.
vuln_patch Given a real vulnerable function, produce the patched version and explain the fix (from real CVE fix commits).
supply_chain_sca Given a dependency at a version, detect known advisories (npm, PyPI, Go, Maven, NuGet, Debian/Alpine) and report CWE, severity, affected range, fix.
obfuscation_handling Detect obfuscation, deobfuscate what is statically recoverable, recover the true behavior, and escalate to sandboxing when it cannot.
assembly_vuln_detection Instruction-level analysis of assembly/shellcode (no AST) — flag dangerous syscalls, shellcode signatures, and unsafe libc calls.

Composition (~7,443 records · train 6,699 / validation 744)

By task: ast_vuln_detection 3,940 · supply_chain_sca 2,773 · vuln_patch 700 · obfuscation_handling 24 · assembly_vuln_detection 6.

Real-world code: 4,178 records from real projects — BigVul (CVE-fixed C/C++ functions, with patch pairs and patched negatives) and DiverseVul (labeled C/C++ functions across 150+ projects).

Labels: vulnerable 5,679 · non-vulnerable 1,740 (plus obfuscation verdicts). Top CWEs: CWE-119, CWE-20, CWE-200, CWE-399, CWE-189, CWE-264, CWE-125, CWE-476, CWE-362, CWE-190, CWE-22, CWE-79, CWE-787 … (full list in data/dataset_stats.json).

Language skew (be aware): real labeled vulnerability corpora are overwhelmingly C/C++, so the dataset leans heavily C/C++ (~4,600 records). The other languages are present via curated AST patterns and supply-chain advisories (hundreds each). To add real JS/Python/Java/C# code you would need additional corpora (e.g. CVEfixes multi-language, SVEN, CodeXGLUE).

The supply-chain set was downsampled and stratified by language so it no longer dominates (it was ~8,600 before rebalancing). Train/validation are split by input so the same code never appears in both splits (no leakage).

How obfuscated code should be handled (policy encoded in the data)

  1. Detect obfuscation indicators (encoded blobs, eval/exec of decoded data, char-code arrays, packers, heavy escaping). Obfuscation is itself a risk signal.
  2. Deobfuscate when recoverable — decode base64/hex/char-codes offline without executing, then re-analyze the recovered source and report the real behavior. (Encodings in the data are real, so the decode mapping is learnable.)
  3. Escalate when not recoverable — for runtime-keyed, multi-stage, packed, or marshalled payloads, output statically_recoverable: false and recommend dynamic/sandbox analysis. Never classify obfuscated input as clean.
  4. Minification alone is not malicious (a benign-minified case is included).

Output schemas (selected)

ast_vuln_detection (real vulnerable function):

{"vulnerable": true, "cwe": "CWE-119", "cwe_name": "Improper Restriction of Operations within Memory Buffer Bounds",
 "severity": "high", "cve": "CVE-2016-1621", "project": "Android",
 "vulnerable_lines": [4], "sink_node_type": "call_expression",
 "ast_path": ["translation_unit","function_definition","compound_statement","expression_statement","call_expression"],
 "token_ast_map": [{"token":"memcpy","ast_node":"identifier","line":4,"col":2}, ...],
 "explanation": "Function was modified by the security fix for this CVE; the changed lines mark the vulnerable region.",
 "remediation": "..."}

vuln_patch:

{"vulnerable": true, "cwe": "CWE-416", "fixed_code": "<patched function source>",
 "change_summary": "<first line of the real fix commit message>"}

supply_chain_sca:

{"vulnerable": true, "advisory_id": "GHSA-...", "cve": "CVE-...", "cwe": "CWE-22",
 "ecosystem": "Maven", "package": "org.example:lib", "severity": "high",
 "affected_versions": ">=0, <2.1.2", "fixed_version": "2.1.2", "finding": "...", "remediation": "..."}

obfuscation_handling / assembly_vuln_detection: see examples in the data; both include a mode/verdict field and a recommended_handling.

Sources & licensing

  • Real vulnerable code: BigVul (via bstee615/bigvul) and DiverseVul (via claudios/DiverseVul) — real CVE-fixed / labeled functions from open-source projects. Cite the original papers if you redistribute.
  • Supply-chain: OSV / GitHub Advisory Database (npm, PyPI, Go, Maven, NuGet) and the Debian & Alpine security trackers, redistributed by OSV under CC-BY-4.0.
  • Curated patterns, assembly, obfuscation: authored for this dataset; source parsed with tree-sitter; obfuscation payloads use real base64/hex/char-code encodings.

This aggregate is released under CC-BY-4.0; attribute the upstream sources.

Usage

from datasets import load_dataset
ds = load_dataset("Sibi5181/codesec-sast-dataset")

def to_text(ex):
    p = ex["instruction"] + (("\n\n" + ex["input"]) if ex["input"] else "")
    return {"text": p + "\n\n" + ex["output"]}

train = ds["train"].map(to_text)

Intended use & limitations

  • For defensive security research, SAST/SCA tooling, and triage assistants.
  • Commit-diff labeling: for BigVul records, vulnerable_lines are the lines changed by the fix commit — a standard but imperfect proxy (fix commits may touch unrelated lines). DiverseVul labels are function-level only.
  • Heavily C/C++ (see language-skew note); assembly and obfuscation are curated seed sets — high-signal but small.
  • Snapshot in time; re-run the scripts in build/ to refresh advisories/corpora.
Downloads last month
-