{"id":15637566,"url":"https://github.com/pcaversaccio/malleable-signatures","last_synced_at":"2025-04-06T02:12:21.663Z","repository":{"id":174252278,"uuid":"651981338","full_name":"pcaversaccio/malleable-signatures","owner":"pcaversaccio","description":"This repository implements a simplified PoC that demonstrates how signature malleability attacks using compact signatures can be executed.","archived":false,"fork":false,"pushed_at":"2025-03-29T12:26:40.000Z","size":117,"stargazers_count":112,"open_issues_count":0,"forks_count":9,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-30T01:12:37.937Z","etag":null,"topics":["ecdsa","eip2098","exploit","malleability","signature-malleability"],"latest_commit_sha":null,"homepage":"","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"wtfpl","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcaversaccio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-10T17:37:01.000Z","updated_at":"2025-03-29T12:26:44.000Z","dependencies_parsed_at":null,"dependency_job_id":"c954c276-fbea-48f1-ba81-860e20d24474","html_url":"https://github.com/pcaversaccio/malleable-signatures","commit_stats":{"total_commits":100,"total_committers":2,"mean_commits":50.0,"dds":"0.010000000000000009","last_synced_commit":"41fb6c21cdb0d856bd59b304dda80a6342ee2f24"},"previous_names":["pcaversaccio/malleable-signatures"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fmalleable-signatures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fmalleable-signatures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fmalleable-signatures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fmalleable-signatures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcaversaccio","download_url":"https://codeload.github.com/pcaversaccio/malleable-signatures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423516,"owners_count":20936626,"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":["ecdsa","eip2098","exploit","malleability","signature-malleability"],"created_at":"2024-10-03T11:12:07.892Z","updated_at":"2025-04-06T02:12:21.619Z","avatar_url":"https://github.com/pcaversaccio.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Signature Malleability\n\n[![Test smart contracts](https://github.com/pcaversaccio/malleable-signatures/actions/workflows/test.yml/badge.svg)](https://github.com/pcaversaccio/malleable-signatures/actions/workflows/test.yml)\n[![License: WTFPL](https://img.shields.io/badge/License-WTFPL-blue.svg)](https://www.wtfpl.net/about/)\n\nThis repository implements a simplified [PoC](./test/SignatureMalleability.t.sol) that demonstrates how signature malleability attacks using [compact signatures](https://eips.ethereum.org/EIPS/eip-2098) can be executed. The PoC showcases two interconnected issues:\n\n1. A vulnerability with the [OpenZeppelin `4.6` ECDSA library](https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v4.6/contracts/utils/cryptography/ECDSA.sol) which is vulnerable to the signature malleability exploit. The vulnerability was patched in version [`4.7.3`](https://github.com/OpenZeppelin/openzeppelin-contracts/releases/tag/v4.7.3). Also, see [here](https://github.com/OpenZeppelin/openzeppelin-contracts/security/advisories/GHSA-4h98-2769-gh6h) for the published security advisory.\n\n2. Signatures MUST NOT be used as unique identifiers, since the [`ecrecover`](https://www.evm.codes/precompiled#0x01?fork=shanghai) precompile generally allows for malleable (non-unique) signatures (see [EIP-2](https://eips.ethereum.org/EIPS/eip-2)) or signatures can be malleablised using [EIP-2098](https://eips.ethereum.org/EIPS/eip-2098). The underlying issue in the `ecrecover` precompile stems from the fact that there are two `y`-coordinates for every `x`-coordinate on the elliptic curve. The OpenZeppelin ECDSA library prevents this particular malleability attack vector by reverting if the secp256k1 32-byte signature parameter `s` is too high.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fmalleable-signatures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcaversaccio%2Fmalleable-signatures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fmalleable-signatures/lists"}