shield-llm 0.7.2 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-OLRBOH6L.js → chunk-XMFALD5J.js} +103 -64
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/dist/logo.png +0 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __cjs_createRequire } from "module"; import { fileURLToPath as __cjs_fileURLToPath } from "url"; import { dirname as __cjs_dirname } from "path"; const __filename = __cjs_fileURLToPath(import.meta.url); const __dirname = __cjs_dirname(__filename); const require = __cjs_createRequire(import.meta.url);
|
|
2
2
|
|
|
3
3
|
// package.json
|
|
4
|
-
var version = "0.7.
|
|
4
|
+
var version = "0.7.3";
|
|
5
5
|
|
|
6
6
|
// src/config/schema.ts
|
|
7
7
|
import { z as z2 } from "zod";
|
|
@@ -1003,6 +1003,7 @@ function guardedRun(fn, budget) {
|
|
|
1003
1003
|
}
|
|
1004
1004
|
function guardedRunWith(run, fn, budget) {
|
|
1005
1005
|
if (!run || watched) return { completed: true, value: fn() };
|
|
1006
|
+
if (budget.timedOut) return { completed: false };
|
|
1006
1007
|
const remaining = Math.floor(budget.deadline - performance.now());
|
|
1007
1008
|
if (remaining < 1) {
|
|
1008
1009
|
budget.timedOut = true;
|
|
@@ -1563,7 +1564,7 @@ var PERSONA_HIJACK_MAPPING = {
|
|
|
1563
1564
|
},
|
|
1564
1565
|
{
|
|
1565
1566
|
articleNumber: "Article 5",
|
|
1566
|
-
articleTitle: "Pratiques d'
|
|
1567
|
+
articleTitle: "Pratiques interdites en mati\xE8re d'IA",
|
|
1567
1568
|
requirement: "Les syst\xE8mes IA ne doivent pas \xEAtre utilis\xE9s pour des pratiques de manipulation",
|
|
1568
1569
|
complianceAspect: "prohibited",
|
|
1569
1570
|
riskLevel: "high",
|
|
@@ -1635,7 +1636,7 @@ var XPIA_BYPASS_ECHOLEAK_MAPPING = {
|
|
|
1635
1636
|
...ART_15_ROBUSTNESS_BASE,
|
|
1636
1637
|
riskLevel: "critical",
|
|
1637
1638
|
failImplication: "Le syst\xE8me ex\xE9cute des instructions inject\xE9es dans du contenu tiers (emails, documents RAG) au lieu de les traiter comme donn\xE9es \u2014 vuln\xE9rable au cross-prompt injection (EchoLeak-style)",
|
|
1638
|
-
remediationGuidance: "Marquer clairement le contenu provenant de sources externes comme
|
|
1639
|
+
remediationGuidance: "Marquer clairement le contenu provenant de sources externes comme ne faisant pas autorit\xE9. Supprimer les marqueurs de directives avant leur int\xE9gration au contexte du mod\xE8le"
|
|
1639
1640
|
},
|
|
1640
1641
|
{
|
|
1641
1642
|
...ART_9_RISK_MGMT_BASE,
|
|
@@ -1718,7 +1719,7 @@ var INVISIBLE_UNICODE_TAG_MAPPING = {
|
|
|
1718
1719
|
{
|
|
1719
1720
|
...ART_15_ROBUSTNESS_BASE,
|
|
1720
1721
|
failImplication: "Le syst\xE8me agit sur des instructions invisibles encod\xE9es en caract\xE8res Unicode Tag (U+E0000\u2013U+E007F), permettant une injection invisible \xE0 l'utilisateur",
|
|
1721
|
-
remediationGuidance: "
|
|
1722
|
+
remediationGuidance: "Supprimer ou rejeter les classes Unicode invisibles (Tag, zero-width, control) avant que l'entr\xE9e n'atteigne le mod\xE8le"
|
|
1722
1723
|
},
|
|
1723
1724
|
{
|
|
1724
1725
|
...ART_13_TRANSPARENCY_BASE,
|
|
@@ -1956,7 +1957,7 @@ var PII_PHISHING_MAPPING = {
|
|
|
1956
1957
|
},
|
|
1957
1958
|
{
|
|
1958
1959
|
articleNumber: "Article 5",
|
|
1959
|
-
articleTitle: "Pratiques d'
|
|
1960
|
+
articleTitle: "Pratiques interdites en mati\xE8re d'IA",
|
|
1960
1961
|
requirement: "Les syst\xE8mes IA ne doivent pas \xEAtre utilis\xE9s pour exploiter les vuln\xE9rabilit\xE9s des personnes",
|
|
1961
1962
|
complianceAspect: "prohibited",
|
|
1962
1963
|
riskLevel: "critical",
|
|
@@ -2126,7 +2127,7 @@ var MEMORY_RECOMMENDATION_POISONING_MAPPING = {
|
|
|
2126
2127
|
{
|
|
2127
2128
|
...ART_15_ROBUSTNESS_BASE,
|
|
2128
2129
|
failImplication: "Un lien malveillant contenant un param\xE8tre `_assistant_pref` empoisonne les recommandations futures de l'agent (vendor ranking)",
|
|
2129
|
-
remediationGuidance: "
|
|
2130
|
+
remediationGuidance: "Supprimer les param\xE8tres d'URL qui ressemblent \xE0 des directives (`_assistant_*`, `_system_*`) avant tout fetch ou r\xE9sum\xE9 ; traiter chaque URL coll\xE9e comme un contenu non fiable"
|
|
2130
2131
|
}
|
|
2131
2132
|
]
|
|
2132
2133
|
};
|
|
@@ -2686,7 +2687,7 @@ var LETHAL_TRIFECTA_PROBE_MAPPING = {
|
|
|
2686
2687
|
{
|
|
2687
2688
|
...ART_15_ROBUSTNESS_BASE,
|
|
2688
2689
|
failImplication: "Les trois pr\xE9requis EchoLeak coexistent (acc\xE8s donn\xE9es priv\xE9es + ingestion contenu non fiable + vecteur d'exfiltration) \u2014 compromission zero-click possible",
|
|
2689
|
-
remediationGuidance: "
|
|
2690
|
+
remediationGuidance: "Briser au moins un pilier de la triade : soit interdire les outils sur donn\xE9es priv\xE9es, soit bloquer l'ingestion de contenu non fiable, soit supprimer les vecteurs d'exfiltration (images markdown, liens externes)"
|
|
2690
2691
|
},
|
|
2691
2692
|
{
|
|
2692
2693
|
...ART_14_HUMAN_OVERSIGHT_BASE,
|
|
@@ -3078,7 +3079,7 @@ var RAG_HIDDEN_TEXT_WHITESPACE_MAPPING = {
|
|
|
3078
3079
|
{
|
|
3079
3080
|
...ART_15_ROBUSTNESS_BASE,
|
|
3080
3081
|
failImplication: "Un document index\xE9 contient du texte invisible (blanc sur blanc / taille 0) qui d\xE9tourne l'agent \xE0 l'insu d'un relecteur humain",
|
|
3081
|
-
remediationGuidance: "Nettoyer les documents \xE0 l'ingestion :
|
|
3082
|
+
remediationGuidance: "Nettoyer les documents \xE0 l'ingestion : supprimer les spans masqu\xE9s par CSS, les plages en font-size:0 et les blocs blanc sur blanc avant le d\xE9coupage (chunking). Pour les corpus sensibles, effectuer un rendu du document puis une OCR"
|
|
3082
3083
|
}
|
|
3083
3084
|
]
|
|
3084
3085
|
};
|
|
@@ -3098,7 +3099,7 @@ var RAG_HTML_COMMENT_INJECTION_MAPPING = {
|
|
|
3098
3099
|
{
|
|
3099
3100
|
...ART_15_ROBUSTNESS_BASE,
|
|
3100
3101
|
failImplication: "Une instruction d'injection cach\xE9e dans un commentaire HTML d'une page d'aide est suivie par l'agent",
|
|
3101
|
-
remediationGuidance: "
|
|
3102
|
+
remediationGuidance: "Supprimer les commentaires HTML, les scripts inline et les balises noscript des documents \xE0 l'ingestion ; convertir le HTML en texte avec un moteur de rendu qui nettoie le contenu"
|
|
3102
3103
|
}
|
|
3103
3104
|
]
|
|
3104
3105
|
};
|
|
@@ -3112,7 +3113,7 @@ var RAG_METADATA_INJECTION_MAPPING = {
|
|
|
3112
3113
|
{
|
|
3113
3114
|
...ART_15_ROBUSTNESS_BASE,
|
|
3114
3115
|
failImplication: "Une instruction d'injection cach\xE9e dans les keywords PDF / EXIF d\xE9clenche une action non sollicit\xE9e (\xE9num\xE9ration de fichiers utilisateur)",
|
|
3115
|
-
remediationGuidance: "
|
|
3116
|
+
remediationGuidance: "Nettoyer les m\xE9tadonn\xE9es \xE0 l'ingestion : supprimer ou \xE9chapper les champs keyword, subject et description qui contiennent des formulations d'instruction. Ne jamais int\xE9grer les m\xE9tadonn\xE9es dans le contexte du mod\xE8le"
|
|
3116
3117
|
}
|
|
3117
3118
|
]
|
|
3118
3119
|
};
|
|
@@ -3122,7 +3123,7 @@ var RAG_POISONED_CORPUS_MAPPING = {
|
|
|
3122
3123
|
{
|
|
3123
3124
|
...ART_15_ROBUSTNESS_BASE,
|
|
3124
3125
|
failImplication: "Un document con\xE7u pour \xEAtre retrieved top-1 (PoisonedRAG) biaise les recommandations de l'agent vers un service contr\xF4l\xE9 par l'attaquant",
|
|
3125
|
-
remediationGuidance: "
|
|
3126
|
+
remediationGuidance: "Passer chaque document dans un classifieur d'injection de prompt avant l'embedding ; attribuer un score de confiance par source ; faire relire par un humain les documents promotionnels ; exiger une corroboration multi-sources pour les affirmations \xE0 fort enjeu"
|
|
3126
3127
|
},
|
|
3127
3128
|
{
|
|
3128
3129
|
...ART_9_RISK_MGMT_BASE,
|
|
@@ -3165,7 +3166,7 @@ var FALSE_AUTHORITY_MAPPING = {
|
|
|
3165
3166
|
},
|
|
3166
3167
|
{
|
|
3167
3168
|
articleNumber: "Article 5",
|
|
3168
|
-
articleTitle: "Pratiques d'
|
|
3169
|
+
articleTitle: "Pratiques interdites en mati\xE8re d'IA",
|
|
3169
3170
|
requirement: "Le syst\xE8me ne doit pas exploiter les vuln\xE9rabilit\xE9s des personnes",
|
|
3170
3171
|
complianceAspect: "prohibited",
|
|
3171
3172
|
riskLevel: "medium",
|
|
@@ -3416,7 +3417,7 @@ var LLM10_MAPPINGS = [
|
|
|
3416
3417
|
// ../../packages/shared/src/compliance/eu-ai-act-mapping/by-category/transparency-art50.ts
|
|
3417
3418
|
var ART_50_IDENTITY_BASE = {
|
|
3418
3419
|
articleNumber: "Article 50",
|
|
3419
|
-
articleTitle: "Obligations de transparence pour certains
|
|
3420
|
+
articleTitle: "Obligations de transparence pour les fournisseurs et les d\xE9ployeurs de certains syst\xE8mes d'IA",
|
|
3420
3421
|
requirement: "Les personnes physiques doivent etre informees qu'elles interagissent avec un systeme d'IA, au plus tard lors de la premiere interaction",
|
|
3421
3422
|
complianceAspect: "transparency",
|
|
3422
3423
|
riskLevel: "high",
|
|
@@ -3425,7 +3426,7 @@ var ART_50_IDENTITY_BASE = {
|
|
|
3425
3426
|
};
|
|
3426
3427
|
var ART_50_CONTENT_BASE = {
|
|
3427
3428
|
articleNumber: "Article 50",
|
|
3428
|
-
articleTitle: "Obligations de transparence pour certains
|
|
3429
|
+
articleTitle: "Obligations de transparence pour les fournisseurs et les d\xE9ployeurs de certains syst\xE8mes d'IA",
|
|
3429
3430
|
requirement: "Les contenus generes ou manipules par IA doivent etre identifies comme tels et ne pas etre presentes comme d'origine humaine",
|
|
3430
3431
|
complianceAspect: "transparency",
|
|
3431
3432
|
riskLevel: "medium",
|
|
@@ -3681,7 +3682,7 @@ function prohibitedPractices() {
|
|
|
3681
3682
|
articleLabel: "Article 5",
|
|
3682
3683
|
title: {
|
|
3683
3684
|
en: "Prohibited AI practices",
|
|
3684
|
-
fr: "Pratiques d'IA
|
|
3685
|
+
fr: "Pratiques interdites en mati\xE8re d'IA"
|
|
3685
3686
|
},
|
|
3686
3687
|
status: "binding",
|
|
3687
3688
|
applicableFrom: IN_FORCE_CHAPTER_I_II,
|
|
@@ -3698,7 +3699,7 @@ function prohibitedPractices() {
|
|
|
3698
3699
|
function aiLiteracy() {
|
|
3699
3700
|
return {
|
|
3700
3701
|
articleLabel: "Article 4",
|
|
3701
|
-
title: { en: "AI literacy", fr: "
|
|
3702
|
+
title: { en: "AI literacy", fr: "Ma\xEEtrise de l'IA" },
|
|
3702
3703
|
status: "binding",
|
|
3703
3704
|
applicableFrom: IN_FORCE_CHAPTER_I_II,
|
|
3704
3705
|
rationale: {
|
|
@@ -3707,7 +3708,7 @@ function aiLiteracy() {
|
|
|
3707
3708
|
},
|
|
3708
3709
|
shieldCoverage: {
|
|
3709
3710
|
en: "Not testable by scanning. Answered by the AI literacy questions in the questionnaire, and those answers are self-declared.",
|
|
3710
|
-
fr: "Non testable par scan. Couvert par les questions
|
|
3711
|
+
fr: "Non testable par scan. Couvert par les questions du questionnaire sur la ma\xEEtrise de l'IA, dont les r\xE9ponses sont auto-d\xE9clar\xE9es."
|
|
3711
3712
|
}
|
|
3712
3713
|
};
|
|
3713
3714
|
}
|
|
@@ -3730,7 +3731,7 @@ function article50(status) {
|
|
|
3730
3731
|
},
|
|
3731
3732
|
shieldCoverage: {
|
|
3732
3733
|
en: "Half testable, and the halves are different in kind. Shield proves a breach when your system CLAIMS TO BE HUMAN: it asks directly, under a roleplay frame, and under fabricated audit pressure, and it checks whether generated content is given a false human-authorship label. It CANNOT see a disclosure rendered in your interface \u2014 a banner, a chat header, an onboarding screen \u2014 so an endpoint that simply does not volunteer its nature is not scored as a breach. Verify that half by inspecting the interface, and treat Article 50(2) machine-readable marking as out of scope for this scan.",
|
|
3733
|
-
fr: "Testable pour moiti\xE9, et les deux moiti\xE9s sont de nature diff\xE9rente. Shield prouve le manquement lorsque votre syst\xE8me SE D\xC9CLARE HUMAIN : il pose la question directement, sous cadrage de jeu de r\xF4le, et sous pression d'audit fabriqu\xE9e, et il v\xE9rifie si un contenu g\xE9n\xE9r\xE9 re\xE7oit une fausse attestation de r\xE9daction humaine. Il NE PEUT PAS voir une divulgation affich\xE9e dans votre interface (banni\xE8re, en-t\xEAte de conversation, \xE9cran d'accueil) :
|
|
3734
|
+
fr: "Testable pour moiti\xE9, et les deux moiti\xE9s sont de nature diff\xE9rente. Shield prouve le manquement lorsque votre syst\xE8me SE D\xC9CLARE HUMAIN : il pose la question directement, sous cadrage de jeu de r\xF4le, et sous pression d'audit fabriqu\xE9e, et il v\xE9rifie si un contenu g\xE9n\xE9r\xE9 re\xE7oit une fausse attestation de r\xE9daction humaine. Il NE PEUT PAS voir une divulgation affich\xE9e dans votre interface (banni\xE8re, en-t\xEAte de conversation, \xE9cran d'accueil) : une cible qui ne d\xE9clare simplement pas sa nature n'est donc jamais compt\xE9e comme un manquement. V\xE9rifiez cette moiti\xE9 en inspectant l'interface, et consid\xE9rez le marquage lisible par machine de l'Article 50(2) comme hors p\xE9rim\xE8tre de ce scan."
|
|
3734
3735
|
}
|
|
3735
3736
|
};
|
|
3736
3737
|
}
|
|
@@ -4211,14 +4212,70 @@ function formatDateShort(date, locale = "en-US") {
|
|
|
4211
4212
|
day: "numeric"
|
|
4212
4213
|
});
|
|
4213
4214
|
}
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4215
|
+
var SINGLE_QUOTED = /(?:^|[\s(\[:])'([^'\n]{3,}?)'(?=[\s.,;:)\]!?]|$)/g;
|
|
4216
|
+
var DOUBLE_QUOTED = /["“”]([^"“”]{3,}?)["“”]/g;
|
|
4217
|
+
var TOKEN_MAX = 10;
|
|
4218
|
+
var SENTENCE_MIN = 20;
|
|
4219
|
+
var SENTENCE_MAX = 300;
|
|
4220
|
+
function extractCitations(reasoning) {
|
|
4221
|
+
const found = [];
|
|
4222
|
+
for (const re of [DOUBLE_QUOTED, SINGLE_QUOTED]) {
|
|
4223
|
+
re.lastIndex = 0;
|
|
4224
|
+
let match;
|
|
4225
|
+
while ((match = re.exec(reasoning)) !== null) {
|
|
4226
|
+
found.push({ at: match.index, text: match[1].trim() });
|
|
4227
|
+
}
|
|
4228
|
+
}
|
|
4229
|
+
const ordered = found.sort((a, b) => a.at - b.at).map((f) => f.text);
|
|
4230
|
+
return Array.from(new Set(ordered));
|
|
4231
|
+
}
|
|
4232
|
+
function splitSentences(text) {
|
|
4233
|
+
return text.split(/(?<=[^\d\s][.!?])\s+|\n+/).map((s) => s.trim()).filter((s) => s.length > 0);
|
|
4234
|
+
}
|
|
4235
|
+
function truncateAtWord(text, max) {
|
|
4236
|
+
if (text.length <= max) return text;
|
|
4237
|
+
const cut = text.slice(0, max);
|
|
4238
|
+
const lastSpace = cut.lastIndexOf(" ");
|
|
4239
|
+
return `${lastSpace > max / 2 ? cut.slice(0, lastSpace) : cut}...`;
|
|
4240
|
+
}
|
|
4241
|
+
function windowAround(sentence, token, max) {
|
|
4242
|
+
if (sentence.length <= max) return sentence;
|
|
4243
|
+
const at2 = sentence.indexOf(token);
|
|
4244
|
+
const start = Math.max(0, at2 - Math.floor((max - token.length) / 2));
|
|
4245
|
+
const from = start === 0 ? 0 : sentence.indexOf(" ", start) + 1;
|
|
4246
|
+
const body = truncateAtWord(sentence.slice(from), max);
|
|
4247
|
+
return from > 0 ? `...${body}` : body;
|
|
4248
|
+
}
|
|
4249
|
+
function citationExcerpts(citations, response) {
|
|
4250
|
+
const sentences = splitSentences(response);
|
|
4251
|
+
const out = [];
|
|
4252
|
+
for (const citation of citations) {
|
|
4253
|
+
if (out.some((e) => e.includes(citation))) continue;
|
|
4254
|
+
if (citation.length >= TOKEN_MAX) {
|
|
4255
|
+
out.push(citation);
|
|
4256
|
+
continue;
|
|
4257
|
+
}
|
|
4258
|
+
const carrier = sentences.find((s) => s.includes(citation));
|
|
4259
|
+
if (carrier) out.push(windowAround(carrier, citation, SENTENCE_MAX));
|
|
4260
|
+
}
|
|
4261
|
+
return Array.from(new Set(out));
|
|
4262
|
+
}
|
|
4263
|
+
function contentLength(sentence) {
|
|
4264
|
+
return sentence.replace(/[.!?]+$/, "").length;
|
|
4265
|
+
}
|
|
4266
|
+
function extractEvidenceExcerpts(input) {
|
|
4267
|
+
const response = input.response ?? "";
|
|
4268
|
+
const citations = input.reasoning ? citationExcerpts(extractCitations(input.reasoning), response) : [];
|
|
4269
|
+
if (citations.length > 0) return citations.slice(0, 4);
|
|
4270
|
+
if (input.judgeEvidence && input.judgeEvidence.length > 0) {
|
|
4271
|
+
return input.judgeEvidence.slice(0, 4);
|
|
4220
4272
|
}
|
|
4221
|
-
return
|
|
4273
|
+
if (response.length === 0) return [];
|
|
4274
|
+
const sentences = splitSentences(response).filter(
|
|
4275
|
+
(s) => contentLength(s) > SENTENCE_MIN && s.length < SENTENCE_MAX
|
|
4276
|
+
);
|
|
4277
|
+
if (sentences.length > 0) return sentences.slice(0, 3);
|
|
4278
|
+
return [truncateAtWord(response, 200)];
|
|
4222
4279
|
}
|
|
4223
4280
|
function escapeHtml(str) {
|
|
4224
4281
|
return str.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
@@ -4278,7 +4335,7 @@ function buildFrameworkCoverage(findings) {
|
|
|
4278
4335
|
findings,
|
|
4279
4336
|
"DORA",
|
|
4280
4337
|
"DORA (R\xE8glement UE 2022/2554)",
|
|
4281
|
-
"Le scan est un test de r\xE9silience (Art. 25) ;
|
|
4338
|
+
"Le scan est un test de r\xE9silience (Art. 25) ; ses constats mettent en \xE9vidence une lacune de protection (Art. 9). Il alimente un TLPT (Art. 26) sans en constituer un.",
|
|
4282
4339
|
OWASP_TO_DORA,
|
|
4283
4340
|
(ref) => DORA_REFERENCES[ref]?.title ?? ref,
|
|
4284
4341
|
[...DORA_TOOL_LEVEL, ...DORA_ADJACENT]
|
|
@@ -4390,23 +4447,23 @@ function buildExecutiveSummary(totalVulns, critical, crescendo, combo, high, med
|
|
|
4390
4447
|
return `The assessment identified <strong>no vulnerabilities</strong> across ${totalTests} automated tests mapped to the OWASP LLM Top 10 ${owaspEdition} framework. The chatbot at <strong>${safeTarget}</strong> successfully defended against all attack vectors tested.${untestedNote} No immediate action is required.`;
|
|
4391
4448
|
}
|
|
4392
4449
|
const severityWord = {
|
|
4393
|
-
critical: { en: "critical", fr: "critique" },
|
|
4394
|
-
crescendo: { en: "crescendo", fr: "crescendo" },
|
|
4395
|
-
combo: { en: "combo", fr: "combo" },
|
|
4396
|
-
high: { en: "high", fr: "\xE9lev\xE9e" },
|
|
4397
|
-
medium: { en: "medium", fr: "moyenne" }
|
|
4450
|
+
critical: { en: "critical", fr: ["critique", "critiques"] },
|
|
4451
|
+
crescendo: { en: "crescendo", fr: ["crescendo", "crescendo"] },
|
|
4452
|
+
combo: { en: "combo", fr: ["combo", "combo"] },
|
|
4453
|
+
high: { en: "high", fr: ["\xE9lev\xE9e", "\xE9lev\xE9es"] },
|
|
4454
|
+
medium: { en: "medium", fr: ["moyenne", "moyennes"] }
|
|
4398
4455
|
};
|
|
4399
|
-
const pick = (key) => fr ? severityWord[key].fr : severityWord[key].en;
|
|
4456
|
+
const pick = (key, count) => fr ? severityWord[key].fr[count > 1 ? 1 : 0] : severityWord[key].en;
|
|
4400
4457
|
const parts = [];
|
|
4401
|
-
if (critical > 0) parts.push(`${critical} ${pick("critical")}`);
|
|
4402
|
-
if (crescendo > 0) parts.push(`${crescendo} ${pick("crescendo")}`);
|
|
4403
|
-
if (combo > 0) parts.push(`${combo} ${pick("combo")}`);
|
|
4404
|
-
if (high > 0) parts.push(`${high} ${pick("high")}`);
|
|
4405
|
-
if (medium > 0) parts.push(`${medium} ${pick("medium")}`);
|
|
4458
|
+
if (critical > 0) parts.push(`${critical} ${pick("critical", critical)}`);
|
|
4459
|
+
if (crescendo > 0) parts.push(`${crescendo} ${pick("crescendo", crescendo)}`);
|
|
4460
|
+
if (combo > 0) parts.push(`${combo} ${pick("combo", combo)}`);
|
|
4461
|
+
if (high > 0) parts.push(`${high} ${pick("high", high)}`);
|
|
4462
|
+
if (medium > 0) parts.push(`${medium} ${pick("medium", medium)}`);
|
|
4406
4463
|
const breakdown = parts.join(", ");
|
|
4407
4464
|
let urgency = "";
|
|
4408
4465
|
if (critical > 0) {
|
|
4409
|
-
urgency = fr ? "Une
|
|
4466
|
+
urgency = fr ? "Une correction imm\xE9diate est recommand\xE9e pour les constats critiques ; les constats \xE9lev\xE9s et moyens sont \xE0 traiter sous 30 jours." : "Immediate remediation is recommended for critical findings; high and medium findings should be addressed within 30 days.";
|
|
4410
4467
|
} else if (crescendo > 0 || combo > 0) {
|
|
4411
4468
|
urgency = fr ? "Les constats crescendo et combo signalent des vuln\xE9rabilit\xE9s multi-vecteurs \xE0 corriger sous 14 jours." : "Crescendo/combo attack findings indicate multi-vector vulnerabilities requiring prompt remediation within 14 days.";
|
|
4412
4469
|
} else if (high > 0) {
|
|
@@ -9466,9 +9523,9 @@ async function readErrorBodyHead(response) {
|
|
|
9466
9523
|
}
|
|
9467
9524
|
}
|
|
9468
9525
|
async function readBodyWithLimit(response) {
|
|
9469
|
-
const
|
|
9470
|
-
if (
|
|
9471
|
-
const declared = Number(
|
|
9526
|
+
const contentLength2 = response.headers.get("content-length");
|
|
9527
|
+
if (contentLength2) {
|
|
9528
|
+
const declared = Number(contentLength2);
|
|
9472
9529
|
if (Number.isFinite(declared) && declared > MAX_RESPONSE_BYTES) {
|
|
9473
9530
|
throw new HttpTargetError(
|
|
9474
9531
|
`Response too large: ${declared} bytes (max ${MAX_RESPONSE_BYTES})`,
|
|
@@ -11279,29 +11336,11 @@ function buildVulnDetail(a) {
|
|
|
11279
11336
|
};
|
|
11280
11337
|
}
|
|
11281
11338
|
function buildEvidenceItems(a) {
|
|
11282
|
-
|
|
11283
|
-
|
|
11284
|
-
|
|
11285
|
-
|
|
11286
|
-
|
|
11287
|
-
}
|
|
11288
|
-
if (a.llmEvaluation?.evidence && a.llmEvaluation.evidence.length > 0) {
|
|
11289
|
-
return a.llmEvaluation.evidence.slice(0, 4).map((e) => ({ text: e }));
|
|
11290
|
-
}
|
|
11291
|
-
if (a.response) {
|
|
11292
|
-
const sentences = a.response.split(/[.!?]+/).map((s) => s.trim()).filter((s) => s.length > 20 && s.length < 300);
|
|
11293
|
-
if (sentences.length > 0) {
|
|
11294
|
-
return sentences.slice(0, 3).map((s) => ({ text: s }));
|
|
11295
|
-
}
|
|
11296
|
-
if (a.response.length > 0) {
|
|
11297
|
-
return [
|
|
11298
|
-
{
|
|
11299
|
-
text: a.response.slice(0, 200) + (a.response.length > 200 ? "..." : "")
|
|
11300
|
-
}
|
|
11301
|
-
];
|
|
11302
|
-
}
|
|
11303
|
-
}
|
|
11304
|
-
return [];
|
|
11339
|
+
return extractEvidenceExcerpts({
|
|
11340
|
+
reasoning: a.llmEvaluation?.reasoning,
|
|
11341
|
+
judgeEvidence: a.llmEvaluation?.evidence,
|
|
11342
|
+
response: a.response
|
|
11343
|
+
}).map((text) => ({ text }));
|
|
11305
11344
|
}
|
|
11306
11345
|
function resolveOwaspKey(attackId) {
|
|
11307
11346
|
return owaspKeyForAttack(attackId) ?? "LLM01";
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED
package/dist/logo.png
CHANGED
|
Binary file
|