fix(anatomy): R5.4 field segments and code spans on the generator alphabet, wiki and liquid brackets refused in list items, linear guard
This commit is contained in:
1 parent
1b12d90325
commit
aeb5050502
10 files changed
+325
-48
No files matched your search
@@ -467,6 +467,23 @@ fn ids_and_field_segments_that_could_forge_report_structure_are_refused() {
|
||||
apply_changeset(&frozen["baseline"], &references, &changeset.changes).unwrap_err();
|
||||
assert!(error.to_string().starts_with("CHG-001 op 0:"), "{error}");
|
||||
}
|
||||
// A segment outside the paths' alphabet: a `]` in a code span closed an author's `[`
|
||||
// (security gate R5.4 round 5).
|
||||
for field in ["name.x]", "name.a b", "name.x*", "name.é"] {
|
||||
let file = serde_json::json!({ "changes": [{
|
||||
"id": "CHG-001", "level": "A", "kind": "technical",
|
||||
"title": { "fr": "Essai [", "en": "Test" }, "rationale": "Essai", "reference_ids": [],
|
||||
"ops": [{ "op": "set", "target": "finding:hip/hip-dysfunctions/mobility",
|
||||
"field": field, "value": "a" }],
|
||||
}]});
|
||||
let changeset = parse_changeset(&to_js_compact(&file).unwrap()).unwrap();
|
||||
let error =
|
||||
apply_changeset(&frozen["baseline"], &references, &changeset.changes).unwrap_err();
|
||||
assert!(
|
||||
error.to_string().contains("segment outside [A-Za-z0-9_-]"),
|
||||
"{field}: {error}"
|
||||
);
|
||||
}
|
||||
let deep = format!(
|
||||
"<svg xmlns=\"http://www.w3.org/2000/svg\">{}{}</svg>",
|
||||
"<g>".repeat(100_000),
|
||||
|
||||
Reference in new issue
Block a user