A content policy for every page — the announcement
UNCTAD Digital Government Programme · 2026-08 · draft for release
Every page a citizen or civil servant touches now tells the browser exactly what it is allowed to run — in every country that will ever run the platform, before the first country goes live.
A browser will run any script a page tells it to run. Government portals are targets precisely because of what flows through them: identity documents, passwords, payment details. OpenGov now ships a content policy on every page and every API response — a header that says “scripts only from this site” — plus transport security on by default, so an encrypted visit stays encrypted.
What this means for citizens and businesses
- Their browser refuses injected code. The classic portal attack — malicious script injected into a form to skim identity documents or credentials as people type — is now blocked by the browser itself, not by our vigilance.
- A privilege-escalation path is closed, not patched. Text an agency staff member wrote in the rule editor used to be compiled into JavaScript and executed in every applicant’s browser. That machinery is deleted outright: rules are now pure data — which is also what makes them readable by any system a country connects later.
- Their visit stops leaking to third parties. Typefaces were fetched from an external company on every page, revealing which citizens visited which service, and breaking entirely in an air-gapped ministry. Fonts are now served in-house.
- Encrypted stays encrypted. A citizen on a hostile network cannot be silently downgraded to plaintext on a return visit, and the “proceed anyway” button on a bad certificate is gone for a service that handles identity documents.
What this means for country counterparts
- Security that survives deployment reality. The protection was verified where it actually fails — behind the country’s reverse proxy, on real page responses, with the country’s own identity server and payment provider named in the policy. Sign-in and payment checkout keep working because the policy is built from each deployment’s own configuration.
- Nothing new to operate. On by default, no operator action. The one decision
(private-certificate-authority installs) and the one post-go-live check (the
sign-in host’s own header) are written down in a runbook a non-engineer can
follow (
docs/runbooks/security-headers.md). - One less exposure nobody asked for. The interactive API documentation — the most permissive page on the platform — was reachable in every country and is now off unless a developer explicitly enables it.
- Cross-country comparability is preserved. Published requirements remain structured data, so “how many countries require capital above X” stays answerable — core to the programme’s benchmarking mission.
The honest boundary
This raises the cost of attacks from outside the operator. A compromised or malicious operator can still change the code they serve — no header changes that, and the non-extractable wallet key (the third control in the vault threat table) remains unbuilt. What countries get today is that everyone else’s attack got much harder, on every page, by default.
Design: docs/specs/2026-07-29-content-security-policy.md. Operations:
docs/runbooks/security-headers.md. Shipped in PR #1663 (2026-08).