Skip to content
All work

Case study 03Client system · in production2026

Nottary-Service

Secure deed-registration tracker for a notarial office

Nottary-Service (repository: Law-App, internal name Nithi Docket) replaced a browser-only prototype used by a legal and notarial office. I analysed the prototype, documented its weaknesses, and rebuilt it as a server-side application while preserving every field and the visual identity the staff were used to.

Stack
  • PHP 8
  • MySQL 8
  • PDO
  • Bootstrap 5
  • Firebase Cloud Messaging
  • text.lk SMS
  • PHPUnit
  • PHP_CodeSniffer
Nottary-Service sign-in screen with the headline “A single, secure record of every deed from submission to registration.” and a workspace login card.
explicit deed workflow
3-stepexplicit deed workflow
notification channels
2notification channels
enforced code style
PSR-12enforced code style
nottary-service.online
Livenottary-service.online

01

Starting from the prototype

Weaknesses found, and what replaced them
PrototypeRebuild
All data in localStorage, no backupMySQL with foreign keys, indexes and audit trail
Plaintext passwords compared in the browserpassword_hash / password_verify on the server
Open self-sign-up for legal recordsAccounts created only by an administrator
“Send SMS” flipped a booleanReal FCM push and real SMS, with true outcomes logged
No authorization boundariesRBAC checked in every controller action, not just hidden in the UI

02

Security, implemented and testable

  • Every query uses PDO prepared statements with emulated prepares turned off, so MySQL’s native protocol is used.
  • CSRF is checked centrally in the router, so a controller cannot forget it; a failure returns HTTP 419.
  • 5 failed sign-ins lock an account for 15 minutes; more than 20 failures from one IP in 10 minutes are refused.
  • Session IDs regenerate on login; cookies are HttpOnly, SameSite=Lax and Secure over HTTPS, with a server-side idle timeout.
  • All output escaped through one helper; security headers and CSP set in a hardened .htaccess.

03

A bug class that only shows up at runtime

Testing against a real MySQL instance, rather than relying on syntax checks, surfaced four queries that reused the same named placeholder twice. With native prepared statements MySQL rejects that, and it only appears at runtime as SQLSTATE[HY093]. All four were fixed, and the reason emulated prepares stay off is documented.

Next case study

HelaIQ