{"answers":{"affected":"2 open source packages ship an affected version, including afire.","exploited":"There is no known exploitation of GHSA-3227-r97m-8j95 in the wild and no public exploit code.","fix":"Upgrade afire to 1.1.0 or later.","what":"GHSA-3227-r97m-8j95 is a path traversal vulnerability in afire, published on 22 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim."},"fix_prompt":"Check this codebase for GHSA-3227-r97m-8j95 and fix it if it is affected.\n\nWhat it is: GHSA-3227-r97m-8j95 is a path traversal vulnerability in afire, published on 22 Apr 2022. An attacker can exploit it over the internet without logging in, with no action from the victim.\nExploitation: There is no known exploitation of GHSA-3227-r97m-8j95 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- afire (crates.io): affected from 0.2.1; fixed in 1.1.0\n- afire (crates.io): affected from 0.2.1; fixed in 1.1.0\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/GHSA-3227-r97m-8j95/ (Markdown: https://insights.sbomify.com/GHSA-3227-r97m-8j95/index.md)","id":"GHSA-3227-r97m-8j95","markdown":"https://insights.sbomify.com/GHSA-3227-r97m-8j95/index.md","name":"GHSA-3227-r97m-8j95","record":{"aliases":[],"analysis":{"component_type":"library","fix_type":"upgrade","impacts":["data_read"],"network_reachable":"yes","non_default_config":false,"product_category":"Rust web server library","requires_auth":"none","summary":"An attacker can read arbitrary files outside the web root via path traversal in the afire serve_static extension.","user_interaction":"not_required","vuln_class":"path_traversal"},"analysis_generated_by":"qwen3.8-flash-next","assigner":null,"cpe":[],"cvss":{"score":null,"severity":null,"source":null,"vector":null,"version":null},"cwes":[],"description":"### Impact\nThis vulnerability effects the built-in afire serve_static extension allowing paths containing `//....` to bypass the previous path sanitation and request files in higher directories that should not be accessible.\n\n### Patches\nThe issue has been fixed in [afire 1.1.0](https://crates.io/crates/afire/1.1.0).\nIf you can, just update to the newest version of afire.\n\n### Workarounds\nIf you can't update afire you can simply disallow paths containing `/..` with the following middleware.\nMake sure this is the last middleware added to the server so it runs first, stopping the bad requests.\n```rust\nuse afire::prelude::*;\n\nstruct PathTraversalFix;\n\nimpl Middleware for PathTraversalFix {\n    fn pre(\u0026self, req: Request) -\u003e MiddleRequest {\n        if req.path.replace(\"\\\\\", \"/\").contains(\"/..\") {\n            return MiddleRequest::Send(\n                Response::new()\n                    .status(400)\n                    .text(\"Paths containing `..` are not allowed\"),\n            );\n        }\n\n        MiddleRequest::Continue\n    }\n}\n```\n```rust\nlet mut server = Server::new(host, port);\nPathTraversalFix.attach(\u0026mut server);\n```\n\n### References\nYou can read about the new changes to afire in 1.1.0 [here](https://connorcode.com/writing/afire/update-3)\n\n### For more information\nIf you have any questions or comments about this advisory you can email me or message me on discord.\n[[https://connorcode.com/contact](https://connorcode.com/contact)]","ecosystems":["crates.io"],"exploits":{"exploitdb":null,"first_seen":null,"github_poc":null,"max_poc_stars":null,"metasploit":null,"nuclei":null,"refs":[],"tier":null},"has_fix":true,"headline":"Relative Path Traversal in afire serve_static","id":"GHSA-3227-r97m-8j95","indexable":true,"kev":null,"kind":"advisory","links":{"ecosystem":"crates.io","product":null,"products":[],"type":"path_traversal","year":"2022"},"n_packages":2,"n_references":null,"packages":[{"ecosystem":"crates.io","fixed":["1.1.0"],"introduced":["0.2.1"],"last_affected":[],"package":"afire","purl":null,"source":"GHSA-3227-r97m-8j95"},{"ecosystem":"crates.io","fixed":["1.1.0"],"introduced":["0.2.1"],"last_affected":[],"package":"afire","purl":"pkg:cargo/afire","source":"GHSA-3227-r97m-8j95"}],"products":null,"published":"2022-04-22","related":[],"sources":[{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"}],"ssvc":{"automatable":null,"exploitation":null,"technical_impact":null},"state":null,"updated":null,"vendors":null},"summary":"An attacker can read arbitrary files outside the web root via path traversal in the afire serve_static extension.","url":"https://insights.sbomify.com/GHSA-3227-r97m-8j95/"}