Repository navigation
Harden client state writes, state signatures and soft navigation - #12
Conversation
- Only allow tracked public properties to be set from the client - Bind state signatures to the component class - Restrict soft navigation to same-origin text/html responses
|
@abdulmajidcse need to update docs after merging this PR? |
|
@techmahedy Yes. The docs need small updates for the new class-bound state signature, the upgrade/reload requirement, and the same-origin HTML-only soft-navigation behavior. I’ll update the 4.x Security, Wire Protocol, Deployment, and Navigation pages. |
@abdulmajidcse ok, please update it as well. |
|
@techmahedy The documentation updates are ready in https://github.com/doppar/ripple.doppar.com/pull/1. It covers the class-bound state signature, upgrade/reload requirement, updated |
@abdulmajidcse thanks |
xentixar
left a comment
There was a problem hiding this comment.
Looks good, thank you, @abdulmajidcse.
|
@xentixar The merge conflict with |
Summary
Three security hardening fixes.
Client property writes
Component::syncProperty()(used for bound valuesmand property updatest=u) now only accepts the component's tracked public properties.locked,tracked,eventListeners, …), can no longer be set from the client. This keeps#[Locked]and the#[Invokable]allow-list intact.State signatures
update()verifies against the resolved class, so a snapshot signed for one component is rejected for another.StateSigner::sign()/verify()take the class as a new argument.ComponentManager::signState()signs with the class resolved the same wayupdate()does (used byTestable).Soft navigation
mode: 'same-origin', so a redirect to another origin falls back to a normal browser navigation.text/htmlresponses are swapped into the document. Anything else (JSON, plain text, files) is loaded normally.Notes
StateSigner::sign()/verify()directly must pass the component class.resources/dist/ripple.min.jsis rebuilt from source.Tests
ClientWriteProtectionTestwith aSecureComponentfixture covering protected-property writes, listener registration, property updates on internals, cross-component signature replay and class normalisation.composer test(162 tests),composer analyseandcomposer cs-checkpass.