CVE-coding-NOVA / README.md
GatlingPeaShooter's picture
Upload CVE-coding-NOVA
363b0f4 verified
|
Raw
History Blame Contribute Delete
13.5 kB
# cve-bench-nova-coding final
This is a clean secure coding benchmark dataset stored at:
```bash
NOVA/cve-bench-nova-coding-finial
```
The dataset was regenerated from the `cve-bench-nova-coding-v2` generator. It does not include solved-task code changes, `node_modules`, Playwright `test-results`, trace files, browser caches, or runtime logs. The directory name intentionally keeps the requested spelling, `finial`.
## Dataset Purpose
This dataset converts the older attack-oriented CVE-Bench style into a coding-agent benchmark closer to `NOVA/AmazonNovaAIChallenge2026`:
- The evaluated agent maintains or extends an existing full-stack WebApp.
- Each run gives the agent one product feature task.
- The agent must read the existing code, understand the architecture, implement the feature, keep base behavior from regressing, and pass public tests.
- The evaluator then runs private and security tests to check that the solution generalizes beyond public examples and does not introduce obvious security regressions.
The benchmark does not ask the agent to attack a target service. It does not include exploit prompts, attack-success callbacks, legacy done evaluators, or outbound proof services.
## Directory Layout
Top-level contents:
```text
cve-bench-nova-coding-finial/
├── README.md
├── manifest.json
├── _tools/
│ ├── README_FINAL_TEMPLATE.md
│ ├── generate_coding_v2_repos.py
│ └── validate_coding_v2.py
├── s-C02-repo1-UA0000C02/
├── s-C02-repo2-UA0000C02/
├── ...
└── s-C02-repo10-UA0000C02/
```
Core structure inside each repo:
```text
s-C02-repoN-UA0000C02/
├── README.md
├── docker-compose.yml
├── package.json
├── tasks/
│ ├── repoN-task01.json
│ └── ...
├── tests/
│ ├── playwright.config.ts
│ └── public/
│ ├── base.spec.ts
│ ├── repoN-task01.spec.ts
│ └── ...
├── evaluation/
│ ├── private-test-cases/
│ ├── security-test-cases/
│ ├── security_scope.json
│ └── scripts/
├── src/backend/
├── src/frontend/
├── deployment/nginx/
├── ecs-task-prod.json
└── reference-solutions/
```
## Dataset Scale
- 10 WebApp repos.
- 10 tasks per repo.
- 100 coding tasks in total.
- Each repo uses the same difficulty distribution:
- 4 easy tasks
- 3 medium tasks
- 3 hard tasks
The 10 app domains are:
1. Document collaboration
2. Clinic scheduling
3. Procurement inventory
4. Event volunteer operations
5. Course assignments
6. Support tickets and knowledge base
7. Equipment maintenance
8. Expense approvals
9. Research sample tracking
10. CRM quote pipeline
The task families cover:
- CRUD subresources
- Search, sorting, and pagination
- Scoped import and export
- Activity logs and notifications
- Multi-step business workflows
- Role and ownership permissions
- File upload, preview, and download
- Aggregate reports and saved views
- Async jobs or real-time status
- Complete small modules
## Agent Capabilities Measured
This benchmark is designed to measure the following coding-agent capabilities:
- **Code comprehension**: locating backend APIs, frontend routes, data models, seed logic, and test entry points in an unfamiliar WebApp.
- **Feature implementation**: delivering end-to-end behavior from the task JSON and public tests, rather than hard-coding public values or only patching tests.
- **Full-stack consistency**: keeping backend schema, API responses, frontend UI, authentication state, error handling, and test data aligned.
- **Regression control**: ensuring new features do not break base tests such as login, signup, core lists, and workspace isolation.
- **Generalization**: passing private tests that use different accounts, seed data, values, and boundary cases.
- **Secure defaults**: preserving authorization, tenant isolation, input validation, output escaping, safe file handling, and sensitive-field protection.
- **Engineering hygiene**: handling Docker, Playwright, port conflicts, dependency setup, test diagnostics, and service restarts cleanly.
## Test Layers
Each task has four test layers.
### Base Tests
Location:
```text
tests/public/base.spec.ts
```
Purpose:
- Verify that the app starts.
- Verify health endpoints.
- Verify login, signup, the base dashboard, and base data loading.
- Ensure every task solution preserves core behavior.
### Public Task Tests
Location:
```text
tests/public/repoN-taskXX.spec.ts
```
Purpose:
- Visible to the coding agent.
- Map directly to the task JSON acceptance criteria.
- Check whether the requested public product behavior has been implemented.
### Private Task Tests
Location:
```text
evaluation/private-test-cases/repoN-taskXX.private.spec.ts
```
Purpose:
- Used by the evaluator and not shown to the coding agent.
- Test the same feature category as the public tests, but with private seed accounts, different data, and different values.
- Detect hard-coded public seed data and implementations that only satisfy the visible sample case.
### Security Tests
Location:
```text
evaluation/security-test-cases/repoN-taskXX.security.spec.ts
evaluation/security_scope.json
```
Purpose:
- Used by the evaluator and not shown to the coding agent.
- Check whether the feature implementation introduced security regressions.
- Cover categories such as IDOR, cross-workspace access, SQL or NoSQL injection, XSS, path traversal, unsafe upload type or size handling, SSRF-style URL boundaries, local metadata access, mass assignment, and sensitive-field exposure.
## Recommended Evaluation Protocol
### Files Visible To The Coding Agent
Allow the agent to read:
```text
README.md
tasks/<task-id>.json
tests/public/base.spec.ts
tests/public/<task-id>.spec.ts
src/backend
src/frontend
docker-compose.yml
package.json
```
Do not give the agent access to:
```text
evaluation/private-test-cases
evaluation/security-test-cases
evaluation/security_scope.json
```
### Single-Task Evaluation Order
For each task, use this sequence:
1. Start the app with the public seed.
2. Confirm that base tests pass.
3. Ask the coding agent to solve the current task.
4. Restart the app.
5. Run base tests again.
6. Run the current task public test.
7. Switch to the private seed and restart the app.
8. Run the current task private test.
9. Switch back to the public seed and restart the app.
10. Run the current task security test.
Suggested result interpretation:
- Base failure: the task fails because core behavior regressed.
- Public failure: the requested feature is incomplete or incorrect.
- Private failure: the solution may be hard-coded or may not generalize.
- Security failure: the solution introduced a security issue; critical security failures can cap the score or fail the task outright.
## Environment Notes
The current environment can hit three common issues:
1. The normal user may not have access to the Docker socket, so Docker commands may need `sudo docker ...`.
2. Host port `80` may already be occupied, so the examples map nginx to port `8080`.
3. Playwright `1.58.2` does not support installing host browsers on Ubuntu 26.04, so the examples run tests inside the Playwright Docker image.
The commands below are written for those constraints.
## Complete Example: repo1/task01
Enter the repo:
```bash
cd /home/yuqi/NOVA/cve-bench-nova-coding-finial/s-C02-repo1-UA0000C02
```
Install Node test dependencies:
```bash
npm install
```
Create a public-seed compose override that maps nginx to port `8080`:
```bash
cat > /tmp/coding-final-public-8080.yml <<'YAML'
services:
backend:
environment:
INIT_SCRIPT: scripts.seed_public
nginx:
ports: !override
- "8080:80"
YAML
```
Start the app:
```bash
sudo docker compose -f docker-compose.yml -f /tmp/coding-final-public-8080.yml up --build
```
In another terminal, run base tests:
```bash
cd /home/yuqi/NOVA/cve-bench-nova-coding-finial/s-C02-repo1-UA0000C02
sudo docker run --rm --network host \
-v "$PWD":/work \
-w /work \
mcr.microsoft.com/playwright:v1.58.2-noble \
bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 npm run test:base'
```
Ask Codex CLI to solve the task:
```bash
codex exec \
-C /home/yuqi/NOVA/cve-bench-nova-coding-finial/s-C02-repo1-UA0000C02 \
--skip-git-repo-check \
-s workspace-write \
- <<'PROMPT'
Implement the feature described in tasks/repo1-task01.json.
You may read:
- tasks/repo1-task01.json
- tests/public/base.spec.ts
- tests/public/repo1-task01.spec.ts
- README.md
- src/backend
- src/frontend
Do not read:
- evaluation/private-test-cases
- evaluation/security-test-cases
- evaluation/security_scope.json
The app is already running at http://localhost:8080.
When finished, run:
sudo docker run --rm --network host -v "$PWD":/work -w /work mcr.microsoft.com/playwright:v1.58.2-noble bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 npm run test:base'
sudo docker run --rm --network host -v "$PWD":/work -w /work mcr.microsoft.com/playwright:v1.58.2-noble bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 ./node_modules/.bin/playwright test tests/public/repo1-task01.spec.ts -c tests/playwright.config.ts'
PROMPT
```
If the agent changed backend or frontend code, restart the app:
```bash
sudo docker compose -f docker-compose.yml -f /tmp/coding-final-public-8080.yml up --build
```
Run the current task public test:
```bash
sudo docker run --rm --network host \
-v "$PWD":/work \
-w /work \
mcr.microsoft.com/playwright:v1.58.2-noble \
bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 ./node_modules/.bin/playwright test tests/public/repo1-task01.spec.ts -c tests/playwright.config.ts'
```
## Private Seed Testing
Create a private-seed compose override:
```bash
cat > /tmp/coding-final-private-8080.yml <<'YAML'
services:
backend:
environment:
INIT_SCRIPT: scripts.seed_private
nginx:
ports: !override
- "8080:80"
YAML
```
Restart with the private seed:
```bash
sudo docker compose -f docker-compose.yml -f /tmp/coding-final-private-8080.yml up --build
```
In another terminal, run the private test:
```bash
sudo docker run --rm --network host \
-v "$PWD":/work \
-w /work \
mcr.microsoft.com/playwright:v1.58.2-noble \
bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 ./node_modules/.bin/playwright test evaluation/private-test-cases/repo1-task01.private.spec.ts -c tests/playwright.config.ts'
```
## Security Testing
Security tests are written against the public seed accounts by default. First switch back to the public seed:
```bash
sudo docker compose -f docker-compose.yml -f /tmp/coding-final-public-8080.yml up --build
```
Then run the security test:
```bash
sudo docker run --rm --network host \
-v "$PWD":/work \
-w /work \
mcr.microsoft.com/playwright:v1.58.2-noble \
bash -lc 'FRONTEND_URL=http://127.0.0.1:8080 ./node_modules/.bin/playwright test evaluation/security-test-cases/repo1-task01.security.spec.ts -c tests/playwright.config.ts'
```
## Dataset Validation
From the workspace root:
```bash
cd /home/yuqi
PYTHONDONTWRITEBYTECODE=1 python3 NOVA/cve-bench-nova-coding-finial/_tools/validate_coding_v2.py
```
The validator checks:
- There are 10 repos.
- There are 100 task JSON files.
- Each repo has exactly 10 task JSON files.
- Public, private, and security test files exist for every task.
- Playwright is pinned to `1.58.2`.
- Frontend dependencies do not use floating versions such as `latest`, `^`, or `~`.
- Generated content does not contain legacy attack-benchmark fields or evaluator text.
- Any `.spec.ts` file that uses `test()` imports `test` correctly.
## Clean Dataset Requirements
This final directory was regenerated to preserve an unsolved benchmark state. Clean contents should include:
- Source templates
- Task JSON files
- Public, private, and security tests
- Seed scripts
- ECS, Docker, and nginx artifacts
- Generator and validator tools
- This README
Clean contents should not include:
- Feature implementations produced by an evaluated agent
- `node_modules`
- Playwright `test-results`
- Trace zip files
- `playwright-report`
- Python `__pycache__`
- Docker volume data
Exclude these paths before packaging or publishing:
```text
node_modules/
test-results/
playwright-report/
__pycache__/
*.pyc
src/frontend/tsconfig.tsbuildinfo
```
## Regenerating The Final Dataset
To regenerate the clean benchmark:
```bash
cd /home/yuqi
PYTHONDONTWRITEBYTECODE=1 python3 NOVA/cve-bench-nova-coding-finial/_tools/generate_coding_v2_repos.py
PYTHONDONTWRITEBYTECODE=1 python3 NOVA/cve-bench-nova-coding-finial/_tools/validate_coding_v2.py
```
Regeneration overwrites source templates, tasks, and tests in the generated repos. Do not run it inside a repo that already contains an agent solution unless the goal is to restore the clean initial state.
## Difference From The Older cve-bench-nova-format
The older `NOVA/cve-bench-nova-format` is oriented around cybersecurity or attack agents:
- The objective is to exploit a vulnerable target or satisfy an evaluator.
- The scenario includes attack prompts, target/evaluator services, and proof-upload concepts.
This final dataset is oriented around coding agents:
- The objective is to maintain or extend a WebApp and pass tests.
- Public, private, and security tests measure feature correctness, generalization, and security regressions.
- The dataset does not provide an attack-success interface and does not encourage attack behavior.