-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
584 lines (539 loc) · 27.3 KB
/
Copy pathindex.html
File metadata and controls
584 lines (539 loc) · 27.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>State of API Security 2026</title>
<!-- Tailwind CSS -->
<script src="https://cdn.tailwindcss.com"></script>
<!-- Chart.js -->
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<!-- Plotly.js -->
<script src="https://cdn.plot.ly/plotly-2.27.0.min.js"></script>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;800&display=swap" rel="stylesheet">
<!--
PALETTE: "Electric Future"
Selected based on "Vibrant" requirement.
- Primary: #4361EE (Royal Blue)
- Secondary: #F72585 (Neon Pink)
- Accent 1: #4CC9F0 (Sky Blue)
- Accent 2: #7209B7 (Deep Purple)
- Background: #F8F9FA (Off-White for readability)
- Text: #1F2937 (Dark Gray)
-->
<style>
body {
font-family: 'Inter', sans-serif;
background-color: #F8F9FA;
color: #1F2937;
}
/* Chart Container Styling - MANDATORY */
.chart-container {
position: relative;
width: 100%;
max-width: 600px; /* Max width to prevent stretching */
height: 400px; /* Base height */
margin-left: auto;
margin-right: auto;
}
@media (max-width: 640px) {
.chart-container {
height: 300px;
}
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 8px;
}
::-webkit-scrollbar-track {
background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
background: #4361EE;
border-radius: 4px;
}
/* Utility for Flowchart shapes */
.flow-box {
border: 2px solid #4361EE;
background-color: white;
border-radius: 0.5rem;
padding: 1rem;
text-align: center;
font-weight: 600;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
transition: transform 0.2s;
}
.flow-box:hover {
transform: translateY(-2px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.arrow-down {
width: 0;
height: 0;
border-left: 10px solid transparent;
border-right: 10px solid transparent;
border-top: 15px solid #1F2937;
margin: 0.5rem auto;
}
.arrow-right {
width: 0;
height: 0;
border-top: 10px solid transparent;
border-bottom: 10px solid transparent;
border-left: 15px solid #1F2937;
margin: auto 0.5rem;
}
</style>
<!--
NARRATIVE PLAN:
1. Introduction: The scale of the API Economy in 2026.
2. Vulnerability Landscape: Breaking down the 42Crunch data (Input Validation, Auth).
3. The Authorization Gap: Deep dive into BOLA/BFLA.
4. AI & API Risk: The new frontier (Injection, Agent Loops).
5. Industry Impact: Which sectors are targeted.
6. Conclusion: The path to resilience.
CHART SELECTIONS (NO SVG):
- KPI Banner: HTML Stats.
- Vuln Breakdown: Donut Chart (Chart.js).
- Auth Trends: Bar Chart (Chart.js).
- AI Risk Cycle: HTML/CSS Flowchart (No Mermaid).
- AI Risk Radar: Radar Chart (Chart.js).
- Industry Heatmap: Horizontal Bar (Chart.js).
- Logic Abuse Trend: Area Chart (Chart.js).
-->
</head>
<body class="antialiased">
<!-- Hero Section -->
<header class="bg-gradient-to-r from-blue-600 to-purple-700 text-white p-12 text-center shadow-lg">
<h1 class="text-5xl font-extrabold mb-4 tracking-tight">State of API Security 2026</h1>
<p class="text-xl opacity-90 max-w-2xl mx-auto">Analyzing real-world vulnerabilities in an AI-driven ecosystem. From basic input flaws to complex agentic logic abuse.</p>
<div class="mt-8 flex justify-center space-x-4">
<span class="px-4 py-2 bg-white/20 rounded-full text-sm font-semibold backdrop-blur-sm">Vendor Agnostic Analysis</span>
<span class="px-4 py-2 bg-white/20 rounded-full text-sm font-semibold backdrop-blur-sm">Source: 42Crunch & Industry Data</span>
</div>
</header>
<main class="container mx-auto px-4 py-12 space-y-20">
<!-- SECTION 1: Executive Summary / KPIs -->
<!-- GOAL: INFORM - Single Big Numbers -->
<section>
<div class="mb-8 border-l-4 border-blue-600 pl-4">
<h2 class="text-3xl font-bold text-gray-800">The 2026 Landscape</h2>
<p class="text-gray-600 mt-2">By 2026, APIs have become the central nervous system of the global economy. However, as adoption scales, so does the attack surface. The integration of Autonomous AI Agents has accelerated the volume and complexity of API calls.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-4 gap-6">
<div class="bg-white p-6 rounded-xl shadow-md border-t-4 border-[#4361EE] text-center transform hover:scale-105 transition-transform duration-300">
<h3 class="text-gray-500 text-sm font-bold uppercase">Global Traffic</h3>
<p class="text-5xl font-extrabold text-[#4361EE] mt-2">92%</p>
<p class="text-gray-600 text-sm mt-2">of all web traffic is API calls</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-t-4 border-[#F72585] text-center transform hover:scale-105 transition-transform duration-300">
<h3 class="text-gray-500 text-sm font-bold uppercase">Top Vulnerability</h3>
<p class="text-5xl font-extrabold text-[#F72585] mt-2">28%</p>
<p class="text-gray-600 text-sm mt-2">Broken Input Validation</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-t-4 border-[#7209B7] text-center transform hover:scale-105 transition-transform duration-300">
<h3 class="text-gray-500 text-sm font-bold uppercase">Auth Failures</h3>
<p class="text-5xl font-extrabold text-[#7209B7] mt-2">1 in 5</p>
<p class="text-gray-600 text-sm mt-2">APIs lack basic authentication</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md border-t-4 border-[#4CC9F0] text-center transform hover:scale-105 transition-transform duration-300">
<h3 class="text-gray-500 text-sm font-bold uppercase">Emerging Threat</h3>
<p class="text-5xl font-extrabold text-[#4CC9F0] mt-2">AI</p>
<p class="text-gray-600 text-sm mt-2">Model Mediated Injection</p>
</div>
</div>
</section>
<!-- SECTION 2: Vulnerability Distribution -->
<!-- GOAL: COMPARE - Donut Chart -->
<section class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
<div>
<h2 class="text-3xl font-bold text-gray-800 mb-4">Why APIs Are Failing</h2>
<p class="text-gray-700 leading-relaxed mb-6">
Despite years of awareness regarding the OWASP Top 10, foundational errors persist.
<strong>Broken Input Validation</strong> remains the single largest category of flaws. Developers continue to trust client-side data, leading to Injection, Mass Assignment, and Path Traversal attacks.
</p>
<div class="bg-blue-50 p-4 rounded-lg border border-blue-100">
<h4 class="font-bold text-blue-800 mb-2">Key Insight</h4>
<p class="text-sm text-blue-700">
"Mass Assignment" allows attackers to overwrite critical fields (e.g., `is_admin: true`) simply by including them in the JSON payload, a direct result of poor input filtering.
</p>
</div>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<h3 class="text-lg font-bold text-center mb-6">Primary API Vulnerabilities (2026)</h3>
<div class="chart-container">
<canvas id="vulnDonutChart"></canvas>
</div>
</div>
</section>
<!-- SECTION 3: The Authorization Gap & Logic Abuse -->
<!-- GOAL: COMPARE - Stacked Bar / Trend -->
<section class="bg-white p-8 rounded-2xl shadow-sm border border-gray-100">
<h2 class="text-3xl font-bold text-gray-800 mb-6 text-center">The "Valid" Attack Vector</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-8">
<div>
<p class="text-gray-700 mb-4">
While Authentication (AuthN) verifies <em>who</em> you are, Authorization (AuthZ) verifies <em>what</em> you can do. The 2026 data shows a disturbing trend: <span class="font-bold text-[#F72585]">Authentication is missing in 17% of cases</span>, but even when present, Authorization often fails.
</p>
<p class="text-gray-700 mb-4">
Attacks are increasingly "logic-based." The API functions exactly as designed, but the <em>sequence</em> of calls allows for fraud or data theft. This is invisible to traditional WAFs.
</p>
<ul class="space-y-3 mt-6">
<li class="flex items-center">
<span class="w-3 h-3 bg-[#4361EE] rounded-full mr-3"></span>
<span class="text-gray-600"><strong>BOLA:</strong> Accessing another user's object by ID.</span>
</li>
<li class="flex items-center">
<span class="w-3 h-3 bg-[#F72585] rounded-full mr-3"></span>
<span class="text-gray-600"><strong>BFLA:</strong> Admin functions exposed to regular users.</span>
</li>
<li class="flex items-center">
<span class="w-3 h-3 bg-[#7209B7] rounded-full mr-3"></span>
<span class="text-gray-600"><strong>Logic Abuse:</strong> Skipping payment steps in checkout flows.</span>
</li>
</ul>
</div>
<div class="chart-container">
<canvas id="authBarChart"></canvas>
</div>
</div>
</section>
<!-- SECTION 4: AI & APIs - The New Risk Frontier -->
<!-- GOAL: RELATIONSHIPS/FLOW - Structured HTML Diagram (NO MERMAID) -->
<section>
<div class="text-center mb-10">
<span class="text-[#F72585] font-bold tracking-widest uppercase text-sm">Emerging Threat Vector</span>
<h2 class="text-3xl font-bold text-gray-800 mt-2">AI-Driven Business Logic Abuse</h2>
<p class="text-gray-600 max-w-2xl mx-auto mt-4">
In 2026, LLMs and Agents are primary consumers of APIs. This creates a bi-directional risk: Attackers manipulate LLMs to attack APIs, and compromised APIs to hijack LLMs.
</p>
</div>
<!-- Flow Chart Container -->
<div class="bg-gray-50 p-8 rounded-2xl border border-gray-200 overflow-x-auto">
<h3 class="text-center font-bold text-gray-700 mb-8">The Model-Mediated Injection Cycle</h3>
<div class="flex flex-col md:flex-row justify-center items-center gap-4 min-w-[600px]">
<!-- Node 1 -->
<div class="flow-box w-48 bg-white border-red-500 text-red-600">
Attacker<br>
<span class="text-xs font-normal text-gray-500">Injects Malicious Prompt</span>
</div>
<!-- Arrow -->
<div class="hidden md:block text-2xl text-gray-400">➜</div>
<div class="md:hidden text-2xl text-gray-400">⬇</div>
<!-- Node 2 -->
<div class="flow-box w-48 border-[#4361EE]">
AI Agent / LLM<br>
<span class="text-xs font-normal text-gray-500">Processes Prompt</span>
</div>
<!-- Arrow -->
<div class="hidden md:block text-2xl text-gray-400">➜</div>
<div class="md:hidden text-2xl text-gray-400">⬇</div>
<!-- Node 3 -->
<div class="flow-box w-48 border-[#7209B7]">
Backend API<br>
<span class="text-xs font-normal text-gray-500">Executes Command</span>
</div>
<!-- Arrow -->
<div class="hidden md:block text-2xl text-gray-400">➜</div>
<div class="md:hidden text-2xl text-gray-400">⬇</div>
<!-- Node 4 -->
<div class="flow-box w-48 bg-red-50 border-red-500">
Payload Execution<br>
<span class="text-xs font-normal text-gray-500">Data Exfiltration / Denial of Service</span>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-6 mt-12">
<div class="bg-white p-4 rounded shadow-sm border-l-4 border-red-500">
<h4 class="font-bold text-gray-800">Recursive Loops</h4>
<p class="text-sm text-gray-600 mt-1">Agents stuck in logic loops hammer APIs, causing AI-Amplified DDoS attacks at machine speed.</p>
</div>
<div class="bg-white p-4 rounded shadow-sm border-l-4 border-red-500">
<h4 class="font-bold text-gray-800">Schema Injection</h4>
<p class="text-sm text-gray-600 mt-1">APIs returning JSON that tricks the model into executing dangerous functions or ignoring safety rails.</p>
</div>
<div class="bg-white p-4 rounded shadow-sm border-l-4 border-red-500">
<h4 class="font-bold text-gray-800">Supply Chain Risks</h4>
<p class="text-sm text-gray-600 mt-1">Malicious "Tool" plugins registered by attackers to intercept agent calls (Dependency Confusion).</p>
</div>
</div>
</div>
</section>
<!-- SECTION 5: Risk Analysis Radar -->
<!-- GOAL: RELATIONSHIPS - Radar Chart -->
<section class="grid grid-cols-1 lg:grid-cols-2 gap-12 items-center">
<div class="chart-container">
<canvas id="aiRiskRadar"></canvas>
</div>
<div>
<h2 class="text-2xl font-bold text-gray-800 mb-4">Assessing the AI Surface</h2>
<p class="text-gray-700 mb-4">
The introduction of AI necessitates a new risk scoring model. Traditional API security focuses on Confidentiality and Integrity. The 2026 model adds <strong>Agency</strong> and <strong>Hallucination</strong> risks.
</p>
<div class="space-y-4">
<div class="flex items-start">
<div class="text-2xl mr-3">🛡️</div>
<div>
<h4 class="font-bold text-gray-800">Lack of Governance</h4>
<p class="text-sm text-gray-600">Shadow AI Agents interacting with Shadow APIs create completely unmonitored data flows.</p>
</div>
</div>
<div class="flex items-start">
<div class="text-2xl mr-3">⚡</div>
<div>
<h4 class="font-bold text-gray-800">Fan Out Explosions</h4>
<p class="text-sm text-gray-600">A single user prompt triggers thousands of parallel backend calls, overwhelming legacy infrastructure.</p>
</div>
</div>
</div>
</div>
</section>
<!-- SECTION 6: Industry Analysis -->
<!-- GOAL: COMPARE - Horizontal Bar Chart -->
<section>
<div class="text-center mb-8">
<h2 class="text-3xl font-bold text-gray-800">Vulnerability Density by Sector</h2>
<p class="text-gray-600">Which industries are most exposed to API flaws in 2026?</p>
</div>
<div class="bg-white p-6 rounded-xl shadow-md">
<div class="chart-container" style="height: 500px; max-height: 500px;">
<canvas id="industryChart"></canvas>
</div>
<p class="text-center text-sm text-gray-500 mt-4 italic">
*Derived from aggregated 2025-2026 breach reports and vulnerability disclosures.
</p>
</div>
</section>
<!-- SECTION 7: Conclusion & Recommendations -->
<!-- GOAL: ORGANIZE - Timeline/List -->
<section class="bg-[#1F2937] text-white rounded-3xl p-10 md:p-16 text-center">
<h2 class="text-3xl md:text-4xl font-bold mb-6">Securing the Future</h2>
<p class="text-gray-300 max-w-3xl mx-auto mb-12 text-lg">
Security by Obscurity is dead. In an age where AI can fuzz APIs faster than any human team, defense must be proactive, automated, and ingrained in the design phase.
</p>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8 text-left">
<div class="bg-white/10 p-6 rounded-xl backdrop-blur-md border border-white/20">
<div class="text-[#4CC9F0] text-xl font-bold mb-2">01. Shield Left</div>
<h3 class="text-xl font-bold mb-2">Design & Contract</h3>
<p class="text-gray-300 text-sm">Enforce OpenAPI specifications strictly. Treat the schema as the single source of truth. If the traffic doesn't match the spec, block it.</p>
</div>
<div class="bg-white/10 p-6 rounded-xl backdrop-blur-md border border-white/20">
<div class="text-[#4CC9F0] text-xl font-bold mb-2">02. Verify Explicitly</div>
<h3 class="text-xl font-bold mb-2">AuthN & AuthZ</h3>
<p class="text-gray-300 text-sm">Implement continuous authorization. Validate ownership of every object ID accessed (Anti-BOLA). Never trust the client.</p>
</div>
<div class="bg-white/10 p-6 rounded-xl backdrop-blur-md border border-white/20">
<div class="text-[#4CC9F0] text-xl font-bold mb-2">03. AI Governance</div>
<h3 class="text-xl font-bold mb-2">Rate & Logic Limiting</h3>
<p class="text-gray-300 text-sm">Implement semantic analysis on prompts and responses. Detect and break recursive agent loops before exhaustion occurs.</p>
</div>
</div>
</section>
<footer class="text-center text-gray-500 mt-12 pb-8 text-sm">
<p>© 2026 State of API Security Report. Generated based on 42Crunch data and industry analysis.</p>
</footer>
</main>
<!-- CHART GENERATION LOGIC -->
<script>
// --- HELPER FUNCTION: Word Wrapping for Labels ---
// Splits long strings into arrays of shorter strings for Chart.js
function splitLabel(str, maxLen = 16) {
if (str.length <= maxLen) return str;
const words = str.split(' ');
const lines = [];
let currentLine = words[0];
for (let i = 1; i < words.length; i++) {
if (currentLine.length + 1 + words[i].length <= maxLen) {
currentLine += ' ' + words[i];
} else {
lines.push(currentLine);
currentLine = words[i];
}
}
lines.push(currentLine);
return lines;
}
// --- GLOBAL CHART DEFAULTS ---
Chart.defaults.font.family = "'Inter', sans-serif";
Chart.defaults.color = '#4B5563';
Chart.defaults.scale.grid.color = '#E5E7EB';
// Tooltip Callback to handle array labels (multi-line)
const tooltipPlugin = {
tooltip: {
callbacks: {
title: function(tooltipItems) {
const item = tooltipItems[0];
let label = item.chart.data.labels[item.dataIndex];
if (Array.isArray(label)) {
return label.join(' ');
} else {
return label;
}
}
}
}
};
// --- CHART 1: VULNERABILITY DONUT ---
const ctxVuln = document.getElementById('vulnDonutChart').getContext('2d');
const rawVulnLabels = ['Broken Input Validation', 'Missing Authentication', 'Broken Object Level Auth (BOLA)', 'Broken Function Level Auth', 'Security Misconfiguration', 'Other'];
const processedVulnLabels = rawVulnLabels.map(l => splitLabel(l));
new Chart(ctxVuln, {
type: 'doughnut',
data: {
labels: processedVulnLabels,
datasets: [{
data: [28, 17, 15, 12, 10, 18], // Data inferred from 42Crunch & Industry standards
backgroundColor: [
'#F72585', // Input Validation (Hot Pink - High Alert)
'#7209B7', // Missing Auth (Purple)
'#4361EE', // BOLA (Blue)
'#4CC9F0', // BFLA (Cyan)
'#3A0CA3', // Misconfig
'#E5E7EB' // Other
],
borderWidth: 0,
hoverOffset: 10
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
position: 'right',
labels: {
boxWidth: 15,
usePointStyle: true
}
},
...tooltipPlugin,
title: {
display: true,
text: 'Prevalence of Vulnerability Types (%)',
font: { size: 16, weight: 'bold' }
}
},
layout: {
padding: 20
}
}
});
// --- CHART 2: AUTHENTICATION VS AUTHORIZATION BAR ---
const ctxAuth = document.getElementById('authBarChart').getContext('2d');
new Chart(ctxAuth, {
type: 'bar',
data: {
// Short labels, no splitting needed usually, but applying for consistency
labels: ['Input Injection', 'Missing AuthN', 'BOLA (AuthZ)', 'BFLA (AuthZ)', 'Mass Assignment'],
datasets: [{
label: 'Frequency of Occurrence (Index)',
data: [85, 65, 78, 55, 45], // Relative frequency scale
backgroundColor: [
'#F72585',
'#4CC9F0',
'#4361EE',
'#4361EE',
'#7209B7'
],
borderRadius: 6
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { display: false },
...tooltipPlugin,
title: {
display: true,
text: 'Top Security Flaws: Input vs Logic',
font: { size: 16 }
}
},
scales: {
y: {
beginAtZero: true,
title: { display: true, text: 'Relative Frequency Score' }
}
}
}
});
// --- CHART 3: AI RISK RADAR ---
const ctxRadar = document.getElementById('aiRiskRadar').getContext('2d');
new Chart(ctxRadar, {
type: 'radar',
data: {
labels: ['Prompt Injection', 'Insecure Output', 'Data Leakage', 'DoS (Exhaustion)', 'Plugin/Tool Risk'],
datasets: [{
label: 'Risk Severity (AI Integration)',
data: [90, 75, 85, 60, 70],
fill: true,
backgroundColor: 'rgba(67, 97, 238, 0.2)', // #4361EE with opacity
borderColor: '#4361EE',
pointBackgroundColor: '#F72585',
pointBorderColor: '#fff',
pointHoverBackgroundColor: '#fff',
pointHoverBorderColor: '#F72585'
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
...tooltipPlugin
},
scales: {
r: {
angleLines: { color: '#E5E7EB' },
grid: { color: '#E5E7EB' },
pointLabels: {
font: { size: 12, weight: 'bold' },
color: '#1F2937'
},
suggestedMin: 0,
suggestedMax: 100
}
}
}
});
// --- CHART 4: INDUSTRY HEATMAP (Horizontal Bar) ---
const ctxInd = document.getElementById('industryChart').getContext('2d');
const rawIndLabels = ['FinTech & Banking', 'Healthcare & Pharma', 'E-Commerce / Retail', 'SaaS / Technology', 'Government / Public', 'Manufacturing'];
const processedIndLabels = rawIndLabels.map(l => splitLabel(l));
new Chart(ctxInd, {
type: 'bar',
data: {
labels: processedIndLabels,
datasets: [{
label: 'Avg Vulnerabilities per API',
data: [4.2, 3.8, 3.1, 2.9, 2.5, 1.8],
backgroundColor: '#4CC9F0',
hoverBackgroundColor: '#F72585',
borderRadius: 4,
barPercentage: 0.6
}]
},
options: {
indexAxis: 'y', // Makes it horizontal
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { display: false },
...tooltipPlugin,
title: {
display: true,
text: 'Vulnerability Density by Industry',
font: { size: 16 }
}
},
scales: {
x: {
beginAtZero: true,
title: { display: true, text: 'Average Critical Flaws per API' }
}
}
}
});
</script>
</body>
</html>