Area
Other
Domain
gov.tools
Which wallet were you using?
No response
Context
GovTool allows users to draft a proposal, collaborate with the community, and ultimately submit it on-chain as a Governance Action. Each Governance Action requires CIP-108-compliant metadata, which GovTool provides as a downloadable .jsonld file during submission.
Users can store this file on GitHub, typically via:
- Option A:
Add file → Upload files (file remains unchanged; validation passes)
- Option B:
Add file → Create new file (manual paste from clipboard; GitHub appends a byte 0x0A)
Currently, if the user chooses Option B, the resulting file has a 1-byte difference due to the extra byte 0x0A. In this case, GovTool is expected to fail metadata validation, as the hash should no longer match.
However, due to the JSON parsing library used by GovTool, the extra byte appears to be ignored when parsing the content and generating the hash. As a result, GovTool incorrectly validates the modified file as correct, allowing submission of a Governance Action with a hash that should be invalid.
Steps to reproduce
- Create a proposal and proceed to Governance Action submission.
- Download the metadata
.jsonld file generated by GovTool.
- Open GitHub repository and use
Add file → Create new file.
- Paste the content from the
.jsonld file into the editor (GitHub appends extra byte 0x0A).
- Submit the Governance Action using the URL of this manually created file.
Actual behavior
- GovTool accepts the metadata file with the extra byte 0x0A.
- The resulting hash matches the original, despite the file being technically different.
- Governance Action is successfully submitted with incorrect file integrity.
Expected behavior
- GovTool should perform exact byte-level hashing of the metadata file.
- Metadata with any deviation (e.g., trailing whitespace) should cause validation to fail.
- Governance Action submission should be blocked if the metadata hash does not match exactly.
Area
Other
Domain
gov.tools
Which wallet were you using?
No response
Context
GovTool allows users to draft a proposal, collaborate with the community, and ultimately submit it on-chain as a Governance Action. Each Governance Action requires CIP-108-compliant metadata, which GovTool provides as a downloadable
.jsonldfile during submission.Users can store this file on GitHub, typically via:
Add file → Upload files(file remains unchanged; validation passes)Add file → Create new file(manual paste from clipboard; GitHub appends a byte 0x0A)Currently, if the user chooses Option B, the resulting file has a 1-byte difference due to the extra byte 0x0A. In this case, GovTool is expected to fail metadata validation, as the hash should no longer match.
However, due to the JSON parsing library used by GovTool, the extra byte appears to be ignored when parsing the content and generating the hash. As a result, GovTool incorrectly validates the modified file as correct, allowing submission of a Governance Action with a hash that should be invalid.
Steps to reproduce
.jsonldfile generated by GovTool.Add file → Create new file..jsonldfile into the editor (GitHub appends extra byte 0x0A).Actual behavior
Expected behavior