fix(anatomy): V1-2.2 review findings, PIs and HTML refused, bounds
Security audit (PASS, 2 MEDIUM, 2 LOW) and verifier (ECARTS 6) on
741c25c: processing instructions and HTML fetchers refused, active
content under a long title classified, linear review groups, full
fixpoint check, bounded preview drawings, missing cap fixtures and
property checks, record wordings.
This commit is contained in:
1 parent
741c25c464
commit
8294d5471c
15 files changed
+448
-72
No files matched your search
@@ -348,3 +348,46 @@ fn no_report_operation_runs_on_a_preview() {
|
||||
let state = canvas(call_with_preview(&preview, "preview.state", "{}"));
|
||||
assert_eq!(state["value"]["status"], json!("published"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn a_preview_holds_a_bounded_number_of_bounded_drawings() {
|
||||
use faunosteo_core::domain::sheet::preview::MAX_HELD_DRAWINGS;
|
||||
let huge = vec![b' '; 2 * 1024 * 1024 + 1];
|
||||
let sha = faunosteo_core::domain::sheet::verdict::sha256_hex(&huge);
|
||||
let oversized = PreviewDrawing {
|
||||
asset_id: "a".into(),
|
||||
sha256: sha,
|
||||
bytes: huge,
|
||||
};
|
||||
let failure = load_err(
|
||||
input(PreviewStatus::Draft, document_text(), None),
|
||||
vec![oversized],
|
||||
);
|
||||
assert_eq!(
|
||||
(failure.kind(), failure.detail()),
|
||||
("caps", "drawing_bytes".to_owned())
|
||||
);
|
||||
let mut draft = PreviewSheet::load(
|
||||
input(PreviewStatus::Draft, document_text(), None),
|
||||
vec![horse_drawing()],
|
||||
)
|
||||
.unwrap();
|
||||
for i in 1..MAX_HELD_DRAWINGS {
|
||||
let added = PreviewDrawing {
|
||||
asset_id: format!("extra-{i}"),
|
||||
..horse_drawing()
|
||||
};
|
||||
draft.add_drawing(added).unwrap();
|
||||
}
|
||||
let one_more = PreviewDrawing {
|
||||
asset_id: "one-more".into(),
|
||||
..horse_drawing()
|
||||
};
|
||||
assert_eq!(
|
||||
draft.add_drawing(one_more),
|
||||
Err(PreviewFailure::Caps(vec![
|
||||
faunosteo_core::domain::sheet::caps::CapName::Drawings
|
||||
]))
|
||||
);
|
||||
assert_eq!(draft.drawing_reads(), 1, "the same bytes are read once");
|
||||
}
|
||||
Reference in new issue
Block a user