{"id":34712706,"url":"https://github.com/bararchy/vuln-app","last_synced_at":"2026-05-17T16:10:05.381Z","repository":{"id":319625490,"uuid":"1078372779","full_name":"bararchy/vuln-app","owner":"bararchy","description":"just testing for STAR","archived":false,"fork":false,"pushed_at":"2025-11-18T11:36:11.000Z","size":303,"stargazers_count":0,"open_issues_count":13,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-18T13:20:22.307Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bararchy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-17T16:17:38.000Z","updated_at":"2025-10-29T13:24:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"57710ff5-729c-4e7c-a97e-081235ef61a2","html_url":"https://github.com/bararchy/vuln-app","commit_stats":null,"previous_names":["bararchy/vuln-app"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bararchy/vuln-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fvuln-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fvuln-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fvuln-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fvuln-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bararchy","download_url":"https://codeload.github.com/bararchy/vuln-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bararchy%2Fvuln-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33145169,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T09:28:26.183Z","status":"ssl_error","status_checked_at":"2026-05-17T09:27:52.702Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-12-25T00:49:02.811Z","updated_at":"2026-05-17T16:10:05.369Z","avatar_url":"https://github.com/bararchy.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DVRA - Damn Vulnerable Ruby Application\n\nA deliberately vulnerable Rails application designed for testing SAST (Static Application Security Testing) tools.\n\n## 🚀 Quick Start\n\n### Running with Docker Compose (Recommended)\n\n1. **Build and start the application:**\n   ```bash\n   docker-compose up --build\n   ```\n\n2. **Access the application:**\n   \n   Open your browser to [http://localhost:3000](http://localhost:3000)\n\n3. **Stop the application:**\n   ```bash\n   docker-compose down\n   ```\n\n### Running with Docker\n\n1. **Build the Docker image:**\n   ```bash\n   docker build -t vuln-rails-app .\n   ```\n\n2. **Run the container:**\n   ```bash\n   docker run -p 3000:3000 -v $(pwd):/app vuln-rails-app\n   ```\n\n### Running Commands Inside the Container\n\n```bash\n# Run migrations\ndocker-compose exec web bundle exec rails db:migrate\n\n# Open Rails console\ndocker-compose exec web bundle exec rails console\n\n# Run tests\ndocker-compose exec web bundle exec rails test\n\n# Run security scanners\ndocker-compose exec web ./run_scanners.sh\n\n# Access bash shell\ndocker-compose exec web bash\n```\n\n## 🐛 Vulnerabilities\n\nThis application contains the following intentional security vulnerabilities:\n\n| Location | Vulnerability | Exploitable at Runtime? |\n|----------|---------------|------------------------|\n| `config/initializers/secret_token.rb:1` | **Vuln 1:** Hardcoded secret (Google API Key) | ✅ via `/config` |\n| `app/controllers/users_controller.rb:20` | **Vuln 2:** Unscoped Find/Read IDOR | ✅ via `/users/:id` |\n| `app/controllers/users_controller.rb:29` | **Vuln 3:** Mass Assignment | ✅ via `POST /users` |\n| `app/controllers/sessions_controller.rb:4` | **Vuln 4:** SQLi via parent class method with hash reassignment | ✅ via `POST /sessions` |\n| `app/controllers/posts_controller.rb:21` | **Vuln 5:** *Maybe* Unscoped find IDOR? | ✅ via `/posts/:id` |\n| `app/controllers/posts_controller.rb:69` | **Vuln 6:** sanitize_sql_array SQLi false positive (MEU-1468) | ✅ via `PUT /posts/:id?meu=1` |\n| `app/controllers/posts_controller.rb:65` | **Vuln 7:** UnscopedFind Delete IDOR with parent class accessor and hash reassignment | ✅ via `DELETE /posts/:id` |\n| `app/controllers/application_controller.rb:27` | **Vuln 8:** Cookie tampering ATO | ✅ Cookie-based |\n| `app/controllers/posts_controller.rb:7` | **Vuln 9:** XSS via html_safe | ✅ via `POST /posts/render_html` |\n| `app/controllers/posts_controller.rb:81` | **Vuln 10:** SQLi via callee interpolation | ✅ via `PUT /posts/:id` |\n| `app/models/user.rb:2` | **Vuln 11:** Plaintext password storage | ✅ via `/users/:id/credentials` |\n| `app/controllers/application_controller.rb:11` | **Vuln 12:** Information disclosure - `/config` endpoint exposes secrets | ✅ via `/config` |\n| `config/initializers/cors.rb` | **Vuln 13:** Overly permissive CORS (`origins '*'`) | 🔍 SAST-only |\n| `config/initializers/content_security_policy.rb` | **Vuln 14:** CSP disabled/permissive (`unsafe-inline`, `unsafe-eval`) | 🔍 SAST-only |\n| `app/controllers/application_controller.rb:5` | **Vuln 15:** CSRF protection disabled | ✅ via `POST /users/:id/transfer_ownership` |\n\n## 🔍 Running Security Scans\n\nExecute all security scanners:\n\n```bash\n./run_scanners.sh\n```\n\n## 🧪 Running Tests\n\nRun the API endpoint tests:\n\n```bash\n./test_api_endpoints.sh\n```\n\nThis will test all API endpoints including authentication, CRUD operations, and verify that the intentional vulnerabilities are present.\n\n## 📊 SAST Tool Comparison\n\n| Vuln ID | Vuln Example | Semgrep | Semgrep Pro | Corgea Blast | Brakeman 7.1.0 |\n|---------|--------------|---------|-------------|--------------|----------------|\n| 1 | Secret  | Detected | Detected | **Not** Detected (incorrectly marked as FP) | Detected |\n| 2 | Read IDOR  | **Not** Detected* | **Not** Detected* | Partially Detected** | **Not** Detected |\n| 3 | Mass Assignment  | **Not** Detected |  **Not** Detected | **Not** Detected | Detected |\n| 4 | Complex SQLi  | **Not** Detected | **Not** Detected | Detected | Detected*** |\n| 5 | UnscopedFind IDOR  | Detected | Detected | Detected | **Not** Detected |\n| 6 | SQLi sanitize_sql_array FP (MEU-1468) | **Not** Detected | **Not** Detected | Detected | **Not** Detected |\n| 7 | Delete IDOR  | **Not** Detected | **Not** Detected | Detected | **Not** Detected |\n| 8 | Cookie Tampering  | Detected | Detected | Detected | **Not** Detected |\n| 9 | XSS  | Detected | Detected | **Not** Detected | **Not** Detected |\n| 10 | Callee Interpolated SQLi | **Not** Detected | **Not** Detected | Detected | **Not** Detected |\n| 11 | Plaintext PW Storage | **Not** Detected | **Not** Detected | Detected | Detected |\n| | **Total Findings**  | 11 | 11 | 17 | 4 |\n| | **Detection Rate**  | 36% | 36% | 73% | 27% |\n| | **FP Rate**  | TODO | TODO | TODO | TODO |\n\n### Notes\n\n\\* Meraki Semgrep rule will detect this finding\n\n\\*\\* Reflects non-deterministic behavior. Noted examples were suppressed as false positives during some executions.\n\n\\*\\*\\* String interpolation detected, user input is not a factor (this will lead to high number of false positives)\n\n### Honorable Mention\n\n- [dawnscanner](https://github.com/thesp0nge/dawnscanner) failed to find *any* vulnerabilities in this application.\n\n## ⚠️ Warning\n\n**This application is intentionally vulnerable. Do NOT deploy this in a production environment or expose it to the internet.**\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbararchy%2Fvuln-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbararchy%2Fvuln-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbararchy%2Fvuln-app/lists"}