AdversarialEval dataset v1.0 (from github.com/Ritapossible/AdversarialEval at 184659f)
Browse filesFiles changed (7)
- LICENSEAdded+21
- NOTICE.mdAdded+17
- README.mdAdded+125
- SHA256SUMSAdded+6
- data/test.jsonlAdded+40
- data/train.jsonlAdded
- data/validation.jsonlAdded
123456789101112131415161718192021MIT License
Copyright (c) 2026 Ritapossible
Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THESOFTWARE.1234567891011121314151617# Notices and attributions
**Licence:** our code, documentation and our own preference pairs are released under theMIT licence ([`LICENSE`](LICENSE)). Third-party material keeps its own licence, as listedbelow. In particular, the advisory facts from the GitHub Advisory Database stay CC BY 4.0and need the attribution below wherever they're reused.
## Advisory data (CC BY 4.0)
`data/sources/osv/` holds copies of advisory records fetched from the[OSV API](https://osv.dev). All of them are **GitHub Advisory Database** records (GHSA ids),licensed under [Creative Commons Attribution 4.0](https://creativecommons.org/licenses/by/4.0/)(© GitHub, Inc. and contributors; https://github.com/github/advisory-database). They areunmodified. The facts our preference pairs state about advisories (ids, aliases, affectedand patched versions, severity) come from these records, and every pair cites its advisoryURL in `source_url`. Version lookups also query OSV, whose PyPI records come from thePyPA Advisory Database (CC BY 4.0, https://github.com/pypa/advisory-database).123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125---license: mitlanguage:- enpretty_name: AdversarialEval SECURITY_REVIEW preference pairssize_categories:- n<1Ktask_categories:- text-classificationtags:- security- preference- reward-model- dpo- vulnerability- telegraphconfigs:- config_name: default data_files: - split: train path: data/train.jsonl - split: validation path: data/validation.jsonl - split: test path: data/test.jsonl---
# AdversarialEval: security review preference pairs (v1.0)
Pairs of answers to software security questions in which the worse answer is **plausible but wrongin one decisive, verifiable way**: a real advisory id for the wrong package, a patched versioncalled vulnerable, a confident "Secure" on vulnerable code, a fix that doesn't fix. A judge thatrewards length, fluency or security keywords picks the wrong answer. A judge that checks the factspicks the right one.
Built for the `SECURITY_REVIEW` intent on [Telegraph](https://telegraphprotocol.com), Season II.Project: https://github.com/Ritapossible/AdversarialEval
## Splits
| Split | Pairs | Who wrote them | Review ||---|---:|---|---|| train | 264 | generated from OSV records (`generator:osv-v1`) and drafted with an AI assistant (`claude-draft`) | every advisory fact machine-checked against OSV; not individually human-reviewed || validation | 87 | the same, in a second voice (`claude-draft-voice2`) | as train || test | 40 | two independent outside authors, Fexx (drafted with GPT-6) and Lino (drafted with Grok) | each author read and revised every pair |
The splits are disjoint (near-duplicate check across all of them), and none of them overlapsthe private material uploaded to Telegraph's evaluation pool, which is not part of this release.
## Fields
| Field | Meaning ||---|---|| `id` | SHA-256 row id over prompt, chosen and rejected || `prompt` | the question (often with code or a dependency pin) || `chosen` | the better answer || `rejected` | the worse answer: plausible, wrong in one decisive way || `family` | the failure family of the rejected answer (table below) || `flaw_note` | what exactly is wrong with the rejected answer || `source_url` | the public source that settles it (GitHub advisory, NVD, CWE or vendor docs) || `verdict_chosen`, `verdict_rejected` | the verdict each answer gives (Secure, Insecure, Needs changes, ...) || `case`, `format`, `author`, `reviewed`, `label_kind`, `provenance` | provenance details |
Rendered for a reward model as `### Task:\n{prompt}\n\n### Answer:\n{answer}`. Every row fits in 512tokens, with the decisive flaw early.
## Failure families
| Family | Meaning | Train | Validation | Test ||---|---|---:|---:|---:|| F0 | not labelled (independent test pairs) | 0 | 0 | 40 || F1 | wrong advisory id | 28 | 6 | 0 || F2 | version-range error | 100 | 33 | 0 || F3 | missed critical issue | 11 | 3 | 0 || F4 | context reversal | 20 | 6 | 0 || F5 | overconfident "Secure" | 15 | 5 | 0 || F6 | false alarm | 26 | 5 | 0 || F7 | inconsistent fields | 28 | 11 | 0 || F8 | wrong severity or class | 20 | 11 | 0 || F9 | needless hedging | 6 | 3 | 0 || F10 | ineffective fix | 10 | 4 | 0 |
## Baselines
- **Shortcut judges** (longer answer, shorter answer, more advisory ids, security keywords): at most 58% on validation and 60% on test.- **An adapter trained on the train split** with Telegraph's official kit: 72 to 75% on validation and **77.5%** (31/40, 95% CI 62.5 to 87.7%) on the independent test. Details are in the project's reports.
## Intended use
Training and evaluating reward models, judges and evaluators for security answers, and checkingthat a judge isn't rewarding length or keywords. It is not a vulnerability database: check factsagainst the cited source before relying on them.
## Limitations
- **Small:** 391 pairs.- **One author style:** train and validation share it, so validation overstates accuracy on other authors' material.- **Mostly machine-checked:** the train and validation pairs are drafted with an AI assistant or generated, then checked against OSV by script, not read row by row by a person. The test pairs are AI-assisted drafts revised by their human authors.- **Coverage:** advisory facts are as of November 2026; later advisories can change what is vulnerable.
## Licence and attribution
The pairs are released under the MIT licence. The advisory facts they state come from the**GitHub Advisory Database** (CC BY 4.0, © GitHub, Inc. and contributors,https://github.com/github/advisory-database) and the PyPA Advisory Database (CC BY 4.0), through[OSV](https://osv.dev). Keep that attribution when you reuse them. Thanks to Fexx and Lino forthe independent test pairs.
## Citation
```@misc{adversarialeval2026, title = {AdversarialEval: security review preference pairs}, author = {Rita (Ritapossible)}, year = {2026}, url = {https://github.com/Ritapossible/AdversarialEval}}```123456a021ca8945f0380778bd8fa77025132c80ef3cc424ff6c9b1a874757c7ef8187 LICENSE68d68537d8ed2f6b0585b695b9ba290bb6ae38875e017a6e4a1a30a077932c7f NOTICE.md4eda0341f9804410eb867cb8469444630d108ed13787e3940ffdd70511f0cec4 README.md401c9c328edd7665bdebb61731e841bc416a31f3901c91b1fce21bcd2d0d4e4d data/test.jsonl412c945cfc73da316bdd589cb4b80679799931cc25274826b0c146046cc3a774 data/train.jsonl38dced89473069f94771e24ffd6c612b3fb07200e8cd9ed1ab56c22d0d0c0bfc data/validation.jsonl12345678910111213141516171819202122232425262728293031323334353637383940{"id": "9e42a02b444fa083e43ff162c857f633221b43a43fc9e005575a7edf6bbc9305", "prompt": "Review only SQL injection in this SQLite lookup. The table name and SQL are constants; handle is the only attacker-controlled string. Authorization is handled separately.\nrow = db.execute('SELECT public_name FROM directory WHERE handle = ?', (handle,)).fetchone()", "chosen": "Secure, 0 SQL-injection issues in this lookup. SQLite binds handle as a value; its punctuation cannot become SQL syntax. Keep the placeholder and separate parameter tuple. Binding handles quotes without hand-written escaping.", "rejected": "Needs changes, 1 SQL-injection issue (CWE-89) in this lookup. SQLite expands handle into SQL before execution, so its punctuation can become syntax. Escape quotes before binding the parameter.", "case": "t-fexx-001", "family": "F0", "format": "prose", "source_url": "https://docs.python.org/3/library/sqlite3.html#how-to-use-placeholders-to-bind-values-in-sql-queries", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer mistakes bound data for interpolated SQL syntax.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://docs.python.org/3/library/sqlite3.html#how-to-use-placeholders-to-bind-values-in-sql-queries"}}{"id": "3fdceb108134113e85cb97de6493ff7dc76e68a9f005e6bc327bdf3c0d093772", "prompt": "An authenticated search endpoint should return only public product names, but its database role can also read a private supplier table. q is arbitrary client input. Review this SQLite query; there are no other SQL transformations:\nsql = \"SELECT name FROM products WHERE name = '\" + q + \"'\"\nrows = db.execute(sql).fetchall()", "chosen": "Insecure, 1 issue: CWE-89 SQL injection. Concatenation makes q part of SQL syntax; a single injected statement can change what is read. Bind q as a value.", "rejected": "Secure, 0 SQL-injection issues. execute accepts only one statement, so concatenating q cannot change what is read. Keep the current call and reserve parameter binding for multi-statement APIs.", "case": "t-fexx-002", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/89.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer assumes that rejecting multiple statements prevents injection within one statement.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/89.html"}}{"id": "6930bc33b41f65ddd7c0901bf3797e0f9f35a4653a945cdcb711bdf28f96ceb7", "prompt": "Triage only CVE-2020-8203 / GHSA-p6mc-m468-83gw. The runtime package is npm lodash-es 4.17.19, not lodash. Untrusted property paths reach its object-update helpers. A change request says the advisory was patched at 4.17.19 and closes the alert. Is that package-specific conclusion correct?", "chosen": "Needs changes, 1 issue: CVE-2020-8203 prototype pollution. lodash-es 4.17.19 is in its affected range >=3.7.0,<4.17.20; the listed patch is 4.17.20. The lodash package has a different patch boundary.", "rejected": "Secure, 0 issues for CVE-2020-8203. lodash-es 4.17.19 can use lodash's patch boundary >=3.7.0,<4.17.19, so this installed version is patched and the alert can close.", "case": "t-fexx-003", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-p6mc-m468-83gw", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The worse answer applies the verified lodash range to lodash-es, whose patch boundary is different.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-p6mc-m468-83gw"}}{"id": "7995573aa15aa0f38d173790e62c8307019466a3aaf6eed4bd359ba637a9f4d2", "prompt": "A support page displays an untrusted ticket title. #ticket-title is an ordinary h2 element, not a script or style element, and no code later reads and reinserts its contents as HTML. Review only DOM XSS:\ndocument.querySelector('#ticket-title').textContent = ticket.title;", "chosen": "{\"verdict\":\"Secure\",\"issue_count\":0,\"issues\":[],\"reason\":\"The ordinary heading receives textContent, so the title is inserted as text rather than parsed as HTML. No later HTML sink is present.\"}", "rejected": "{\"verdict\":\"Needs changes\",\"issue_count\":1,\"issues\":[\"CWE-79 DOM XSS\"],\"reason\":\"The ordinary heading receives textContent, so markup in the title is parsed as HTML and can execute.\"}", "case": "t-fexx-004", "family": "F0", "format": "json", "source_url": "https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer incorrectly treats textContent on an ordinary heading as an HTML parsing sink.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://developer.mozilla.org/en-US/docs/Web/API/Node/textContent"}}{"id": "2a10d8936b55c5fbf310d95ff9fd8cf5ffe8987e73a70b0be40cd22e6a17323f", "prompt": "A Linux report service runs the following code. folder comes directly from a JSON request, may contain shell metacharacters, and is not validated. The service can read confidential local files. Review command execution:\nsubprocess.run('du -sk ' + folder, shell=True, check=True, timeout=3)", "chosen": "- Verdict: Insecure\n- Issue count: 1\n- CWE-78 command injection: the shell parses folder as command text. A three-second timeout limits runtime, not which commands can run. Pass a fixed executable and separate arguments with shell=False.", "rejected": "- Verdict: Secure\n- Issue count: 0\n- Command execution: the three-second timeout and check=True prevent injected shell commands from running, so folder does not need argument separation or validation.", "case": "t-fexx-005", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/78.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer treats timeout and exit-status checking as protection against shell injection.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/78.html"}}{"id": "d517c4f3e3b4a2cfbf62b8f8096e218f507bd77f1c3a40bb7c32cffe556931c6", "prompt": "Review only CVE-2021-44906 / GHSA-xvch-5gv4-984h for npm minimist 0.2.3. A web task runner passes client-supplied option arrays into minimist. Operations proposes replacing it with minimist 1.2.5 to resolve this advisory. Give the finding and whether that exact replacement resolves it.", "chosen": "- Verdict: Needs changes\n- Issue count: 1\n- CVE-2021-44906: prototype pollution. Both 0.2.3 and proposed 1.2.5 are affected. The advisory patches are 0.2.4 and 1.2.6; choose a patched release.", "rejected": "- Verdict: Needs changes\n- Issue count: 1\n- CVE-2021-44906: prototype pollution affects installed 0.2.3. Moving to proposed 1.2.5 resolves this advisory because leaving the 0.2 branch is sufficient.", "case": "t-fexx-006", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-xvch-5gv4-984h", "verdict_chosen": "Needs changes", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer recommends 1.2.5 as a fix even though that version is inside the affected 1.x range.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-xvch-5gv4-984h"}}{"id": "e8f4739e5a2039b28e6036dabae9b142179498e5e5ea9141fd2924079386220c", "prompt": "Flask uses its default Jinja configuration. A developer owns profile.html, which contains <p>{{ nickname }}</p>. The route calls render_template('profile.html', nickname=request.args.get('nickname', '')). nickname is an ordinary string; there is no Markup(), safe filter, or autoescape override. Review only reflected HTML injection at this interpolation.", "chosen": "- Verdict: Secure\n- Issue count: 0\n- HTML injection: the .html template autoescapes this plain-string variable in a text context. Preserve that escaping.", "rejected": "- Verdict: Insecure\n- Issue count: 1\n- HTML injection (CWE-79): the .html template inserts this plain-string variable without escaping. Add an escaping filter immediately.", "case": "t-fexx-007", "family": "F0", "format": "prose", "source_url": "https://flask.palletsprojects.com/en/stable/templating/", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "The worse answer ignores Flask default autoescaping for an HTML template.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://flask.palletsprojects.com/en/stable/templating/"}}{"id": "ceb7c1191e21f0c1ce7e03b560a98d99fbed92c522f7bc0be9b6f53dc839e146", "prompt": "In a Linux application, request.args['file'] is untrusted. /srv/exports contains public exports, while the process can also read confidential files outside it. No confinement checks or symlink protections are performed. Review file access:\npath = os.path.join('/srv/exports', request.args['file'])\nreturn open(path, 'rb').read()", "chosen": "Insecure | issues=1 | CWE-22 path traversal. Joining a base directory does not confine the result; parent components or an absolute input can select a readable file outside exports.", "rejected": "Secure | issues=0 | path confinement. os.path.join anchors every input below the base directory; parent components and absolute inputs are automatically constrained to exports before open runs.", "case": "t-fexx-008", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/22.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer attributes confinement guarantees to os.path.join that it does not provide.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/22.html"}}{"id": "880bfff3b78c94ba18dcda4dc9197435253a832dd020dc6f02ed18c00b43815c", "prompt": "A dependency ticket concerns npm axios 1.8.1 and CVE-2025-27152 / GHSA-jr5f-v2jv-69x6. Treat exploitability as established for this ticket. Report the GitHub Advisory Database severity label and vulnerability type, not a deployment-specific CVSS reassessment. Keep the scope to this one advisory.", "chosen": "{\"verdict\":\"Needs changes\",\"issue_count\":1,\"issues\":[{\"id\":\"CVE-2025-27152\",\"type\":\"SSRF and credential leakage through absolute URLs\",\"github_severity\":\"High\"}]}", "rejected": "{\"verdict\":\"Needs changes\",\"issue_count\":1,\"issues\":[{\"id\":\"CVE-2025-27152\",\"type\":\"SSRF and credential leakage through absolute URLs\",\"github_severity\":\"Critical\"}]}", "case": "t-fexx-009", "family": "F0", "format": "json", "source_url": "https://github.com/advisories/GHSA-jr5f-v2jv-69x6", "verdict_chosen": "Needs changes", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer changes the verified GitHub severity label from High to Critical.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-jr5f-v2jv-69x6"}}{"id": "5632eab301cd1c8607fb51463d9aa20c8c4d651c71cc4d4a457752fe4196ecb2", "prompt": "Assess shell-command injection only. This runs on Linux, /usr/bin/printf is trusted, the format string is constant, and the user controls only label. No later command consumes stdout:\nsubprocess.run(['/usr/bin/printf', '%s', label], shell=False, check=True)", "chosen": "Secure | issues=0 | shell injection: absent in this invocation. label is a separate argument to printf, whose constant %s format prints it as data; no shell parses it. The executable path is also fixed.", "rejected": "Insecure | issues=1 | CWE-78 shell injection: present in this invocation. label is a separate argument to printf, but subprocess still sends it through a shell that interprets command separators.", "case": "t-fexx-010", "family": "F0", "format": "prose", "source_url": "https://docs.python.org/3/library/subprocess.html#security-considerations", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "The worse answer invents shell interpretation despite shell=False and a fixed executable and format.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://docs.python.org/3/library/subprocess.html#security-considerations"}}{"id": "7004d5f6bbee3372a8f5acfb108698c9a4039b3bbe0a4bab08e9160d9c08e35c", "prompt": "Review access control. A verified session identifies the caller, but invoices belong to different users. Invoice IDs are random UUIDs that sometimes appear in shared logs. This is the complete data-access check:\n@login_required\ndef invoice(invoice_id):\n row = db.execute('SELECT pdf FROM invoices WHERE id=?', (invoice_id,)).fetchone()\n if row is None: abort(404)\n return row['pdf']", "chosen": "{\"verdict\":\"Insecure\",\"issue_count\":1,\"issues\":[\"IDOR: missing invoice ownership check\"],\"reason\":\"A logged-in user who learns another invoice UUID can read it; authentication does not authorize that object. Scope the lookup to its owner.\"}", "rejected": "{\"verdict\":\"Secure\",\"issue_count\":0,\"issues\":[],\"reason\":\"The session is authenticated and invoice IDs are random UUIDs, so a logged-in user who learns another invoice UUID is still prevented from reading it.\"}", "case": "t-fexx-011", "family": "F0", "format": "json", "source_url": "https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Direct_Object_Reference_Prevention_Cheat_Sheet.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer substitutes authentication and hard-to-guess identifiers for object authorization.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Direct_Object_Reference_Prevention_Cheat_Sheet.html"}}{"id": "6d1e96372953f95ee55da0f3d40b4aba14661d08720b220c5f4141ae5a077cee", "prompt": "Review a proposed SQLite injection fix. raw_id is an arbitrary request string, not a validated integer. The new code removes single quotes, then places the result in an unquoted numeric expression:\nclean_id = raw_id.replace(\"'\", '')\nrow = db.execute('SELECT body FROM notes WHERE id=' + clean_id).fetchone()\nThe route may read only the selected note. Is the quote-removal patch sufficient?", "chosen": "Needs changes | issues=1 | CWE-89 SQL injection persists. An unquoted expression can be altered without single quotes. Bind the identifier value; quote removal does not establish an integer.", "rejected": "Needs changes | issues=1 | CWE-89 SQL injection is resolved by removing single quotes. Keep this patch; the remaining issue is documenting why quote removal establishes a safe integer expression.", "case": "t-fexx-012", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/89.html", "verdict_chosen": "Needs changes", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer incorrectly claims quote removal fixes injection into an unquoted SQL expression.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/89.html"}}{"id": "2cdb4f5a04a018d7aa7f5e29ee320298e628b7e0370e50e23be30e47b5bede1a", "prompt": "A download handler uses this exact map. Unknown keys return 404. Both files are deliberately public, deployment-owned regular files; users cannot modify the directory or introduce symlinks. Review path traversal only:\nFILES = {'guide': '/srv/public/guide.pdf', 'terms': '/srv/public/terms.pdf'}\npath = FILES.get(request.args.get('doc', ''))\nif path is None: abort(404)\nreturn send_file(path)", "chosen": "Secure, 0 path-traversal issues in this handler. The user selects a map key; only the two fixed public paths reach send_file. Unknown path-like strings are rejected.", "rejected": "Needs changes, 1 path-traversal issue (CWE-22) in this handler. The user selects a map key, and send_file expands parent-directory segments in that key before opening the selected file.", "case": "t-fexx-013", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/22.html", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer confuses a lookup key with the fixed path returned by the lookup.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/22.html"}}{"id": "6637e5b3e209808c53f6b2bd3b5230c50ec36b6b0e631d48dd4fd68471c0290a", "prompt": "A server-side preview endpoint accepts an arbitrary client URL. Its network can reach unauthenticated private administrative HTTP services. There is no destination validation or egress filter. Assess this purchase-free helper:\nr = requests.get(body['url'], timeout=2, allow_redirects=False)\nreturn r.text", "chosen": "Insecure, 1 issue: CWE-918 SSRF. A caller can select a private service directly and receive its response. Disabling redirects does not restrict the initial destination. Validate allowed destinations before fetching.", "rejected": "Secure, 0 SSRF issues. A caller cannot reach a private service because allow_redirects=False prevents every request from crossing from the public interface to a private destination.", "case": "t-fexx-014", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/918.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer mistakes a redirect restriction for validation of the original URL.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/918.html"}}{"id": "5f98a01120471fe9e2e363e165623ae82d22a511b11526fd47773151747e80d4", "prompt": "Is this path-traversal patch sufficient? All paths below are POSIX paths; the filesystem is static during the request and contains no symlinks. Only descendants of /srv/reports are allowed. The process can also read /srv/reports-old/private.txt. relative is arbitrary client input:\nroot = Path('/srv/reports')\ntarget = (root / relative).resolve()\nif not str(target).startswith(str(root)): abort(403)\nreturn target.read_bytes()", "chosen": "- Verdict: Needs changes\n- Issue count: 1\n- CWE-22 containment failure: reports-old shares the string prefix. Compare resolved path ancestry rather than a character prefix before reading.", "rejected": "- Verdict: Secure\n- Issue count: 0\n- Path containment: resolve removes traversal components and startswith then proves ancestry. A reports-old sibling cannot pass this resolved-path check.", "case": "t-fexx-015", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/22.html", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The worse answer treats a character prefix as proof that a resolved path is inside the allowed directory.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/22.html"}}{"id": "d16942a3ae9ac75af3a772cdd0227eb2a41a4382f32047ea03365c125f01a292", "prompt": "Check cross-account invoice reads only. user_id comes from a verified server session. Only an invoice owner may read it. Query parameters are bound, and a missing row produces 404 with no invoice data:\nrow = db.execute('SELECT pdf FROM invoices WHERE id=? AND owner_id=?', (invoice_id, user_id)).fetchone()\nif row is None: abort(404)\nreturn row['pdf']", "chosen": "{\"verdict\":\"Secure\",\"issue_count\":0,\"issues\":[],\"reason\":\"Both invoice identity and authenticated ownership constrain the lookup. Changing invoice_id cannot return another owner's invoice.\"}", "rejected": "{\"verdict\":\"Needs changes\",\"issue_count\":1,\"issues\":[\"IDOR\"],\"reason\":\"An attacker can change invoice_id, so this lookup returns another owner's invoice even though authenticated ownership is also checked.\"}", "case": "t-fexx-016", "family": "F0", "format": "json", "source_url": "https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Direct_Object_Reference_Prevention_Cheat_Sheet.html", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer reports an IDOR while ignoring the ownership restriction in the same query.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cheatsheetseries.owasp.org/cheatsheets/Insecure_Direct_Object_Reference_Prevention_Cheat_Sheet.html"}}{"id": "1ca650ceddc66efd72bac666229aa9de2282fd9e3a4f16da59df8a026ce65dd0", "prompt": "A customer message is stored verbatim and later displayed to staff. The page has no sanitizer, Trusted Types enforcement, or restrictive CSP. #message is a div. Review this display operation:\ndocument.querySelector('#message').innerHTML = message.body;\nA teammate argues it is safe because scripts inserted through innerHTML do not execute as ordinary script elements.", "chosen": "- Verdict: Insecure\n- Issue count: 1\n- CWE-79 stored DOM XSS: HTML parsing also permits active event-handler markup. Nonexecution of inserted script elements does not make this sink safe. Use textContent for this plain message.", "rejected": "- Verdict: Secure\n- Issue count: 0\n- Stored DOM XSS: nonexecution of script elements means innerHTML cannot execute attacker code through any markup, including event handlers. Keep this display operation.", "case": "t-fexx-017", "family": "F0", "format": "prose", "source_url": "https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#security_considerations", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer generalizes script-element behavior to all active HTML content.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://developer.mozilla.org/en-US/docs/Web/API/Element/innerHTML#security_considerations"}}{"id": "72a8c52b235cb41b7d549a0c4fbf543fdc003e689d2ec9036ce476bba2911377", "prompt": "An authenticated dashboard directly sets an HTTP Location header from return_to, which accepts arbitrary absolute HTTPS URLs. There is no destination allowlist. This is a redirect only: the server does not fetch or evaluate the URL. Review only open redirection. Return JSON with verdict, issue_count and issues; issue_count must equal the number of findings in issues.", "chosen": "{\"verdict\":\"Needs changes\",\"issue_count\":1,\"issues\":[{\"id\":\"CWE-601\",\"name\":\"Open redirect\",\"fix\":\"Map an allowlisted destination key to a fixed local path.\"}]}", "rejected": "{\"verdict\":\"Needs changes\",\"issue_count\":0,\"issues\":[{\"id\":\"CWE-601\",\"name\":\"Open redirect\",\"fix\":\"Map an allowlisted destination key to a fixed local path.\"}]}", "case": "t-fexx-018", "family": "F0", "format": "json", "source_url": "https://cwe.mitre.org/data/definitions/601.html", "verdict_chosen": "Needs changes", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer reports zero issues while listing one open-redirect finding.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/601.html"}}{"id": "ec01816e33c92451d5f94be91810a53d6beaaca5bc3be443b9ef8bb324c552f2", "prompt": "Review only the unpredictability of this reset-token generator:\ntoken = secrets.token_urlsafe(32)\nAssume a healthy OS random source. Expiration, one-time redemption, transport, storage and account binding are handled correctly elsewhere. A scanner says URL-safe encoding makes these tokens predictable.", "chosen": "Secure | issues=0 | token prediction: the call uses 32 random bytes from a cryptographic source. URL-safe encoding changes representation, not the underlying unpredictability. Decoding one token reveals no generator state.", "rejected": "Needs changes | issues=1 | token prediction: URL-safe encoding is reversible, so an observer can calculate the next token from the previous one despite the cryptographic random source.", "case": "t-fexx-019", "family": "F0", "format": "prose", "source_url": "https://docs.python.org/3/library/secrets.html#secrets.token_urlsafe", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "The worse answer conflates reversible encoding with predictability of independently generated random bytes.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://docs.python.org/3/library/secrets.html#secrets.token_urlsafe"}}{"id": "ea22df58db7f7a4bdad4cfe40a31ccdbf983432b7a14ed575741db3200f323e3", "prompt": "A desktop client shipped to every customer contains API_KEY = '<shared-production-key>'. The placeholder stands for the same real production credential in every build. The server accepts that key alone to read every tenant's private reports. No user-specific authorization exists. Review the credential design only; do not attempt any request.", "chosen": "Insecure | issues=1 | CWE-798 shared hard-coded credential. A recipient can extract the key and exercise its cross-tenant privileges. A compiled client cannot keep a distributed shared key secret.", "rejected": "Secure | issues=0 | shared credential storage. Compiling the key into the client prevents recipients from extracting it, so using that key alone for cross-tenant report access is acceptable.", "case": "t-fexx-020", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/798.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The worse answer assumes compilation makes a credential distributed to customers secret.", "author": "reviewer:fexx", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/798.html"}}{"id": "47478fc4074e5f381f1e5b4e36280c5433f9459b84e5605fa3a628d6969ea415", "prompt": "Review this Python Flask endpoint for SQL injection: user_id = request.args.get('id'); cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,))", "chosen": "Secure, 0 issues. Parameterized query with %s and tuple binding keeps data separate from SQL syntax. No CWE-89.", "rejected": "Insecure, 1 issue: CWE-89 SQL injection (high). User input reaches the query. Switch to an ORM.", "case": "t-lino-001", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/89.html", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "Parameterized queries bind values as data, preventing injection; the worse answer invents an interpolation step that does not exist.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/89.html"}}{"id": "136b05393c5982cd60b964975e384abde08015e37c99200e2c3586751a9db149", "prompt": "Is this React component vulnerable to XSS? function Comment({text}) { return <div>{text}</div>; }", "chosen": "Secure, 0 issues. React auto-escapes text children in JSX, rendering markup as literal text. No CWE-79 here.", "rejected": "Insecure, 1 issue: CWE-79 XSS (medium). Even though React claims to escape, many older browsers still interpret the text node as HTML when the component re-renders, and the text prop can contain event handlers. Escape manually with a library and also set a Content-Security-Policy.", "case": "t-lino-002", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/79.html", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "JSX text interpolation auto-escapes by default, so the pattern is safe against XSS.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/79.html"}}{"id": "76d76f47a872dff582d05bb4ad57938d60e8d94063f13915297007c4c2932669", "prompt": "Our Express 4.21.1 app does res.redirect(req.query.returnUrl) after login with no validation. Severity?", "chosen": "Needs changes, 1 issue: CWE-601 open redirect (medium). An attacker can send users to a phishing site after a successful login. Restrict to relative paths starting with a single /.", "rejected": "Secure, 0 issues. Express 4.21.1 is after the GHSA-rv95-896h-c2vc fix, so all redirects are safe.", "case": "t-lino-003", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/601.html", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The GHSA only fixes malformed-URL bypasses of allowlists; direct absolute user URLs still create open redirects.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/601.html"}}{"id": "c1dbc32fda9ebe94bc03cbde4d7b552dd1d815368058a79a8537b5e7aef76a86", "prompt": "Review: const cmd = `ls ${req.query.dir}`; require('child_process').exec(cmd, cb);", "chosen": "Insecure, 1 issue: CWE-78 OS command injection (high). Shell interpretation of the interpolated string allows arbitrary command execution. Use execFile with an argument array and shell=false.", "rejected": "Needs changes, 1 issue: CWE-22 path traversal (medium). Sanitize the directory name before use.", "case": "t-lino-004", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/78.html", "verdict_chosen": "Insecure", "verdict_rejected": "Needs changes", "flaw_note": "It misses the shell metacharacter injection that turns a path into full command execution.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/78.html"}}{"id": "16b85df567dcd21a1afafd71d960335f1cc6b0251bc40b38dc258d649f7c163f", "prompt": "We use lodash 4.17.21. Is it affected by GHSA-xxjr-mmjv-4gpg (prototype pollution in _.unset/_.omit)?", "chosen": "Needs changes, 1 issue: GHSA-xxjr-mmjv-4gpg (moderate). Affects >=4.0.0 <=4.17.22; 4.17.21 is in range. Upgrade to >=4.17.23.", "rejected": "Secure, 0 issues. GHSA-xxjr-mmjv-4gpg only affects experimental 5.x builds, and 4.17.21 has been the safe baseline for years.", "case": "t-lino-005", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-xxjr-mmjv-4gpg", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The advisory was published later and explicitly covers versions through 4.17.22.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-xxjr-mmjv-4gpg"}}{"id": "be8c814db55693d59a0a99da97d95f43aaefbff97cbba3a4b737b98ea5e66e3b", "prompt": "Review: fs.readFileSync('/var/app/config.json'); // constant path, no user input", "chosen": "Secure, 0 issues. Fixed absolute path with no external input. No CWE-22 or injection risk.", "rejected": "Insecure, 1 issue: CWE-22 path traversal (medium). Absolute paths can still be abused if an attacker controls the process working directory or mounts a malicious volume over /var/app. Always resolve and check the realpath.", "case": "t-lino-006", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/22.html", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "Absence of user-controlled path data means no traversal is possible.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/22.html"}}{"id": "540dd7e8083d933d0efed93ba24b441bc1e5256f5730559a2c3e22fb3e81c122", "prompt": "PHP: $sql = \"SELECT * FROM users WHERE name = '\" . $_GET['name'] . \"'\"; mysqli_query($conn, $sql);", "chosen": "Insecure, 1 issue: CWE-89 SQL injection (high). User input is concatenated into the SQL string. Use prepared statements with bound parameters.", "rejected": "Needs changes, 1 issue: CWE-79 XSS (medium). Escape the name before displaying results.", "case": "t-lino-007", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/89.html", "verdict_chosen": "Insecure", "verdict_rejected": "Needs changes", "flaw_note": "It classifies a clear SQL injection as XSS and ignores the database impact.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/89.html"}}{"id": "0cd7adfa6607eef77e261f950857040e38be4645e1ef7fc1e5f8cfc9f516f656", "prompt": "Scanner flags lodash 4.18.1 for GHSA-f23m-r3pf-42rh. Confirm?", "chosen": "Secure regarding this advisory, 0 issues. GHSA-f23m-r3pf-42rh affects >=4.17.23 <4.18.1; 4.18.1 is the patched version.", "rejected": "Insecure, 1 issue: GHSA-f23m-r3pf-42rh (high) prototype pollution. The advisory text lists 4.18.1 as still vulnerable in the lodash-es sub-package, so you must force a resolution to 4.18.2 or later and also audit every call site that uses unset.", "case": "t-lino-008", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-f23m-r3pf-42rh", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "4.18.1 is explicitly the fixed release; the worse answer also inflates the severity.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-f23m-r3pf-42rh"}}{"id": "71753d2357e36659b6f91ed299c99a819498292c85620f67d54ed795f964fe02", "prompt": "package.json lists \"eslint\": \"^8.0.0\" only under devDependencies. Production risk?", "chosen": "Secure, 0 issues when installed with --omit=dev or NODE_ENV=production. Plain npm install includes devDependencies; they are omitted only by those flags.", "rejected": "Insecure, 1 issue: high severity in eslint. Even if marked as a devDependency the package is always installed and executed during the production build step, so any vulnerability becomes a runtime risk. Remove it entirely.", "case": "t-lino-009", "family": "F0", "format": "prose", "source_url": "https://docs.npmjs.com/cli/v10/commands/npm-install", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "DevDependencies are installed by default npm install; they are skipped only with --omit=dev or NODE_ENV=production.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://docs.npmjs.com/cli/v10/commands/npm-install"}}{"id": "9922b34ce933a1e3493e0de2897e2eb7a480e676ab63dd87049a1cf189cdc48a", "prompt": "Review: document.getElementById('out').innerHTML = userComment;", "chosen": "Insecure, 1 issue: CWE-79 XSS (high). Assigning to innerHTML parses and can execute markup from the string. Use textContent instead.", "rejected": "Secure, 0 issues. Modern browsers automatically sanitize innerHTML assignments by stripping script tags and event handlers before insertion, so the assignment is safe as long as the page sets a Content-Security-Policy.", "case": "t-lino-010", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/79.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "Browsers do not sanitize innerHTML; the content is parsed as HTML.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/79.html"}}{"id": "b3cd4a557eef84f10ae7b59343a691803183b5f4a13fb2d3c60cc18901e3c820", "prompt": "Review: subprocess.run(['ls', '-l', '/tmp'], shell=False) # no user input", "chosen": "Secure, 0 issues. Argument list plus shell=False with constant values. No CWE-78.", "rejected": "Insecure, 1 issue: CWE-78 command injection (medium). Even with shell=False the list form can still be exploited if an attacker controls the environment variables that the shell would have expanded, or if ls itself is replaced by a malicious binary in PATH.", "case": "t-lino-011", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/78.html", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "Fixed arguments and shell=False prevent injection when no untrusted data is present.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/78.html"}}{"id": "552c0e410cb4e309ebf87154eed41effb142d8f710716e21fb0e09b14ffccb04", "prompt": "app.get('/file', (req, res) => { const p = path.join('/uploads', req.query.name); res.sendFile(p); })", "chosen": "Needs changes, 1 issue: CWE-22 path traversal (high). ../ in name escapes the base directory. Resolve the path and verify it stays under /uploads.", "rejected": "Secure, 0 issues. path.join normalizes sequences and blocks traversal.", "case": "t-lino-012", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/22.html", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "path.join does not confine the result to the base directory when the second argument contains parent references.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/22.html"}}{"id": "66699fa778f3e909c6abbaf6c934721254ae64205dcad4c4177233b0d879f840", "prompt": "We are on express 4.18.2. Affected by GHSA-rv95-896h-c2vc?", "chosen": "Needs changes, 1 issue: GHSA-rv95-896h-c2vc / CVE-2024-29041 (moderate). Affects <4.19.2; 4.18.2 is vulnerable. Upgrade to >=4.19.2.", "rejected": "Secure, 0 issues. That advisory only covers 5.x alpha/beta releases.", "case": "t-lino-013", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-rv95-896h-c2vc", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The advisory explicitly lists all versions prior to 4.19.2 as affected.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-rv95-896h-c2vc"}}{"id": "4d0622404d1ddbd3ff3840c695cf217515379412f2385e77a638dca8fe6fd20d", "prompt": "Jinja2 template with autoescape=True containing {{ user_input }} rendered to HTML.", "chosen": "Secure, 0 issues. Autoescape encodes the value for the HTML context. No CWE-79.", "rejected": "Insecure, 1 issue: CWE-79 XSS (medium). Autoescape only encodes a subset of characters and fails when the template is later concatenated with other HTML or when the output is placed inside a JavaScript context. Always escape manually.", "case": "t-lino-014", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/79.html", "verdict_chosen": "Secure", "verdict_rejected": "Insecure", "flaw_note": "With autoescape enabled, Jinja2 performs the necessary HTML escaping automatically.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/79.html"}}{"id": "5ea844c3a4a12098e5a256307f44b96f6ba3288a20d7e1e822aaa82f75738624", "prompt": "Code calls _.unset(obj, req.body.path) using lodash 4.17.21.", "chosen": "Insecure, 1 issue: GHSA-xxjr-mmjv-4gpg (moderate) prototype pollution via untrusted path. Upgrade lodash and reject prototype keys.", "rejected": "Secure, 0 issues. Only _.merge is dangerous; _.unset is safe.", "case": "t-lino-015", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-xxjr-mmjv-4gpg", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "The advisory specifically identifies _.unset and _.omit as the vulnerable functions in that version range.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-xxjr-mmjv-4gpg"}}{"id": "4c0130d073ab6c1869d99f065167ddf98abc18f8f37fab40f21eca63a70b18a3", "prompt": "Review this Go snippet for command injection: out, err := exec.Command(\"sh\", \"-c\", \"ping -c 1 \"+userHost).Output()", "chosen": "Insecure, 1 issue: CWE-78 OS command injection (high). The userHost value is concatenated into a shell command. Use exec.Command(\"ping\", \"-c\", \"1\", userHost) so the host is a separate argument.", "rejected": "Needs changes, 1 issue: CWE-20 improper input validation (medium). Validate that userHost matches a hostname regex before calling ping, otherwise the network call could hang.", "case": "t-lino-016", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/78.html", "verdict_chosen": "Insecure", "verdict_rejected": "Needs changes", "flaw_note": "It misses the shell injection created by the -c string concatenation.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/78.html"}}{"id": "0b3d3dfecd8f3918d919027fea5f301e8688d0123521fa70a304e39bdcc9dd7c", "prompt": "if (['/home', '/profile'].includes(req.query.next)) res.redirect(req.query.next); else res.redirect('/');", "chosen": "Secure, 0 issues. Exact allowlist of relative paths prevents open redirects. No CWE-601.", "rejected": "Needs changes, 1 issue: CWE-601 (medium). Encoding or double-slash tricks can still bypass the check. An attacker can also use a protocol-relative URL or a backslash on Windows to escape the allowlist.", "case": "t-lino-017", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/601.html", "verdict_chosen": "Secure", "verdict_rejected": "Needs changes", "flaw_note": "A strict exact-match allowlist of relative paths blocks the redirect attack.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/601.html"}}{"id": "e5a3a0289bf3fc69020d5ce215684e884e6530f3a684f99f8eefa717ba01d84a", "prompt": "<div dangerouslySetInnerHTML={{__html: userHtml}} /> in a React component.", "chosen": "Insecure, 1 issue: CWE-79 XSS (high). This API inserts raw HTML and bypasses React's escaping. Sanitize with a library such as DOMPurify before use.", "rejected": "Secure, 0 issues. React always escapes content, even inside dangerouslySetInnerHTML.", "case": "t-lino-018", "family": "F0", "format": "prose", "source_url": "https://cwe.mitre.org/data/definitions/79.html", "verdict_chosen": "Insecure", "verdict_rejected": "Secure", "flaw_note": "dangerouslySetInnerHTML is the deliberate escape hatch that renders the string as HTML.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://cwe.mitre.org/data/definitions/79.html"}}{"id": "5a4a4faa5a16fe39157a3f9e4548b5acf0f2609dd245eb70de46d144573a001f", "prompt": "lodash 4.17.23. Is it affected by GHSA-f23m-r3pf-42rh?", "chosen": "Needs changes, 1 issue: GHSA-f23m-r3pf-42rh (moderate). Affects >=4.17.23 <4.18.1 (bypass of the prior fix). Upgrade to 4.18.1.", "rejected": "Secure, 0 issues. 4.17.23 patched the earlier prototype-pollution advisory, so this one does not apply. The maintainers stated that the 4.17.23 fix was comprehensive and no further bypasses exist.", "case": "t-lino-019", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-f23m-r3pf-42rh", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "GHSA-f23m-r3pf-42rh is the array-path bypass that specifically re-opens the issue on the 4.17.23 release.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-f23m-r3pf-42rh"}}{"id": "1975e14d39a885eaaf955ef7ffa32a8cd773d22d4d17d0b0ad38bdf1b4a7a011", "prompt": "Snyk reports high severity GHSA-r5fr-rjxr-66jc in lodash 4.17.21 related to _.template imports keys. Confirm?", "chosen": "Needs changes, 1 issue: GHSA-r5fr-rjxr-66jc (high, code injection). Affects versions <4.18.0. Do not supply untrusted key names to options.imports; upgrade to 4.18.0 or later.", "rejected": "Secure, 0 issues. The advisory is actually a low-severity ReDoS in the template parser (CWE-1333) that was already fixed in 4.17.15. The Snyk report is a false positive caused by an incorrect GHSA mapping.", "case": "t-lino-020", "family": "F0", "format": "prose", "source_url": "https://github.com/advisories/GHSA-r5fr-rjxr-66jc", "verdict_chosen": "Needs changes", "verdict_rejected": "Secure", "flaw_note": "The version is inside the affected range of a high-severity code-injection advisory; the worse answer invents a different weakness and a non-existent earlier fix.", "author": "reviewer:lino", "reviewed": true, "label_kind": "preference_pair", "provenance": {"source_kind": "ai_assisted", "source_url": "https://github.com/advisories/GHSA-r5fr-rjxr-66jc"}}LICENSEAdded+21
NOTICE.mdAdded+17
README.mdAdded+125
SHA256SUMSAdded+6
data/test.jsonlAdded+40
data/train.jsonlAdded
data/validation.jsonlAdded