Small internal tools have a way of becoming production tools before anyone admits it.
That is dangerous because the assumptions are different. A development tool can tolerate rough edges. A production portal that handles images, campaign links, customer-facing email HTML, and authenticated workflows cannot.
The BDC security audit forced me to admit that transition had already happened.
Testing The Escaping Boundary
An HTML escaping helper needs tests of its actual output. Its name and intended purpose do not establish that a preview will handle user-supplied text safely.
A useful test supplies characters that have meaning in HTML and checks that they appear as text rather than changing the document. The same care applies wherever a value moves from a form into a preview or an exported template.
A shared helper can serve dozens of fields. Testing that boundary is more useful than assuming that every caller is protected because a helper exists.
Preview Surfaces Are Attack Surfaces
Template builders are especially risky because they often accept arbitrary-looking input and immediately render it.
Vehicle descriptions, campaign titles, button text, footer copy, image URLs, tracking parameters, and promotional text all become part of a preview. If that preview uses unsafe HTML insertion or accepts dangerous URL protocols, the builder becomes an XSS playground.
The review checklist covered the relevant boundaries:
- Escaping at the point of output.
- Safe preview rendering.
- Allowed URL protocols.
- Campaign identifier validation.
- Server-side file validation.
- Authorization for asset operations.
These are ordinary review areas for a tool that accepts content and produces HTML.
Authentication Is Part Of The Workflow
A shared image tool needs access rules that fit the portal around it. Uploading, processing, moving, and deleting assets are privileged operations, even when they are presented through a convenient interface.
A review needs to follow those operations through the server-side checks. The existence of a login screen or supporting authentication code does not establish what a particular operation permits.
Authentication code that is “ready to enable” is not enabled. A TODO is not a control. A development shortcut is fine only if the deployment process reliably catches it before the tool is exposed.
Security posture is not just code. It is the path from code to production.
The Audit Became A Checklist
The useful result of the audit was not shame. It was a list I could work through.
I organized the review around:
- Correct escaping.
- URL protocol validation.
- Safer preview rendering.
- Campaign identifier sanitization.
- Server-side file validation.
- Authentication on upload and processing endpoints.
- CSRF protection where state changes occur.
- Regression tests for known failures.
That is the difference between a tool that works and a tool that can be trusted.
Once my internal PHP portal started producing customer-facing assets, “internal tool” stopped being a meaningful excuse. It needed production-grade hardening even though it had begun as a convenience.