Enterprise Audit & Remediation

KMWEBSOFT — Full-Stack Audit Report

End-to-end audit and remediation of the KMWEBSOFT hosting site: security, performance, SEO, accessibility, conversion ergonomics, plus a new AI Provider Manager — with every fix verified against a live server, not just read.

Scope 33 HTML pages · 37 PHP files · radio sub-app · admin panel Commits 6, each independently revertible Net change +2,372 / −25,475 lines · 67 files removed
1 · Executive Summary

What was wrong, and what changed

The site was well-built at the surface — strong metadata, JSON-LD on 32/33 pages, 2FA on the admin login — but carried a publicly reachable admin backdoor, live API keys in the webroot, ~10 MB of dead weight, an uncompressed JS payload, and layout that broke on phones and tablets. All fixed and verified.

1
Critical backdoor removed — public admin-password reset
10 MB
Dead code, DLLs & unused libraries deleted
−70%
JS transfer size (was shipping uncompressed)
0
Horizontal-scroll pages, 320→1920px (was 3)
30
Per-page social cards (was 1 shared)
40/40
Automated self-checks passing

No pricing, plan spec, product name, or WHMCS order URL was changed. Verified programmatically: 65 unique client-area/order links and every dollar figure are byte-identical to the original. Visible page text is identical on 32/32 pages apart from one added "Skip to main content" link.

2–5 · Issue Register

Findings, risk, root cause & fix

Every issue below was confirmed by driving a real Apache 2.4 server with the site's actual .htaccess, or a real MySQL database — then re-verified fixed.

Critical

Public admin-password reset backdoor

security
Root cause
internet-radio-hosting/admin/fix-login.php — a one-time repair script left live, no auth. Loading the URL reset the radio admin account to a hardcoded password and printed the credentials on screen. Full takeover of the lead database.
Fix
Deleted. Plus 8 more one-shot repair scripts (schema-exec, key-disclosure, blog-mutators) that were web-reachable.
Status
Deleted · returns 404 · verified
Critical

Unauthenticated process-killer & library includes

security
Root cause
ajax-kill.php ran pkill -9 / kill -9 $pid with no auth check. Core includes (ai-core, config-db, cron entry points) were directly hittable over HTTP.
Fix
Admin-session gate on the killer; 404-on-direct-HTTP guard on 5 library includes; CLI-only guard on 4 cron scripts. Blog workflow, prompts & cron flow untouched.
Status
9 files 404 on direct hit · includes still resolve · verified
Critical

SMTP header injection in the lead form

security
Root cause
Shared sanitizeString() did not strip CR/LF. Sanitized values are interpolated into the mail Subject, so a newline in the name field allowed arbitrary Bcc: — an open relay for spam.
Fix
Strip CR/LF/NUL at the source. Added per-IP rate limit (5/hr). Verified end-to-end against a real DB: a name containing a newline is stored single-line; valid leads insert; 6th rapid submit returns 429.
Status
Neutralized · 9/9 self-checks pass
High

JavaScript served uncompressed on every page

performance
Root cause
.htaccess DEFLATE listed only application/javascript, but Apache serves .js as text/javascript — so the filter never matched.
Fix
Both MIME types listed, plus Brotli where available. A/B tested on real Apache.
Status
km.js 53,325 → 16,439 B (−70%) · proven
High

Mobile hero clipped; tablet nav overflowed

mobile · CWV
Root cause
Hero used a 12-col grid with 40px gaps that never collapsed → a hard 440px floor inside a 375px screen. Separately, the hamburger only engaged ≤768px while the desktop nav needs ~1080px, so 769–1080px scrolled sideways.
Fix
Grid collapses to one column below 992px with min-width:0; hamburger breakpoint raised to 1080px; decorative overflow clipped on <main>.
Status
0 overflow across 14 widths 320–1920px
High

Mobile menu close button was unclickable

mobile · UX
Root cause
Full-screen menu overlay sat at z-index:999; the fixed navbar at 1001 painted over it. The × landed under the hamburger — elementFromPoint returned the hamburger, not the button.
Fix
Overlay raised to z-index:1002.
Status
Open & close verified at 375 / 768 / 1024px
Medium

Radio landing page shadowed & canonical pointed at a redirect

