Skip to content

Add metadata_limits codepoint validator rejecting zero-width and bidi controls #671

Description

@greatest0fallt1me

Description

metadata_limits.rs validates length but not content. Add a codepoint validator that rejects zero-width characters, bidi-override controls, and other invisible Unicode so attackers cannot smuggle homoglyph or RTL-override payloads into market titles and outcome names.

Requirements and Context

  • Define a denylist of codepoints/ranges as constants
  • Validator returns Error::InvalidCharacter with the offending codepoint
  • Surface the deny set via a query
  • Must be secure, tested, and documented
  • Should be efficient and easy to review

Suggested Execution

  1. Fork the repo and create a branch
    git checkout -b feature/metadata-codepoint-validator
  2. Implement changes
    • contracts/predictify-hybrid/src/metadata_limits.rs
    • contracts/predictify-hybrid/src/metadata_limits_tests.rs
  3. Test and commit
    • cargo test -p predictify-hybrid codepoint_validator
    • Cover edge cases
    • Include test output and notes in the PR

Example commit message

feat: reject zero-width and bidi-override codepoints in metadata_limits

Acceptance Criteria

  • All denylist codepoints rejected by test fixtures
  • Plain ASCII and common emoji accepted
  • Error includes the rejected codepoint

Guidelines

  • Validate auth, overflow, and storage TTL/archival
  • Clear documentation and inline comments
  • Timeframe: 96 hours

Metadata

Metadata

Labels

GRANTFOX OSSGrantFox open-source campaign taskOFFICIAL CAMPAIGNOfficial GrantFox campaign issueStellar WaveIssues in the Stellar wave programrustRust implementationsecuritySecurity hardeningsmart-contractSoroban smart-contract worksorobanSoroban SDK / Stellar

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions