{"id":29945078,"url":"https://github.com/fguisso/backoffice-balm","last_synced_at":"2025-10-22T10:46:15.496Z","repository":{"id":305775358,"uuid":"992741036","full_name":"fguisso/backoffice-balm","owner":"fguisso","description":"BackOFFice Balm is a minimal Node.js/Express demo illustrating the Unvalidated Dynamic Method Call vulnerability in JavaScript.","archived":false,"fork":false,"pushed_at":"2025-07-21T22:33:17.000Z","size":950,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-22T01:12:00.099Z","etag":null,"topics":["appsec","codeql","dojo-shield"],"latest_commit_sha":null,"homepage":"","language":"HTML","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/fguisso.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}},"created_at":"2025-05-29T16:30:31.000Z","updated_at":"2025-05-29T20:48:24.000Z","dependencies_parsed_at":"2025-07-22T01:12:05.428Z","dependency_job_id":"c57dc72f-ca17-498a-9f03-2ecb35e62cbd","html_url":"https://github.com/fguisso/backoffice-balm","commit_stats":null,"previous_names":["fguisso/backoffice-balm"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/fguisso/backoffice-balm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fguisso%2Fbackoffice-balm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fguisso%2Fbackoffice-balm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fguisso%2Fbackoffice-balm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fguisso%2Fbackoffice-balm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fguisso","download_url":"https://codeload.github.com/fguisso/backoffice-balm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fguisso%2Fbackoffice-balm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268496017,"owners_count":24259403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-03T02:00:12.545Z","response_time":2577,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["appsec","codeql","dojo-shield"],"created_at":"2025-08-03T04:45:40.428Z","updated_at":"2025-10-22T10:46:10.466Z","avatar_url":"https://github.com/fguisso.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BackOFFice Balm  \n\n![Backoffice-balm](https://github.com/user-attachments/assets/361a9c68-05d1-4e2e-9906-25179d117f9e)\n\n*Soothe your spine—and your spreadsheets.*\n\n## Introduction  \nBackOFFice Balm is a minimal Node.js/Express demo illustrating the **Unvalidated Dynamic Method Call** vulnerability in JavaScript. It exposes two unprotected routes that allow any method on our in-memory `UserManager` to be invoked via URL parameters, including the admin-only `_admin_delete`. Your task is to learn how to exploit and then fix this flaw.\n\n### What is Unvalidated Dynamic Method Call  \nAn unvalidated dynamic method call happens when an application constructs a method name from user-controlled input and invokes it without checking against a whitelist.  \n\n```js\n// vulnerable pattern in src/app.js\nconst method = `${action}_user`;\nuserManager[method](params);\n```\n\nBecause action comes directly from the URL, an attacker can invoke any method on userManager—including private/admin routines like `_admin_delete`—without authorization.\n\n### What is the impact for companies?\n\n- Privilege escalation: Attackers invoke admin-only logic from public endpoints.\n\n- Data loss or tampering: Unauthorized deletion or modification of records.\n\n- Business logic bypass: Security, validation, and audit checks can be skipped.\n\n- Hidden risk: Concise code hides critical security holes, often slipping into production unnoticed.\n\n## Quickstart  \n\n1. **Clone \u0026 build**  \n```bash\ngit clone https://github.com/yourname/backoffice-balm.git\ncd backoffice-balm\ndocker build -t backoffice-balm .\n```\n\n2. **Run with Docker**\n\n```bash\ndocker run --rm -it --init \\\n --env-file .env \\\n -p 3000:3000 \\\n backoffice-balm\n```\n\n3. **Open the UI**\nBrowse to http://localhost:3001\n\n## Exploitation\n\nBecause we dynamically resolve `userManager[ action ]` without validation, you can call admin methods on the public routes:\n\n```bash\n# Create a test user\ncurl -X POST localhost:3000/v1/user/42/create \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"name\":\"Bob\",\"cellphone\":\"+55\"}'\n\n# Exploit: delete without auth\ncurl -X GET localhost:3000/v1/user/42/_admin_delete\n```\n\n## Your Challenge\n\n**Patch** `src/app.js` so that only `/v1/user/:id/:action` can invoke `create_user` and `get_user_info`.\n\nGood luck—and hack the planet! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffguisso%2Fbackoffice-balm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffguisso%2Fbackoffice-balm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffguisso%2Fbackoffice-balm/lists"}