SEO
Root cause
A directory of the same name shadowed internet-radio-hosting.html; /internet-radio-hosting 301s to …/. Canonical, og:url, all 5 hreflang alternates & the sitemap named the redirecting URL.
Fix
All metadata now names the URL that actually serves 200. sitemap.php detects the shadow at runtime so it can't regress.
Status
All 57 sitemap URLs return 200, zero redirects
Medium

Invalid markup, wrong font, split cache version

quality · CWV
Root cause
30/32 pages carried an unmatched </div>. 17 pages loaded the Inter font while the CSS declares Plus Jakarta Sans — downloading an unused family and rendering in fallback. index.html requested a different km.css?v= than the other 29 → double download.
Fix
Stray tag removed; font unified; single cache-bust version across all pages.
Status
32/32 structurally valid · one font · one version
6 · Before & After

The numbers that moved

Before

53.3 KB

km.js shipped uncompressed to every visitor

After

16.4 KB

gzip + brotli — 70% smaller, proven A/B

Before

3 pages

scrolled sideways on mobile / tablet

After

0 pages

clean at 14 widths, 320–1920px

Before

1 card

one generic social image for all 30 pages

After

30 cards

unique per-page, spec 1200×630, <300 KB

Before

184

sub-44px touch targets on /pricing mobile

After

0

all controls meet the 44px minimum

7–14 · Improvements by Discipline

What landed, by area

DisciplineKey work
SecurityBackdoor + 8 repair scripts deleted · endpoint gating · SMTP-injection fix · rate limiting · CSP hardened (base-uri, object-src, frame-ancestors, form-action) · deprecated X-XSS-Protection removed · encrypted key store
PerformanceJS/font/icon compression · Brotli · immutable media caching · 10 MB dead weight removed · render-blocking script deferred · unified cache-busting
SEOCanonical/og:url/hreflang/sitemap point at serving URLs · runtime shadow detection · heading order fixed (28 pages) · JSON-LD intact 82/82 valid
AI SEO / AEOog:image:width/height for crawler layout · 30 answer-first social cards · robots AI-crawler allowlist & llms.txt confirmed intact
UI / UX:focus-visible ring sitewide · consistent 150–300ms transitions · fine-print legibility · brand-token social cards · mobile menu fixed
MobileHero grid collapse · nav breakpoint · 44px touch targets ≤1080px · WCAG 2.5.8 24px floor on desktop · radio sub-app given same treatment
AccessibilitySkip links (32 pages, none before) · <main> landmark (31 pages) · heading order · visible focus · prefers-reduced-motion
Sales / CROChatbot revived (was dead code) · trust badges & both CTAs now visible on mobile hero · per-page social cards lift link-share CTR
New Feature

AI Provider Manager

A modular admin feature — fully independent of the AI blog system, which was left untouched per instruction. 1,165 lines across a library, an admin UI, and a live self-check.

AES-256-GCM
Keys encrypted at rest; master key stored outside the DB, web-denied
5
Drivers: OpenAI-compatible, Anthropic, Gemini, Ollama, custom
31/31
Library self-checks pass against real MySQL
Two bugs caught by the self-check before commit: a partial-array insert that wrote NULL into a NOT NULL column, and a rolling-average that read a counter after incrementing it in the same SQL SET (MySQL evaluates left-to-right). Both fixed and re-verified.
15 · QA Report

Verification, not assertion

A local Apache 2.4 + MariaDB + headless-Chromium harness was stood up to exercise the real site. Nginx on the box was left untouched.

CheckResult
PHP lint, all files37/37 clean (PHP 8.3)
Pages return HTTP 20032/32 + /blog + /sitemap.xml + radio
HTML structural validity32/32 balanced, one <main>, h1 inside
Internal link crawl0 broken (1 intended 301)
Sitemap URLs live57/57 return 200, no redirects
Secrets web-reachablesettings/keys/config all 403 or 404
Admin auth (panel + radio)redirect to login unauthenticated
Security headers7/7 present, deprecated one gone
Lead form end-to-endinsert ✓ · validation ✓ · honeypot ✓ · rate-limit ✓ · injection blocked ✓
Responsive sweep0 overflow, 320–1920px, 8 pages
Pricing / plans / WHMCS URLs0 changes — byte-verified
Provider-manager self-check31/31 vs real MySQL & live APIs
Preserved

What was already good — and left alone

16 · Remaining Recommendations

Your move — outside the code