{"id":4074223,"name":"enum-map","ecosystem":"cargo","description":"A map with C-like enum keys represented internally as an array","homepage":null,"licenses":"MIT OR Apache-2.0","normalized_licenses":["MIT","Apache-2.0"],"repository_url":"https://codeberg.org/xfix/enum-map","keywords_array":["no_std","data-structure","enum"],"namespace":null,"versions_count":80,"first_release_published_at":"2017-05-16T20:57:36.563Z","latest_release_published_at":"2023-11-24T07:41:35.458Z","latest_release_number":"2.7.3","last_synced_at":"2026-06-02T10:43:36.784Z","created_at":"2022-04-12T11:43:01.305Z","updated_at":"2026-06-02T11:38:43.245Z","registry_url":"https://crates.io/crates/enum-map/","install_command":"cargo install enum-map","documentation_url":"https://docs.rs/enum-map/","metadata":{"categories":["data-structures","no-std"]},"repo_metadata":{"id":193883008,"uuid":"142162","full_name":"xfix/enum-map","owner":"xfix","description":"A map with C-like enum keys represented internally as an array","archived":false,"fork":false,"pushed_at":null,"size":908,"stargazers_count":0,"open_issues_count":8,"forks_count":0,"subscribers_count":null,"default_branch":"master","last_synced_at":"2023-11-18T10:28:49.651Z","etag":null,"topics":["rust","woodpecker-ci"],"latest_commit_sha":null,"homepage":"","language":"","has_issues":true,"has_wiki":false,"has_pages":null,"mirror_url":"f","source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://codeberg.org/avatars/46e265f75686faf2c54092a348bda95c339fd0b8f88091795457cece325ea33e","metadata":{},"created_at":"2023-09-10T07:16:33.000Z","updated_at":"2023-11-17T09:17:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"ec279867-cca2-40a2-bb59-59999d06df7a","html_url":"https://codeberg.org/xfix/enum-map","commit_stats":null,"previous_names":["xfix/enum-map"],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:forgejo/xfix/enum-map","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories/xfix%2Fenum-map","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories/xfix%2Fenum-map/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories/xfix%2Fenum-map/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories/xfix%2Fenum-map/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/owners/xfix","download_url":"https://codeberg.org/xfix/enum-map/archive/master.zip","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories/xfix%2Fenum-map/sbom","scorecard":null,"host":{"name":"codeberg.org","url":"https://codeberg.org","kind":"forgejo","repositories_count":34683,"owners_count":722,"icon_url":"https://github.com/Codeberg-org.png","version":null,"created_at":"2022-08-01T13:30:46.733Z","updated_at":"2026-03-05T09:27:01.433Z","status":"http_error","status_checked_at":"2026-04-10T02:00:08.896Z","response_time":51,"last_error":"HTTP 403: Forbidden","robots_txt_status":"error_403","robots_txt_updated_at":"2025-07-24T06:49:27.136Z","robots_txt_url":"https://codeberg.org/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/owners"},"owner_record":{"login":"xfix","name":"Konrad Borowski","uuid":"118439","kind":"user","description":"","email":"konrad@borowski.pw","website":"https://fosstodon.org/@xfix","location":"","twitter":null,"company":null,"icon_url":"https://codeberg.org/avatars/46e265f75686faf2c54092a348bda95c339fd0b8f88091795457cece325ea33e","repositories_count":1,"last_synced_at":"2023-09-10T16:13:40.615Z","metadata":{},"html_url":"https://codeberg.org/xfix","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-09-10T16:13:40.664Z","updated_at":"2023-09-10T16:13:40.664Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/owners/xfix","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/codeberg.org/owners/xfix/repositories"},"tags":[]},"repo_metadata_updated_at":"2026-06-02T11:38:43.222Z","dependent_packages_count":99,"downloads":37842531,"downloads_period":"total","dependent_repos_count":1240,"rankings":{"downloads":0.9171753711658754,"dependent_repos_count":1.1831686901440315,"dependent_packages_count":0.6959052422851025,"stargazers_count":56.033150087852256,"forks_count":40.64442164967115,"docker_downloads_count":3.2804192903736666,"average":17.125706721915346},"purl":"pkg:cargo/enum-map","advisories":[{"uuid":"GSA_kwCzR0hTQS1yeGh4LTlmajYtNmgybc4AArrF","url":"https://github.com/advisories/GHSA-rxhx-9fj6-6h2m","title":"enum_map macro can cause UB when `Enum` trait is incorrectly implemented","description":"Affected versions of this crate did not properly check the length of an enum when using `enum_map!` macro, trusting user-provided length.\n\nWhen the `LENGTH` in the `Enum` trait does not match the array length in the `EnumArray` trait, this can result in the initialization of the enum map with uninitialized types, which in turn can allow an attacker to execute arbitrary code.\n\nThis problem can only occur with a manual implementation of the Enum trait, it will never occur for enums that use `#[derive(Enum)]`.\n\nExample code that triggers this vulnerability looks like this:\n\n```rust\nenum E {\n    A,\n    B,\n    C,\n}\n\nimpl Enum for E {\n    const LENGTH: usize = 2;\n\n    fn from_usize(value: usize) -\u003e E {\n        match value {\n            0 =\u003e E::A,\n            1 =\u003e E::B,\n            2 =\u003e E::C,\n            _ =\u003e unimplemented!(),\n        }\n    }\n\n    fn into_usize(self) -\u003e usize {\n        self as usize\n    }\n}\n\nimpl\u003cV\u003e EnumArray\u003cV\u003e for E {\n    type Array = [V; 3];\n}\n\nlet _map: EnumMap\u003cE, String\u003e = enum_map! { _ =\u003e \"Hello, world!\".into() };\n```\n\nThe flaw was corrected in commit [b824e23](https://github.com/xfix/enum-map/commit/b824e232f2fb47837740070096ac253df8e80dfc) by putting `LENGTH` property on sealed trait for macro to read.\n","origin":"UNSPECIFIED","severity":"HIGH","published_at":"2022-06-16T23:53:32.000Z","withdrawn_at":null,"classification":"GENERAL","cvss_score":0.0,"cvss_vector":null,"references":["https://github.com/rustsec/advisory-db/blob/main/crates/enum-map/RUSTSEC-2022-0010.md","https://rustsec.org/advisories/RUSTSEC-2022-0010.html","https://github.com/xfix/enum-map/commit/b824e232f2fb47837740070096ac253df8e80dfc","https://github.com/xfix/enum-map/blob/master/CHANGELOG.md#version-202","https://gitlab.com/KonradBorowski/enum-map/-/blob/master/CHANGELOG.md#version-202","https://github.com/advisories/GHSA-rxhx-9fj6-6h2m"],"source_kind":"github","identifiers":["GHSA-rxhx-9fj6-6h2m"],"repository_url":"https://github.com/xfix/enum-map","blast_radius":0.0,"created_at":"2022-12-21T16:12:18.348Z","updated_at":"2026-04-28T20:09:27.482Z","epss_percentage":null,"epss_percentile":null,"api_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1yeGh4LTlmajYtNmgybc4AArrF","html_url":"https://advisories.ecosyste.ms/advisories/GSA_kwCzR0hTQS1yeGh4LTlmajYtNmgybc4AArrF","packages":[{"ecosystem":"cargo","package_name":"enum-map","versions":[{"first_patched_version":"2.0.2","vulnerable_version_range":"\u003e= 2.0.0-2, \u003c 2.0.2"}],"purl":"pkg:cargo/enum-map"}],"related_packages_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1yeGh4LTlmajYtNmgybc4AArrF/related_packages","related_advisories":[]}],"docker_usage_url":"https://docker.ecosyste.ms/usage/cargo/enum-map","docker_dependents_count":38,"docker_downloads_count":23303252,"usage_url":"https://repos.ecosyste.ms/usage/cargo/enum-map","dependent_repositories_url":"https://repos.ecosyste.ms/api/v1/usage/cargo/enum-map/dependencies","status":null,"funding_links":[],"critical":null,"issue_metadata":{"last_synced_at":"2023-09-07T22:32:07.104Z","issues_count":16,"pull_requests_count":49,"avg_time_to_close_issue":27721567.46153846,"avg_time_to_close_pull_request":459202.875,"issues_closed_count":13,"pull_requests_closed_count":48,"pull_request_authors_count":8,"issue_authors_count":8,"avg_comments_per_issue":2.3125,"avg_comments_per_pull_request":0.5102040816326531,"merged_pull_requests_count":44,"bot_issues_count":0,"bot_pull_requests_count":12,"past_year_issues_count":1,"past_year_pull_requests_count":36,"past_year_avg_time_to_close_issue":1611351.0,"past_year_avg_time_to_close_pull_request":607550.3142857143,"past_year_issues_closed_count":1,"past_year_pull_requests_closed_count":35,"past_year_pull_request_authors_count":6,"past_year_issue_authors_count":1,"past_year_avg_comments_per_issue":1.0,"past_year_avg_comments_per_pull_request":0.5,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":11,"past_year_merged_pull_requests_count":31},"versions_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/versions","version_numbers_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/version_numbers","latest_version_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/latest_version","dependent_packages_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/dependent_packages","related_packages_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/related_packages","codemeta_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/packages/enum-map/codemeta","maintainers":[{"uuid":"6677","login":"xfix","name":"Kamila Borowska","email":null,"url":"https://github.com/xfix","packages_count":16,"html_url":"https://crates.io/users/xfix","role":null,"created_at":"2022-11-07T18:56:16.619Z","updated_at":"2022-11-07T18:56:16.619Z","packages_url":"https://packages.ecosyste.ms/api/v1/registries/crates.io/maintainers/xfix/packages"}]}