{"id":13845742,"url":"https://github.com/Julian-Nash/cwe","last_synced_at":"2025-07-12T03:31:58.668Z","repository":{"id":62566105,"uuid":"250295936","full_name":"Julian-Nash/cwe","owner":"Julian-Nash","description":"Common weakness enumeration library for Python","archived":false,"fork":false,"pushed_at":"2024-03-17T21:20:17.000Z","size":1678,"stargazers_count":14,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-12T19:48:27.173Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Julian-Nash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-26T15:25:18.000Z","updated_at":"2023-07-19T22:38:22.000Z","dependencies_parsed_at":"2022-11-03T17:47:44.170Z","dependency_job_id":null,"html_url":"https://github.com/Julian-Nash/cwe","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Julian-Nash%2Fcwe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Julian-Nash","download_url":"https://codeload.github.com/Julian-Nash/cwe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225791389,"owners_count":17524774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T17:03:34.879Z","updated_at":"2024-11-21T19:30:35.265Z","avatar_url":"https://github.com/Julian-Nash.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Common weakness enumeration library for Python\n\n![Python package](https://github.com/Julian-Nash/cwe/workflows/Python%20package/badge.svg)\n\nhttps://cwe.mitre.org/index.html\n\n#### Installation\n\n```sh\npip install cwe\n```\n\n#### Usage\n\n- Get a CWE by ID:\n\n```pycon\n\u003e\u003e\u003e from cwe import Database\n\u003e\u003e\u003e db = Database()\n\u003e\u003e\u003e db.get(15)\nWeakness(cwe_id=15, name=External Control of System or Configuration Setting)\n```\n\n- Access attributes of the Weakness using dot notation\n\n```pycon\n\u003e\u003e\u003e weakness = db.get(15)\n\u003e\u003e\u003e weakness.description\n'One or more system settings or configuration elements can be externally controlled by a user.'\n```\n\n- Or use the weakness `get` method\n\n```pycon\n\u003e\u003e\u003e weakness.get(\"status\", None)\n'Incomplete'\n```\n\n- Get a dictionary of the weakness (Truncated for this example)\n\n```pycon\n\u003e\u003e\u003e weakness.to_dict()\n{'cwe_id': '15', 'name': 'External Control of System or Configuration Setting', 'weakness_abstraction': 'Base'}\n```\n\n- Get the top 25 weaknesses\n\n```pycon\n\u003e\u003e\u003e from cwe import Database\n\u003e\u003e\u003e db = Database()\n\u003e\u003e\u003e db.get_top_25()\n\n```\n\n#### Weakness attributes\n\nThe following weakness object attributes can accessed:\n\n- `cwe_id`\n- `name`\n- `weakness_abstraction`\n- `status`\n- `description`\n- `extended_description`\n- `related_weaknesses`\n- `weakness_ordinalities`\n- `applicable_platforms`\n- `background_details`\n- `alternate_terms`\n- `modes_of_introduction`\n- `exploitation_factors`\n- `likelihood_of_exploit`\n- `common_consequences`\n- `detection_methods`\n- `potential_mitigations`\n- `observed_examples`\n- `functional_areas`\n- `affected_resources`\n- `taxonomy_mappings`\n- `related_attack_patterns`\n- `notes`\n\n#### Tests\n\nThere's a small `unittest` test suite in the `tests` directory\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJulian-Nash%2Fcwe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJulian-Nash%2Fcwe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJulian-Nash%2Fcwe/lists"}