Skip to main content

Exercise 10 teaching plan

Teach publisher verification as one example of OWASP A08 Software or Data Integrity Failures. Students should demonstrate why a checksum received alongside untrusted data is insufficient, identify the app's pinned public key as the trust source, and repair the policy without implementing cryptography.

Preparation​

Use Node.js 22+, a browser, and an editor. No packages or external services are required. Export a fresh student kit and follow its README on a learner machine. Run the starter and solution checks: expect 7/12 and 12/12, respectively. Use fictional announcements and loopback only. See the walkthrough and 20-point rubric.

The app uses real Ed25519 verification through Node's built-in crypto. The publisher's public key is bundled with the app; no private signing key is shipped. The helper and fixtures are supplied so beginners can focus on the acceptance decision and trust source.

Session outline​

ActivityMinutesEvidence
Open the local app and confirm setup10Genuine update accepted
Change a message and recompute its checksum10Starter accepts changed data with an invalid signature
Explain exact bytes, hashes, signatures, and trusted keys10Identifies the app's trust source
Make the guided policy repair15One function calls the supplied helper
Restart and verify genuine then tampered updates10Genuine accepted, rehashed tampering rejected, state preserved
Run checks and test a second genuine update10–15Actual 12/12 output; authentic replay allowed
Explain and submit10Completed evidence and reasoning

Allow 75–90 minutes after setup, including troubleshooting. No earlier lesson or backend experience is assumed. Explain import, a function argument, a function call, return, and boolean results before editing.

Teaching emphasis​

Ask students to distinguish three questions: Is the JSON well formed? Does its checksum match? Does its signature verify under the publisher key we already trust? The first two can hold for an attacker's content. The app's independently bundled public key supplies the trust boundary.

Demonstrate checksum failure before recalculation and checksum success afterward. The signature remains invalid because the attacker does not have the trusted publisher's signing key. An attacker can sign with their own key, so accepting a key chosen by the update would undo the repair.

Show that exact text matters: changing spaces changes the bytes even when the parsed JSON means the same thing. Students should load the original fixture to recover a genuine signed payload, not attempt to recreate its formatting or obtain signing keys.

The optional website Signed Update Lab is a simulation using recorded real-service evidence. It is useful for predicting outcomes and guided discussion, but does not execute or grade a student's edited file. Keep local application evidence in the assessment.

Assessment and support​

Grade the reasoning, focused policy edit, and observed results. Rejecting every update is not sufficient: genuine updates must continue working. Require the current announcement to remain unchanged after a rejected update, without an intervening reset or restart.

Do not turn the exercise into key management or cryptographic implementation. Genuine replay is deliberately permitted; version numbers do not enforce freshness or rollback prevention. Publisher compromise, key rotation, update transport, and production delivery are outside scope. Partial credit should reflect actual evidence and explanations; label unexecuted checks as unverified.

Screenshot preview