From 88aaf052ef66ce0e19b6e8b71d5a96b6d89ba279 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 07:14:34 +0900 Subject: [PATCH 01/21] =?UTF-8?q?chore:=20=EC=9D=98=EC=A1=B4=EC=84=B1=20?= =?UTF-8?q?=EC=B5=9C=EC=8B=A0=ED=99=94=EC=99=80=20=EA=B2=B0=EA=B3=BC=20?= =?UTF-8?q?=EA=B2=B0=EC=A0=95=EC=84=B1=C2=B7=EB=A9=94=EB=AA=A8=EB=A6=AC=20?= =?UTF-8?q?=EA=B0=9C=EC=84=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - scraper 0.24→0.29, imagesize 0.14→0.15, lockfile 갱신, setup-rust-toolchain v2 - CI: 매주 최신 호환 의존성으로 테스트하는 latest-deps 작업 추가 - dependabot: actions 와 cargo 호환 업데이트를 PR 하나로 묶음 - CSS·JS·이미지 표본을 URL 정렬 순서로 골라, 순서를 바꿔 내려주는 사이트에서도 같은 결과 - JS 무게는 본문을 보관하지 않고 크기만 셈 - 사이트 파일 bytes 가 잘린 길이가 아닌 실제 크기를 기록하고 truncated 표시 Co-Authored-By: Claude Opus 5.5 --- .github/dependabot.yml | 7 + .github/workflows/CI.yml | 29 +++- Cargo.lock | 172 +++++++--------------- crates/devup-access-checker/Cargo.toml | 4 +- crates/devup-access-checker/src/checks.rs | 3 +- crates/devup-access-checker/src/fetch.rs | 85 +++++++---- crates/devup-access-checker/src/lib.rs | 57 ++++--- 7 files changed, 182 insertions(+), 175 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 6b06d82..09fa59e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -11,6 +11,9 @@ updates: open-pull-requests-limit: 5 ignore: - dependency-name: "changepacks/action" + groups: + actions: + patterns: ["*"] - package-ecosystem: "cargo" directory: "/" schedule: @@ -19,3 +22,7 @@ updates: time: "06:00" timezone: "Asia/Seoul" open-pull-requests-limit: 5 + # 호환(minor·patch) 업데이트는 한 PR 로 묶고, 호환이 깨지는 메이저 업데이트는 따로 연다 + groups: + cargo-compatible: + update-types: ["minor", "patch"] diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 8b13c9d..3687d90 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -11,6 +11,9 @@ on: - "**/.gitignore" pull_request: workflow_dispatch: + # 매주 최신 의존성으로 빌드·테스트한다 (라이브러리 사용자는 lockfile 없이 최신 호환 버전을 받는다) + schedule: + - cron: "0 21 * * 0" # 월요일 06:00 KST concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -22,7 +25,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 with: components: rustfmt - name: Check formatting @@ -33,7 +36,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 with: components: clippy - name: Lint @@ -48,17 +51,28 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 # 테스트는 로컬 mock 서버(wiremock)만 사용하며 외부 네트워크에 의존하지 않는다. - name: Test run: cargo test --workspace --all-features + latest-deps: + name: test (latest deps) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions-rust-lang/setup-rust-toolchain@v2 + - name: Update lockfile to latest compatible versions + run: cargo update --verbose + - name: Test + run: cargo test --workspace --all-features + msrv: name: msrv (1.88) runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 with: toolchain: "1.88" - name: Check @@ -70,7 +84,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 - name: Build docs run: cargo doc --workspace --no-deps env: @@ -81,13 +95,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 - name: Dry-run publish run: cargo publish --workspace --dry-run # main 에 changepack 로그가 들어오면 버전을 올리고 crates.io 에 배포한 뒤 GitHub Release 를 만든다. changepacks: name: changepacks + if: github.event_name != 'schedule' runs-on: ubuntu-latest needs: - fmt @@ -148,7 +163,7 @@ jobs: archive: zip steps: - uses: actions/checkout@v7 - - uses: actions-rust-lang/setup-rust-toolchain@v1 + - uses: actions-rust-lang/setup-rust-toolchain@v2 with: target: ${{ matrix.target }} diff --git a/Cargo.lock b/Cargo.lock index 06643e0..e6e8bd8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,12 +223,6 @@ version = "3.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87a0cf66fd1eb2fb7b822cb78370d82303750809bc6ba855f3f58e517d3238db" -[[package]] -name = "byteorder" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" - [[package]] name = "bytes" version = "1.12.2" @@ -267,7 +261,7 @@ checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures", - "rand_core 0.10.1", + "rand_core", ] [[package]] @@ -395,9 +389,9 @@ dependencies = [ [[package]] name = "cssparser" -version = "0.35.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e901edd733a1472f944a45116df3f846f54d37e67e68640ac8bb69689aca2aa" +checksum = "11119743ad110e8c1bdccd930d7f5c30c99e5fc76a7b63ec9807e84eef0c5f59" dependencies = [ "cssparser-macros", "dtoa-short", @@ -408,12 +402,12 @@ dependencies = [ [[package]] name = "cssparser-macros" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" dependencies = [ "quote", - "syn 2.0.119", + "syn 3.0.10", ] [[package]] @@ -545,9 +539,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "ego-tree" -version = "0.10.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2972feb8dffe7bc8c5463b1dacda1b0dfbed3710e50f977d965429692d74cd8" +checksum = "7bd50d24b1b75aa817bb0339cb9f2e0e664bdfab1e160a69a0fda9145b77fab2" [[package]] name = "encoding_rs" @@ -569,6 +563,12 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826" +[[package]] +name = "fastrand" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223" + [[package]] name = "find-msvc-tools" version = "0.1.15" @@ -607,16 +607,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" -[[package]] -name = "futf" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df420e2e84819663797d1ec6544b13c5be84629e7bb00dc960d6917db2987843" -dependencies = [ - "mac", - "new_debug_unreachable", -] - [[package]] name = "futures" version = "0.3.34" @@ -705,15 +695,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "getopts" version = "0.2.24" @@ -746,7 +727,7 @@ dependencies = [ "js-sys", "libc", "r-efi", - "rand_core 0.10.1", + "rand_core", "wasm-bindgen", ] @@ -789,13 +770,13 @@ checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" [[package]] name = "html5ever" -version = "0.35.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55d958c2f74b664487a2035fe1dadb032c48718a03b63f3ab0b8537db8549ed4" +checksum = "456a1a377e608e555d22ddab27ac0114bc7a7b4199078108e34c2aeae6c9b130" dependencies = [ "log", "markup5ever", - "match_token", + "memchr", ] [[package]] @@ -1010,9 +991,9 @@ dependencies = [ [[package]] name = "imagesize" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e54e57b4c48b40f7aec75635392b12b3421fa26fe8b4332e63138ed278459c" +checksum = "65b27460c2c92b037f3f94c538ed9a3342f3fdf923606781629ccb35f82d042a" [[package]] name = "indexmap" @@ -1151,34 +1132,17 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4050469837a6ff301cd14c1f8f24f88549e6d548f24f64e2148eb0f72cebc51f" -[[package]] -name = "mac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c41e0c4fef86961ac6d6f8a82609f55f31b05e4fce149ac5710e439df7619ba4" - [[package]] name = "markup5ever" -version = "0.35.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311fe69c934650f8f19652b3946075f0fc41ad8757dbb68f1ca14e7900ecc1c3" +checksum = "0ab3dc68ac4a0f5719e560136778c1ee716e296030d75dbd4484e37e39e3a842" dependencies = [ "log", "tendril", "web_atoms", ] -[[package]] -name = "match_token" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac84fd3f360fcc43dc5f5d186f02a94192761a080e8bc58621ad4d12296a58cf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "memchr" version = "2.8.3" @@ -1342,19 +1306,20 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "phf" -version = "0.11.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" +checksum = "010378780309880b08997fae13be7834dba947d36393bd372f2b1556deb2a2f6" dependencies = [ "phf_macros", "phf_shared", + "serde", ] [[package]] name = "phf_codegen" -version = "0.11.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" +checksum = "41b585a510fb76fdebead6897982ef2a03a21d8e6cbcca904999742a4afc6ffe" dependencies = [ "phf_generator", "phf_shared", @@ -1362,19 +1327,19 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" +checksum = "aeb62e0959d5a1bebc965f4d15d9e2b7cea002b6b0f5ba8cde6cc26738467100" dependencies = [ + "fastrand", "phf_shared", - "rand 0.8.8", ] [[package]] name = "phf_macros" -version = "0.11.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84ac04429c13a7ff43785d75ad27569f2951ce0ffd30a3321230db2fc727216" +checksum = "5fa8d0ca26d424d27630da600c6624696e7dec8bf7b3b492b383c5dc49e5e085" dependencies = [ "phf_generator", "phf_shared", @@ -1385,18 +1350,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +checksum = "c6fd9027e2d9319be6349febd1db4e8d02aa544921200c9b777720ac34a3aa89" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" +checksum = "c938015719552d665fd0553b90d96cd7ff58e83e4c061ca99e6bb78865a72752" [[package]] name = "pkg-config" @@ -1464,7 +1429,7 @@ dependencies = [ "bytes", "getrandom 0.4.3", "lru-slab", - "rand 0.10.4", + "rand", "rand_pcg", "ring", "rustc-hash", @@ -1506,15 +1471,6 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" -[[package]] -name = "rand" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" -dependencies = [ - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.10.4" @@ -1523,15 +1479,9 @@ checksum = "8f6fa277c67e6ea590466f04c3fe82cb509f0864fe470643e5570de9514a9b11" dependencies = [ "chacha20", "getrandom 0.4.3", - "rand_core 0.10.1", + "rand_core", ] -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" - [[package]] name = "rand_core" version = "0.10.1" @@ -1544,7 +1494,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb95882a1e14462c69aea9984bb261293ccfe6022ef8de0eda18bd5afb0052df" dependencies = [ - "rand_core 0.10.1", + "rand_core", ] [[package]] @@ -1768,9 +1718,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scraper" -version = "0.24.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f3a24d916e78954af99281a455168d4a9515d65eca99a18da1b813689c4ad9" +checksum = "6844b5f49a5579f12ba4f89d9f7eec6d71889e4aa0bc7181821040ce66f08fff" dependencies = [ "cssparser", "ego-tree", @@ -1778,7 +1728,6 @@ dependencies = [ "html5ever", "precomputed-hash", "selectors", - "tendril", ] [[package]] @@ -1806,19 +1755,17 @@ dependencies = [ [[package]] name = "selectors" -version = "0.31.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5685b6ae43bfcf7d2e7dfcfb5d8e8f61b46442c902531e41a32a9a8bf0ee0fb6" +checksum = "8322aebea94a6cc288ff884e8a49bdbceef60206c400c6c46d22e62fc4fd91a6" dependencies = [ "bitflags", "cssparser", "derive_more", - "fxhash", "log", "new_debug_unreachable", - "phf", - "phf_codegen", "precomputed-hash", + "rustc-hash", "servo_arc", "smallvec", ] @@ -1874,9 +1821,9 @@ dependencies = [ [[package]] name = "servo_arc" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +checksum = "b4eceb519ec34d8290aaf6e46f435102f2bfa63f22b05a144fb16ab266d3b198" dependencies = [ "stable_deref_trait", ] @@ -1945,22 +1892,21 @@ checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" [[package]] name = "string_cache" -version = "0.8.9" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +checksum = "ffa8a5dbe8b3f0bbe29d4c3225daafaeead63afdc1b65fc4c01a1384166038e6" dependencies = [ "new_debug_unreachable", "parking_lot", "phf_shared", "precomputed-hash", - "serde", ] [[package]] name = "string_cache_codegen" -version = "0.5.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c711928715f1fe0fe509c53b43e993a9a557babc2d0a3567d0a3006f1ac931a0" +checksum = "928dcdf75e47626b3617a976ec205d9f057584c371c1f23b782129268d0e6edc" dependencies = [ "phf_generator", "phf_shared", @@ -2035,13 +1981,11 @@ dependencies = [ [[package]] name = "tendril" -version = "0.4.3" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24a120c5fc464a3458240ee02c299ebcb9d67b5249c8848b09d639dca8d7bb0" +checksum = "5fed54709c5b3a53d09bb1c113ea4f5ceafd1e772ddcb0030a82e1d56c087b08" dependencies = [ - "futf", - "mac", - "utf-8", + "new_debug_unreachable", ] [[package]] @@ -2265,12 +2209,6 @@ dependencies = [ "serde", ] -[[package]] -name = "utf-8" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" - [[package]] name = "utf8_iter" version = "1.1.0" @@ -2394,9 +2332,9 @@ dependencies = [ [[package]] name = "web_atoms" -version = "0.1.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ffde1dc01240bdf9992e3205668b235e59421fd085e8a317ed98da0178d414" +checksum = "7572660c8890448ba236b7376f27e389c6a7e1c70195622faced601f855c0ada" dependencies = [ "phf", "phf_codegen", diff --git a/crates/devup-access-checker/Cargo.toml b/crates/devup-access-checker/Cargo.toml index 3513688..6cec572 100644 --- a/crates/devup-access-checker/Cargo.toml +++ b/crates/devup-access-checker/Cargo.toml @@ -15,8 +15,8 @@ readme = "../../README.md" [dependencies] reqwest = { version = "0.13", default-features = false, features = ["rustls", "http2", "charset", "gzip", "brotli"] } x509-parser = "0.18" -imagesize = "0.14" -scraper = "0.24" +imagesize = "0.15" +scraper = "0.29" regex = "1" url = "2" serde.workspace = true diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index 6f59af6..16e827c 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -321,7 +321,8 @@ fn file_value(p: &FileProbe) -> Value { "redirected": p.redirected, "contentType": p.content_type, "formatValid": p.format_valid, - "bytes": p.body.as_ref().map(String::len), + "bytes": p.size, + "truncated": p.truncated, }) } diff --git a/crates/devup-access-checker/src/fetch.rs b/crates/devup-access-checker/src/fetch.rs index 60e15fe..397f6df 100644 --- a/crates/devup-access-checker/src/fetch.rs +++ b/crates/devup-access-checker/src/fetch.rs @@ -89,6 +89,8 @@ pub(crate) async fn send_head(client: &Client, url: &str) -> Result, - /// 잘리기 전 본문 바이트 수 + /// 본문 바이트 수 (보관 상한과 무관한 전체 크기, 최대 64MB 까지 셈) pub size: Option, + /// 본문이 상한을 넘어 앞부분만 보관함 + pub truncated: bool, pub error: Option, } @@ -264,17 +268,6 @@ fn looks_like_xml(body: &str) -> bool { .any(|p| lower.starts_with(p)) } -fn truncate(mut s: String, max: usize) -> String { - if s.len() > max { - let mut cut = max; - while !s.is_char_boundary(cut) { - cut -= 1; - } - s.truncate(cut); - } - s -} - pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileProbe { let mut probe = FileProbe { url: url.to_string(), @@ -294,14 +287,41 @@ pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileP .get(reqwest::header::CONTENT_TYPE) .and_then(|v| v.to_str().ok()) .map(str::to_string); - let body = match res.text().await { - Ok(b) => b, - Err(e) => { - probe.status_code = Some(status); - probe.error = Some(describe(&e)); - return probe; - } + let max = if matches!(expected, Expected::Xml) { + MAX_SITEMAP_BODY + } else { + MAX_PROBE_BODY }; + // 상한까지만 보관하고, 그 뒤는 크기만 센다 (COUNT_LIMIT 에서 멈춤). + let headers = res.headers().clone(); + let declared_len = res.content_length(); + let mut res = res; + let mut buf = Vec::new(); + let mut read = 0usize; + loop { + match res.chunk().await { + Ok(Some(chunk)) => { + read += chunk.len(); + if buf.len() <= max { + buf.extend_from_slice(&chunk); + } + if read >= COUNT_LIMIT { + break; + } + } + Ok(None) => break, + Err(e) => { + probe.status_code = Some(status); + probe.error = Some(describe(&e)); + return probe; + } + } + } + if buf.len() > max { + probe.truncated = true; + buf.truncate(max); + } + let body = decode_body(&buf, &headers); if let Some(vendor) = crate::signals::bot_challenge(&body) { probe.status_code = Some(status); probe.final_url = Some(final_url.to_string()); @@ -329,13 +349,8 @@ pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileP probe.exists = (200..400).contains(&status) && !to_root && probe.format_valid; probe.status_code = Some(status); probe.final_url = Some(final_url.to_string()); - probe.size = Some(body.len()); - let max = if matches!(expected, Expected::Xml) { - MAX_SITEMAP_BODY - } else { - MAX_PROBE_BODY - }; - probe.body = Some(truncate(body, max)); + probe.size = Some(declared_len.map_or(read, |n| (n as usize).max(read))); + probe.body = Some(body); probe } @@ -510,6 +525,24 @@ pub async fn fetch_bytes( Ok((status, ct, buf, false)) } +/// 본문을 보관하지 않고 바이트 수만 센다 (`max` 에서 멈춤). 2xx 가 아니면 오류. +pub async fn count_bytes(client: &Client, url: &Url, max: usize) -> Result { + let mut res = send_get(client, url.as_str()) + .await + .map_err(|e| describe(&e))?; + if !res.status().is_success() { + return Err(format!("HTTP {}", res.status().as_u16())); + } + let mut n = 0; + while let Some(chunk) = res.chunk().await.map_err(|e| describe(&e))? { + n += chunk.len(); + if n >= max { + return Ok(max); + } + } + Ok(n) +} + /// sitemap 표본 페이지 요약. #[derive(Debug, Clone)] pub struct SamplePage { diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 0c26a00..567ffc6 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -549,23 +549,22 @@ impl Checker { return None; } let urls = &facts.extra.stylesheet_urls; - let results: Vec> = - stream::iter(urls.iter().take(MAX_CSS_FILES)) - .map(|u| { - let probe = &probe; - async move { - let url = Url::parse(u).map_err(|e| e.to_string())?; - let (status, _, bytes, _) = - fetch::fetch_bytes(probe, &url, 5 * 1024 * 1024).await?; - if !(200..300).contains(&status) { - return Err(format!("HTTP {status}")); - } - Ok(String::from_utf8_lossy(&bytes).into_owned()) + let results: Vec> = stream::iter(sample(urls, MAX_CSS_FILES)) + .map(|u| { + let probe = &probe; + async move { + let url = Url::parse(u).map_err(|e| e.to_string())?; + let (status, _, bytes, _) = + fetch::fetch_bytes(probe, &url, 5 * 1024 * 1024).await?; + if !(200..300).contains(&status) { + return Err(format!("HTTP {status}")); } - }) - .buffer_unordered(8) - .collect() - .await; + Ok(String::from_utf8_lossy(&bytes).into_owned()) + } + }) + .buffer_unordered(8) + .collect() + .await; let mut out = checks::ExternalCss { total: urls.len(), ..Default::default() @@ -587,22 +586,19 @@ impl Checker { return None; } let x = &facts.extra; - let js: Vec = stream::iter(x.script_urls.iter().take(MAX_JS_FILES)) + let js: Vec = stream::iter(sample(&x.script_urls, MAX_JS_FILES)) .map(|u| { let probe = &probe; async move { let url = Url::parse(u).ok()?; - fetch::fetch_bytes(probe, &url, 20 * 1024 * 1024) - .await - .ok() - .map(|(_, _, b, _)| b.len()) + fetch::count_bytes(probe, &url, 20 * 1024 * 1024).await.ok() } }) .buffer_unordered(8) .filter_map(|x| async move { x }) .collect() .await; - let imgs: Vec> = stream::iter(x.image_urls.iter().take(MAX_IMAGES)) + let imgs: Vec> = stream::iter(sample(&x.image_urls, MAX_IMAGES)) .map(|u| { let probe = &probe; async move { @@ -725,6 +721,15 @@ impl Checker { } } +/// 분석할 표본을 고른다. 페이지가 순서를 바꿔 내려줘도 같은 결과가 나오도록 정렬·중복 제거 후 앞에서 `n` 개. +fn sample(urls: &[String], n: usize) -> Vec<&String> { + let mut v: Vec<&String> = urls.iter().collect(); + v.sort(); + v.dedup(); + v.truncate(n); + v +} + /// www 가 붙어 있으면 뗀, 없으면 붙인 루트 URL. IP·localhost·단일 레이블 호스트는 None. /// 표본 URL 선택: sitemap 우선, 부족하면 내부 링크. 같은 호스트, 대상 페이지 제외, 중복 제거. /// 반환: (URL 목록, sitemap 에서 온 수, 내부 링크에서 온 수) @@ -941,4 +946,12 @@ mod tests { assert_eq!(v("http://127.0.0.1:8080/"), None); assert_eq!(v("http://localhost/"), None); } + + #[test] + fn sample_is_order_independent() { + let a: Vec = ["c", "a", "b", "a"].map(String::from).to_vec(); + let b: Vec = ["b", "a", "c"].map(String::from).to_vec(); + assert_eq!(sample(&a, 2), sample(&b, 2)); + assert_eq!(sample(&a, 10).len(), 3); + } } From 51291b400554bff0e1ee2507b34428f60829d82a Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 07:24:29 +0900 Subject: [PATCH 02/21] =?UTF-8?q?fix:=20=EB=A6=AC=EB=B7=B0=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=EC=B0=BE=EC=9D=80=20=ED=8C=90=EC=A0=95=20=EC=98=A4?= =?UTF-8?q?=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - robots.txt 규칙을 경로+쿼리로 판정하고, 비 ASCII 경로는 퍼센트 인코딩해 비교 - 를 따라 디코딩 (EUC-KR 등), 표본·404·대상 확인 본문은 5MB 상한 - 를 기준으로 상대 링크 해석 - robots 가 기본 경로 sitemap 을 선언했는데 없으면 missing, 요청 상한으로 일부만 확인하면 unknown - HTML 판별이 주석·XML 선언·/ 로 시작하는 문서도 잡음 - sitemap index 는 첫 하위 sitemap(.xml.gz 포함)의 페이지를 표본으로 사용 - 표본을 얻지 못하면 이유를 노트로 남기고, 항목명·분류는 항상 카탈로그 기준 - 텍스트 파일은 HTML 응답일 때만 봇 차단으로 판정, 호스트별 제한 맵 정리 Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_accuracy-and-deps.json | 1 + Cargo.lock | 1 + README.md | 1 + crates/devup-access-checker/Cargo.toml | 1 + crates/devup-access-checker/src/checks.rs | 153 +++++++++++--- crates/devup-access-checker/src/extra.rs | 9 +- crates/devup-access-checker/src/fetch.rs | 195 +++++++++++++++--- crates/devup-access-checker/src/html.rs | 41 +++- crates/devup-access-checker/src/lib.rs | 62 ++++-- crates/devup-access-checker/src/robots.rs | 49 ++++- .../devup-access-checker/tests/end_to_end.rs | 63 ++++++ 11 files changed, 497 insertions(+), 79 deletions(-) create mode 100644 .changepacks/changepack_log_accuracy-and-deps.json diff --git a/.changepacks/changepack_log_accuracy-and-deps.json b/.changepacks/changepack_log_accuracy-and-deps.json new file mode 100644 index 0000000..b25f1a7 --- /dev/null +++ b/.changepacks/changepack_log_accuracy-and-deps.json @@ -0,0 +1 @@ +{"changes":{"crates/devup-access-checker/Cargo.toml":"Patch","crates/devup-access-checker-cli/Cargo.toml":"Patch"},"note":"판정 정확도 개선: robots 쿼리·한글 경로, , , gzip 하위 sitemap, HTML 판별, 선언 sitemap 판정. 의존성 최신화","date":"2026-11-20T00:00:00.0000000Z"} \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index e6e8bd8..6d8cc77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -480,6 +480,7 @@ name = "devup-access-checker" version = "0.0.0" dependencies = [ "encoding_rs", + "flate2", "futures", "imagesize", "regex", diff --git a/README.md b/README.md index ae58702..54af169 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,7 @@ if report.get("geo.llms_txt").map(|c| c.presence) == Some(Presence::Missing) { / - **클라이언트 측 리다이렉트:** 지연 5초 이하의 meta refresh와, 본문이 거의 없는 페이지의 `location.href = "..."` · `location.replace("...")`는 검색엔진처럼 따라가서 최종 페이지를 분석합니다(최대 3회). 따라간 기록은 `transport.meta_refresh_redirect` · `transport.js_redirect`에 남습니다. - **차단·오류 페이지:** 대상 페이지가 2xx가 아니거나 봇 차단 페이지(Cloudflare, Akamai, F5, Imperva 등)이면 리포트의 `blocked`에 사유가 들어갑니다. 이때 페이지 HTML·헤더에서 나온 항목은 모두 `unknown`이 됩니다. 실제 페이지를 보지 못했는데 "없음"으로 판정하지 않기 위해서입니다. robots.txt·sitemap 같은 사이트 파일 항목은 그대로 판정합니다. - **부속 요청의 차단:** robots.txt·llms.txt·표본 페이지 등이 봇 차단 페이지로 돌아오면 "없음"이 아니라 `unknown`입니다. AI 크롤러 User-Agent 요청이 차단 페이지를 받으면 `geo.ua_access.*`는 `missing`이고, 값의 `challenge`에 공급자가 남습니다. +- **해석 규칙:** 상대 링크는 ``가 있으면 그것을 기준으로 해석합니다. 문자 인코딩은 BOM → `Content-Type` charset → `` 순으로 정하므로 EUC-KR 페이지도 그대로 읽습니다. robots.txt 규칙은 경로와 쿼리를 함께 보고, 한글 경로는 퍼센트 인코딩해 비교합니다. sitemap index는 첫 하위 sitemap(`.xml.gz` 포함)의 페이지를 표본으로 씁니다. - **요청 예절과 속도:** 같은 호스트에는 동시에 최대 8개 요청만 보내고, 연결 실패는 한 번 재시도합니다(timeout·DNS 실패는 재시도하지 않음). 대상 페이지 본문은 15MB까지만 받습니다. 서로 의존하지 않는 요청은 모두 동시에 보내며, `http://` 확인은 5초 안에 끝냅니다. `DEVUP_ACCESS_CHECKER_TRACE=1` 환경 변수를 주면 요청별 대기·소요 시간을 stderr로 출력합니다. ## Presence diff --git a/crates/devup-access-checker/Cargo.toml b/crates/devup-access-checker/Cargo.toml index 6cec572..7e72d2c 100644 --- a/crates/devup-access-checker/Cargo.toml +++ b/crates/devup-access-checker/Cargo.toml @@ -25,6 +25,7 @@ thiserror = "2" tokio.workspace = true futures = "0.3" encoding_rs = "0.8" +flate2 = "1.1.11" [dev-dependencies] wiremock = "0.6" diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index 16e827c..75eb347 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -97,6 +97,8 @@ pub struct SitemapDetail { pub declared: Vec, /// 샘플 URL 요청 결과 pub samples: Vec, + /// 표본을 얻지 못한 이유 (예: 하위 sitemap 읽기 실패) + pub sample_note: Option, } /// (sitemap 의 URL, 해당 URL 요청 결과) @@ -480,7 +482,7 @@ pub fn build(i: &Inputs) -> Vec { o.opt("meta.html_lang", Meta, "html lang", f.lang.as_deref()); match &f.canonical { Some(href) => { - let abs = base.join(href).ok(); + let abs = f.link_base(base).join(href).ok(); let same = abs.as_ref().is_some_and(|a| { a.as_str().trim_end_matches('/') == base.as_str().trim_end_matches('/') }); @@ -545,6 +547,7 @@ pub fn build(i: &Inputs) -> Vec { "canonical 호스트 불일치", f.canonical.as_deref(), base, + f.link_base(base), ); o.opt( "meta.google_site_verification", @@ -638,6 +641,7 @@ pub fn build(i: &Inputs) -> Vec { "og:url 호스트 불일치", f.meta("og:url"), base, + f.link_base(base), ); for key in ["card", "title", "description", "image"] { o.opt( @@ -1115,7 +1119,8 @@ pub fn build(i: &Inputs) -> Vec { None, ), } - let path = base.path(); + // robots 규칙은 경로 + 쿼리에 대해 판정한다 (RFC 9309) + let path = &base[url::Position::BeforePath..url::Position::AfterQuery]; let allow_check = |o: &mut Out, id: String, cat: Category, label: String, token: &str| { match &robots { Ok(r) => o.push( @@ -1129,28 +1134,74 @@ pub fn build(i: &Inputs) -> Vec { Err(e) => o.push(id, cat, label, Presence::Unknown, None, Some(e.clone())), } }; - let declared = &i.sitemap_detail.declared; + // robots.txt 가 선언한 sitemap 전체를 본다. 기본 경로와 같은 선언은 기본 경로 probe 결과를 쓰고, + // 요청 상한(5개)을 넘어 확인하지 못한 선언은 unchecked 로 남긴다. + let declared_raw: Vec = if i.robots.exists { + let origin = base.join("/").expect("origin"); + let mut v: Vec = Vec::new(); + for raw in Robots::parse(i.robots.body.as_deref().unwrap_or_default()).sitemaps { + if let Ok(u) = origin.join(&raw) + && !v.contains(&u) + { + v.push(u); + } + } + v + } else { + Vec::new() + }; + let entries: Vec<(&Url, Option<&FileProbe>)> = declared_raw + .iter() + .map(|u| { + let probe = if i.sitemap.url == u.as_str() { + Some(i.sitemap) + } else { + i.sitemap_detail + .declared + .iter() + .find(|p| p.url == u.as_str()) + }; + (u, probe) + }) + .collect(); + let checked: Vec<&FileProbe> = entries.iter().filter_map(|(_, p)| *p).collect(); + let unchecked = entries.len() - checked.len(); + let presence = if entries.is_empty() { + Presence::NotApplicable + } else if checked.iter().any(|p| p.error.is_none() && !p.exists) { + Presence::Missing + } else if unchecked > 0 || checked.iter().any(|p| p.error.is_some()) { + Presence::Unknown + } else { + Presence::Present + }; o.push( "crawling.robots_declared_sitemaps", Crawling, "robots.txt 선언 sitemap 접근", - if declared.is_empty() { - Presence::NotApplicable - } else { - Presence::from_bool(declared.iter().all(|p| p.exists)) - }, - (!declared.is_empty()).then(|| { + presence, + (!entries.is_empty()).then(|| { json!( - declared + entries .iter() - .map( - |p| json!({ "url": p.url, "statusCode": p.status_code, "exists": p.exists }) - ) + .map(|(u, p)| match p { + Some(p) => json!({ + "url": u.as_str(), + "statusCode": p.status_code, + "exists": p.exists, + "error": p.error, + }), + None => json!({ "url": u.as_str(), "checked": false }), + }) .collect::>() ) }), - (!declared.is_empty()) - .then(|| "기본 경로(/sitemap.xml)와 다른 선언만 별도 요청".to_string()), + (unchecked > 0).then(|| { + format!( + "선언 {}개 중 {unchecked}개는 요청 상한으로 확인하지 않음", + entries.len() + ) + }), ); o.push( "crawling.feed_link", @@ -1468,12 +1519,30 @@ pub fn fill_catalog(mut checks: Vec) -> Vec { }); } } + // 항목명·분류는 카탈로그가 기준이다 + for c in &mut checks { + if let Some(pos) = position(&c.id) { + let (_, category, label) = CATALOG[pos]; + c.category = category; + if c.label != label { + c.label = label.to_string(); + } + } + } checks.sort_by_key(|c| position(&c.id).unwrap_or(usize::MAX)); checks } -fn host_mismatch(o: &mut Out, id: &str, cat: Category, label: &str, raw: Option<&str>, base: &Url) { - let Some(u) = raw.and_then(|r| base.join(r).ok()) else { +fn host_mismatch( + o: &mut Out, + id: &str, + cat: Category, + label: &str, + raw: Option<&str>, + base: &Url, + link_base: &Url, +) { + let Some(u) = raw.and_then(|r| link_base.join(r).ok()) else { o.push(id, cat, label, Presence::NotApplicable, None, None); return; }; @@ -1558,6 +1627,34 @@ fn sitemap_checks(o: &mut Out, i: &Inputs, base: &Url) { ); let samples = &i.sitemap_detail.samples; if samples.is_empty() { + let note = i + .sitemap_detail + .sample_note + .clone() + .unwrap_or_else(|| "sitemap 에서 표본 URL 을 얻지 못함".into()); + for (id, label) in [ + ( + "crawling.sitemap_broken_urls", + "sitemap 샘플 URL 중 비정상 응답", + ), + ( + "crawling.sitemap_noindex_pages", + "sitemap 표본 중 noindex 페이지", + ), + ( + "crawling.sitemap_canonical_mismatch", + "sitemap 표본 중 canonical 이 다른 URL 인 페이지", + ), + ] { + o.push( + id, + Crawling, + label, + Presence::Unknown, + None, + Some(note.clone()), + ); + } return; } let broken: Vec = samples @@ -1575,13 +1672,15 @@ fn sitemap_checks(o: &mut Out, i: &Inputs, base: &Url) { Presence::from_bool(!broken.is_empty()), Some(json!({ "sampled": samples.len(), "broken": broken })), Some(format!( - "{}개 URL 표본 요청 (리다이렉트 추적 후 2xx 가 아닌 것)", - samples.len() + "{}개 URL 표본 요청{} (리다이렉트 추적 후 2xx 가 아닌 것)", + samples.len(), + if s.is_index { + ", sitemap index 의 첫 하위 sitemap 에서" + } else { + "" + } )), ); - if s.is_index { - return; - } let pages: Vec<(&String, &SamplePage)> = samples .iter() .filter_map(|(u, r)| { @@ -1784,11 +1883,11 @@ fn extended_checks(o: &mut Out, i: &Inputs, robots: &Result) { StructuredData, "hreflang 자기 참조", if has_hreflang { - Presence::from_bool( - f.hreflang - .iter() - .any(|h| base.join(&h.href).is_ok_and(|u| same_url(&u, base))), - ) + Presence::from_bool(f.hreflang.iter().any(|h| { + f.link_base(base) + .join(&h.href) + .is_ok_and(|u| same_url(&u, base)) + })) } else { Presence::NotApplicable }, diff --git a/crates/devup-access-checker/src/extra.rs b/crates/devup-access-checker/src/extra.rs index d7b10e8..16d1342 100644 --- a/crates/devup-access-checker/src/extra.rs +++ b/crates/devup-access-checker/src/extra.rs @@ -383,9 +383,14 @@ pub fn extract(doc: &Html, base: &Url) -> ExtraFacts { .unwrap_or_default(); if let Ok(u) = base.join(raw.trim()) && u.host_str() == base.host_str() - && !f.same_origin_resources.iter().any(|x| x == u.path()) + && !f + .same_origin_resources + .iter() + .any(|x| x == &u[url::Position::BeforePath..url::Position::AfterQuery]) { - f.same_origin_resources.push(u.path().to_string()); + // robots 규칙은 경로 + 쿼리에 대해 판정한다 + f.same_origin_resources + .push(u[url::Position::BeforePath..url::Position::AfterQuery].to_string()); } } diff --git a/crates/devup-access-checker/src/fetch.rs b/crates/devup-access-checker/src/fetch.rs index 397f6df..4edcc69 100644 --- a/crates/devup-access-checker/src/fetch.rs +++ b/crates/devup-access-checker/src/fetch.rs @@ -23,6 +23,10 @@ fn host_limit(url: &str) -> Arc { .and_then(|u| u.host_str().map(str::to_string)) .unwrap_or_default(); let mut map = HOST_LIMITS.lock().unwrap_or_else(|e| e.into_inner()); + // 아무도 쓰지 않는 항목은 정리한다 (장시간 실행되는 서비스에서 맵이 무한히 커지지 않도록) + if map.len() > 256 { + map.retain(|_, s| Arc::strong_count(s) > 1); + } map.entry(host) .or_insert_with(|| Arc::new(Semaphore::new(PER_HOST_CONCURRENCY))) .clone() @@ -201,9 +205,13 @@ pub async fn fetch_page(client: &Client, url: &Url) -> Result { /// 대상 페이지 본문은 이 크기까지만 받는다 (비정상적으로 큰 응답으로 인한 메모리 폭증 방지). pub const MAX_PAGE_BYTES: usize = 15 * 1024 * 1024; -/// Content-Type 의 charset 으로 디코딩한다 (없거나 모르면 UTF-8, BOM 우선). -fn decode_body(bytes: &[u8], headers: &HeaderMap) -> String { - let label = headers +/// HTML 인코딩 판별 순서를 따라 디코딩한다: BOM → Content-Type charset → 앞 1024 바이트의 +/// `` / `http-equiv` → UTF-8. +pub(crate) fn decode_body(bytes: &[u8], headers: &HeaderMap) -> String { + if let Some((enc, _)) = encoding_rs::Encoding::for_bom(bytes) { + return enc.decode(bytes).0.into_owned(); + } + let header_label = headers .get(reqwest::header::CONTENT_TYPE) .and_then(|v| v.to_str().ok()) .and_then(|ct| { @@ -212,12 +220,49 @@ fn decode_body(bytes: &[u8], headers: &HeaderMap) -> String { .find(|(k, _)| k.trim().eq_ignore_ascii_case("charset")) .map(|(_, v)| v.trim().trim_matches('"').to_string()) }); - let encoding = label + let encoding = header_label .and_then(|l| encoding_rs::Encoding::for_label(l.as_bytes())) + .or_else(|| sniff_meta_charset(&bytes[..bytes.len().min(1024)])) .unwrap_or(encoding_rs::UTF_8); encoding.decode(bytes).0.into_owned() } +fn sniff_meta_charset(head: &[u8]) -> Option<&'static encoding_rs::Encoding> { + static RE: LazyLock = LazyLock::new(|| { + regex::bytes::Regex::new(r#"(?i)]*?charset\s*=\s*["']?\s*([a-z0-9_:.\-]+)"#) + .unwrap() + }); + let label = RE.captures(head)?.get(1)?.as_bytes(); + let enc = encoding_rs::Encoding::for_label(label)?; + // 명세상 meta 로 UTF-16 을 선언하면 UTF-8 로 본다 + Some( + if enc == encoding_rs::UTF_16LE || enc == encoding_rs::UTF_16BE { + encoding_rs::UTF_8 + } else { + enc + }, + ) +} + +/// 본문을 `max` 바이트까지만 받아 디코딩한다. (본문, 잘림 여부) +async fn read_text(mut res: Response, max: usize) -> Result<(String, bool), reqwest::Error> { + let headers = res.headers().clone(); + let mut buf = Vec::new(); + let mut truncated = false; + while let Some(chunk) = res.chunk().await? { + buf.extend_from_slice(&chunk); + if buf.len() >= max { + buf.truncate(max); + truncated = true; + break; + } + } + Ok((decode_body(&buf, &headers), truncated)) +} + +/// 표본·대상 확인용 페이지 본문 상한. +const MAX_SAMPLE_BYTES: usize = 5 * 1024 * 1024; + #[derive(Debug, Clone, Copy)] pub enum Expected { Xml, @@ -248,14 +293,46 @@ pub struct FileProbe { pub error: Option, } +/// 본문이 HTML 문서인지. 앞쪽의 BOM·공백·주석·`` 선언을 건너뛴 뒤 첫 태그로 판단한다. pub fn looks_like_html(body: &str) -> bool { - let lower = body - .trim_start_matches('\u{feff}') - .trim_start() + let mut rest = body.trim_start_matches('\u{feff}').trim_start(); + loop { + if let Some(r) = rest.strip_prefix("") { + Some(end) => rest = r[end + 3..].trim_start(), + None => return false, + } + } else if rest.starts_with("") { + Some(end) => rest = rest[end + 2..].trim_start(), + None => return false, + } + } else { + break; + } + } + let head = rest + .chars() + .take(16) + .collect::() .to_ascii_lowercase(); - lower.starts_with("") + [ + "", + "', '\t', '\n', '\r', '/']) + }) + }) } fn looks_like_xml(body: &str) -> bool { @@ -322,7 +399,11 @@ pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileP buf.truncate(max); } let body = decode_body(&buf, &headers); - if let Some(vendor) = crate::signals::bot_challenge(&body) { + // 텍스트 파일 본문에 차단 공급자 이름이 언급된 경우를 오인하지 않도록 HTML 응답만 본다 + if let Some(vendor) = looks_like_html(&body) + .then(|| crate::signals::bot_challenge(&body)) + .flatten() + { probe.status_code = Some(status); probe.final_url = Some(final_url.to_string()); probe.error = Some(format!("봇 차단 응답({vendor})")); @@ -335,7 +416,7 @@ pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileP .unwrap_or_default() .to_ascii_lowercase(); let head: String = body.chars().take(2048).collect(); - let is_html = looks_like_html(&head); + let is_html = looks_like_html(&body); let gz = url.path().ends_with(".gz") && (ct.contains("gzip") || ct.contains("octet-stream")); probe.format_valid = match expected { Expected::Xml => (gz || ct.contains("xml") || looks_like_xml(&head)) && !is_html, @@ -405,14 +486,7 @@ pub async fn probe_status_body(client: &Client, url: &Url) -> Result<(u16, Strin .await .map_err(|e| describe(&e))?; let status = res.status().as_u16(); - let mut body = res.text().await.map_err(|e| describe(&e))?; - if body.len() > 65_536 { - let mut cut = 65_536; - while !body.is_char_boundary(cut) { - cut -= 1; - } - body.truncate(cut); - } + let (body, _) = read_text(res, 65_536).await.map_err(|e| describe(&e))?; if let Some(vendor) = crate::signals::bot_challenge(&body) { return Err(format!("봇 차단 응답({vendor})")); } @@ -543,6 +617,30 @@ pub async fn count_bytes(client: &Client, url: &Url, max: usize) -> Result Result, String> { + use std::io::Read; + let (status, _, bytes, _) = fetch_bytes(client, url, MAX_SITEMAP_BODY).await?; + if !(200..300).contains(&status) { + return Err(format!("HTTP {status}")); + } + let xml = if bytes.starts_with(&[0x1f, 0x8b]) { + let mut out = Vec::new(); + flate2::read::GzDecoder::new(bytes.as_slice()) + .take(MAX_SITEMAP_BODY as u64) + .read_to_end(&mut out) + .map_err(|e| format!("gzip: {e}"))?; + out + } else { + bytes + }; + let text = String::from_utf8_lossy(&xml); + if looks_like_html(&text) { + return Err("HTML 응답".into()); + } + Ok(crate::sitemap::summarize(&text).locs) +} + /// sitemap 표본 페이지 요약. #[derive(Debug, Clone)] pub struct SamplePage { @@ -575,12 +673,14 @@ pub async fn probe_page(client: &Client, url: &Url) -> Result Result한글"); + let mut h = HeaderMap::new(); + h.insert(reqwest::header::CONTENT_TYPE, "text/html".parse().unwrap()); + assert!(decode_body(&bytes, &h).contains("한글")); + // http-equiv 형식 + let (bytes, _, _) = encoding_rs::EUC_KR + .encode(r#"한글"#); + assert!(decode_body(&bytes, &h).contains("한글")); + // 헤더 charset 이 meta 보다 우선 + h.insert( + reqwest::header::CONTENT_TYPE, + "text/html; charset=utf-8".parse().unwrap(), + ); + assert!(decode_body("한글".as_bytes(), &h).contains("한글")); + } + + #[test] + fn html_detection_skips_prolog_and_comments() { + assert!(looks_like_html( + " +" + )); + assert!(looks_like_html( + " +" + )); + assert!(looks_like_html(" ")); + assert!(looks_like_html("")); + assert!(!looks_like_html( + "# Title + +> 태그 설명" + )); + assert!(!looks_like_html("")); + assert!(!looks_like_html( + "User-agent: * +Disallow: /" + )); + assert!(!looks_like_html("")); + } +} diff --git a/crates/devup-access-checker/src/html.rs b/crates/devup-access-checker/src/html.rs index 73a3f57..f26a076 100644 --- a/crates/devup-access-checker/src/html.rs +++ b/crates/devup-access-checker/src/html.rs @@ -15,6 +15,7 @@ fn sel(s: &str) -> Selector { static META: LazyLock = LazyLock::new(|| sel("meta")); static LINK: LazyLock = LazyLock::new(|| sel("link[rel]")); static TITLE: LazyLock = LazyLock::new(|| sel("title")); +static BASE: LazyLock = LazyLock::new(|| sel("base[href]")); static HTML: LazyLock = LazyLock::new(|| sel("html")); static BODY: LazyLock = LazyLock::new(|| sel("body")); static H1: LazyLock = LazyLock::new(|| sel("h1")); @@ -50,6 +51,8 @@ pub struct JsonLd { #[derive(Debug, Clone, Default)] pub struct PageFacts { + /// `` 로 정해진 문서 기준 URL (없으면 None). 상대 링크는 이것을 기준으로 해석한다. + pub document_base: Option, pub lang: Option, pub title: Option, pub charset: Option, @@ -93,6 +96,11 @@ pub struct PageFacts { } impl PageFacts { + /// 상대 링크 해석 기준: `` 가 있으면 그것, 없으면 페이지 URL. + pub fn link_base<'a>(&'a self, page: &'a Url) -> &'a Url { + self.document_base.as_ref().unwrap_or(page) + } + /// `name` 우선, 없으면 `property` 에서 찾는다 (og:/twitter: 는 두 방식이 혼용된다). pub fn meta(&self, key: &str) -> Option<&str> { let key = key.to_ascii_lowercase(); @@ -183,9 +191,17 @@ fn push_unique(list: &mut Vec, s: &str) { } /// HTML 문서에서 사실을 추출한다. `base` 는 내부/외부 링크 구분과 혼합 콘텐츠 판별에 쓴다. -pub fn extract(html: &str, base: &Url) -> PageFacts { +pub fn extract(html: &str, page_url: &Url) -> PageFacts { let doc = Html::parse_document(html); + // 첫 번째 만 유효하다 (HTML 명세) + let document_base = doc + .select(&BASE) + .find_map(|b| b.value().attr("href")) + .and_then(|h| page_url.join(h.trim()).ok()) + .filter(|u| matches!(u.scheme(), "http" | "https")); + let base = document_base.as_ref().unwrap_or(page_url); let mut f = PageFacts { + document_base: document_base.clone(), lang: doc .select(&HTML) .next() @@ -317,7 +333,7 @@ pub fn extract(html: &str, base: &Url) -> PageFacts { let Ok(u) = base.join(href) else { continue }; match u.scheme() { "http" | "https" => { - if u.host_str() == base.host_str() { + if u.host_str() == page_url.host_str() { f.internal_links += 1; } else { f.external_links += 1; @@ -327,7 +343,7 @@ pub fn extract(html: &str, base: &Url) -> PageFacts { } } - if base.scheme() == "https" { + if page_url.scheme() == "https" { for el in doc.select(&SUBRESOURCE) { let src = attr(&el, "src") .or_else(|| attr(&el, "href")) @@ -438,4 +454,23 @@ mod tests { let f = extract(html, &Url::parse("http://example.com/").unwrap()); assert!(f.insecure_subresources.is_empty()); } + + #[test] + fn base_href_sets_link_base() { + let page = Url::parse("https://a.com/ko/about").unwrap(); + let f = extract( + r#"x"#, + &page, + ); + assert_eq!(f.link_base(&page).as_str(), "https://a.com/"); + assert_eq!( + f.link_base(&page) + .join(f.favicon.as_deref().unwrap()) + .unwrap() + .as_str(), + "https://a.com/favicon.ico" + ); + let f = extract("", &page); + assert_eq!(f.link_base(&page), &page); + } } diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 567ffc6..a3789c6 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -186,7 +186,7 @@ impl Checker { } let one = |raw: Option| { let probe = &probe; - let base = &base; + let base = facts.link_base(&base); async move { match raw { Some(r) => Some(fetch::probe_link(probe, &r, base).await), @@ -317,31 +317,32 @@ impl Checker { let summary = checks::pick_sitemap(&sitemap, &declared) .filter(|sm| !checks::is_gz(sm)) .map(|sm| sitemap::summarize(sm.body.as_deref().unwrap_or_default())); - // sitemap 점검용 표본 (index 면 하위 sitemap 들) - let sitemap_sample_urls: Vec = match &summary { - Some(s) if opts.sitemap_samples > 0 => { - s.locs.iter().take(opts.sitemap_samples).cloned().collect() - } - _ => Vec::new(), - }; - // 여러 페이지 표본: index 면 첫 하위 sitemap 의 URL 을 쓴다 + // 페이지 URL 목록: index 면 첫 하위 sitemap 의 URL 을 쓴다 + let mut sample_note: Option = + (opts.sitemap_samples == 0).then(|| "점검하지 않음 (옵션으로 생략)".to_string()); let page_locs: Vec = match &summary { - Some(s) if s.is_index && opts.page_samples > 0 => { + Some(s) if s.is_index && (opts.sitemap_samples > 0 || opts.page_samples > 0) => { match s.locs.first().and_then(|u| Url::parse(u).ok()) { - Some(child) => { - let p = fetch::probe_file(&probe, &child, Xml).await; - if p.exists && !checks::is_gz(&p) { - sitemap::summarize(p.body.as_deref().unwrap_or_default()).locs - } else { + Some(child) => match fetch::fetch_sitemap_locs(&probe, &child).await { + Ok(locs) => locs, + Err(e) => { + sample_note = + Some(format!("첫 하위 sitemap({child}) 읽기 실패: {e}")); Vec::new() } - } + }, None => Vec::new(), } } Some(s) => s.locs.clone(), None => Vec::new(), }; + // sitemap 점검용 표본: sitemap 에 실린 페이지 앞에서부터 + let sitemap_sample_urls: Vec = page_locs + .iter() + .take(opts.sitemap_samples) + .cloned() + .collect(); let (page_urls, from_sitemap, from_links) = if opts.page_samples > 0 { pick_page_samples( &page_locs, @@ -387,7 +388,11 @@ impl Checker { ( sitemap, robots, - checks::SitemapDetail { declared, samples }, + checks::SitemapDetail { + declared, + samples, + sample_note, + }, site, ) }; @@ -437,7 +442,7 @@ impl Checker { }; let og_fut = async { let raw = facts.meta("og:image").filter(|_| opts.check_links)?; - let Ok(url) = base.join(raw) else { + let Ok(url) = facts.link_base(&base).join(raw) else { return Some(Err(format!("invalid url: {raw}"))); }; Some(fetch::fetch_bytes(&probe, &url, 8 * 1024 * 1024).await.map( @@ -482,7 +487,7 @@ impl Checker { }; let manifest_fut = async { let raw = facts.manifest.as_deref().filter(|_| opts.check_links)?; - let url = base.join(raw).ok()?; + let url = facts.link_base(&base).join(raw).ok()?; Some(fetch::fetch_bytes(&probe, &url, 1024 * 1024).await.map( |(status, _, bytes, _)| { ( @@ -496,7 +501,11 @@ impl Checker { if !opts.check_links { return None; } - let url = match facts.favicon.as_deref().and_then(|f| base.join(f).ok()) { + let url = match facts + .favicon + .as_deref() + .and_then(|f| facts.link_base(&base).join(f).ok()) + { Some(u) => u, None => favicon_url.clone(), }; @@ -522,7 +531,10 @@ impl Checker { }; // canonical 대상 / hreflang 대상 / 외부 CSS / 페이지 무게 let canonical_fut = async { - let c = facts.canonical.as_deref().and_then(|c| base.join(c).ok())?; + let c = facts + .canonical + .as_deref() + .and_then(|c| facts.link_base(&base).join(c).ok())?; if c.as_str().trim_end_matches('/') == base.as_str().trim_end_matches('/') { return None; } @@ -532,7 +544,13 @@ impl Checker { let targets: Vec<(String, Url)> = facts .hreflang .iter() - .filter_map(|h| base.join(&h.href).ok().map(|u| (h.lang.clone(), u))) + .filter_map(|h| { + facts + .link_base(&base) + .join(&h.href) + .ok() + .map(|u| (h.lang.clone(), u)) + }) .filter(|(_, u)| { u.as_str().trim_end_matches('/') != base.as_str().trim_end_matches('/') }) diff --git a/crates/devup-access-checker/src/robots.rs b/crates/devup-access-checker/src/robots.rs index 0675947..36d1a7d 100644 --- a/crates/devup-access-checker/src/robots.rs +++ b/crates/devup-access-checker/src/robots.rs @@ -128,10 +128,39 @@ impl Robots { } } +/// 비교 전에 양쪽을 같은 형태로 맞춘다: 비 ASCII 는 퍼센트 인코딩, `%xx` 는 대문자. +fn normalize(s: &str) -> String { + let bytes = s.as_bytes(); + let mut out = String::with_capacity(s.len()); + let mut i = 0; + while i < bytes.len() { + let b = bytes[i]; + if b == b'%' + && i + 2 < bytes.len() + && bytes[i + 1].is_ascii_hexdigit() + && bytes[i + 2].is_ascii_hexdigit() + { + out.push('%'); + out.push(bytes[i + 1].to_ascii_uppercase() as char); + out.push(bytes[i + 2].to_ascii_uppercase() as char); + i += 3; + } else if b >= 0x80 { + out.push_str(&format!("%{b:02X}")); + i += 1; + } else { + out.push(b as char); + i += 1; + } + } + out +} + fn pattern_matches(pattern: &str, path: &str) -> bool { + let pattern = normalize(pattern); + let path = normalize(path); let (body, anchored) = match pattern.strip_suffix('$') { Some(b) => (b, true), - None => (pattern, false), + None => (pattern.as_str(), false), }; let mut re = String::from("^"); for (i, part) in body.split('*').enumerate() { @@ -143,7 +172,7 @@ fn pattern_matches(pattern: &str, path: &str) -> bool { if anchored { re.push('$'); } - Regex::new(&re).is_ok_and(|r| r.is_match(path)) + Regex::new(&re).is_ok_and(|r| r.is_match(&path)) } #[cfg(test)] @@ -204,4 +233,20 @@ Sitemap: https://example.com/sitemap.xml # main fn empty_robots_allows_all() { assert!(Robots::parse("").is_allowed("GPTBot", "/")); } + + #[test] + fn matches_query_and_non_ascii_paths() { + let r = Robots::parse( + "User-agent: * +Disallow: /*?sort= +Disallow: /검색 +Disallow: /a%2fb +", + ); + assert!(!r.is_allowed("Googlebot", "/list?sort=price")); + assert!(r.is_allowed("Googlebot", "/list?page=2")); + // url 크레이트가 만든 경로(퍼센트 인코딩)와 원문 패턴이 맞아야 한다 + assert!(!r.is_allowed("Googlebot", "/%EA%B2%80%EC%83%89")); + assert!(!r.is_allowed("Googlebot", "/a%2Fb")); + } } diff --git a/crates/devup-access-checker/tests/end_to_end.rs b/crates/devup-access-checker/tests/end_to_end.rs index c45739d..62ec04b 100644 --- a/crates/devup-access-checker/tests/end_to_end.rs +++ b/crates/devup-access-checker/tests/end_to_end.rs @@ -1030,3 +1030,66 @@ fn readme_lists_every_catalog_id() { .collect(); assert_eq!(listed, catalog); } + +/// robots.txt 가 기본 경로 sitemap 을 선언했는데 그 파일이 없으면 "선언 sitemap 접근" 은 missing. +#[tokio::test] +async fn declared_default_sitemap_missing_is_reported() { + let s = MockServer::start().await; + Mock::given(method("GET")) + .and(path("/")) + .respond_with( + ResponseTemplate::new(200) + .insert_header("content-type", "text/html") + .set_body_string(PAGE), + ) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/robots.txt")) + .respond_with(ResponseTemplate::new(200).set_body_string(format!( + "User-agent: *\nDisallow: /*?sort=\n\nSitemap: {}/sitemap.xml\n", + s.uri() + ))) + .mount(&s) + .await; + let r = Checker::new(Options { + check_transport: false, + check_ai_user_agents: false, + ..Default::default() + }) + .check(&format!("{}/?sort=1", s.uri())) + .await + .unwrap(); + assert_eq!( + presence(&r, "crawling.robots_declared_sitemaps"), + Presence::Missing + ); + // 쿼리까지 포함해 robots 규칙을 판정한다 + assert_eq!( + presence(&r, "crawling.robots_allows.googlebot"), + Presence::Missing + ); +} + +/// 결과 항목명이 카탈로그와 같아야 한다 (분기마다 다른 항목명을 쓰지 않도록). +#[tokio::test] +async fn labels_match_catalog() { + let s = site().await; + for opts in [ + Options::default(), + Options { + sitemap_samples: 0, + page_samples: 0, + check_links: false, + ..Default::default() + }, + ] { + let r = Checker::new(opts).check(&s.uri()).await.unwrap(); + for (c, (id, cat, label)) in r.checks.iter().zip(devup_access_checker::CATALOG) { + assert_eq!( + (c.id.as_str(), c.category, c.label.as_str()), + (*id, *cat, *label) + ); + } + } +} From 1685e0583ecc95c2d062356c695a35f4b9337885 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 07:47:10 +0900 Subject: [PATCH 03/21] =?UTF-8?q?test:=20=EB=9D=BC=EC=9D=B8=20=EC=BB=A4?= =?UTF-8?q?=EB=B2=84=EB=A6=AC=EC=A7=80=20100%=20=EC=99=80=20CI=20=EA=B2=80?= =?UTF-8?q?=EC=82=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - checks: 입력 픽스처로 요청 실패·상태별 분기를 직접 검증 - fetch: 본문 끊김, 상한 초과, 챌린지, 리다이렉트 반복, gzip sitemap, 인증서 파싱 등 경계 상황 테스트 - lib/e2e: 클라이언트 리다이렉트 예외, sitemap index 하위 파일, 잘못된 og:image, TRACE 로그 - CLI: 출력 로직을 run() 으로 분리해 테스트하고, 실제 바이너리 종료 코드도 확인 - 실행될 수 없는 방어 분기 정리, www 변형·TLS 판정을 작은 함수로 분리 - CI coverage 작업: tarpaulin(llvm) --fail-under 100, 배포 전 필수 Co-Authored-By: Claude Opus 5.5 --- .github/workflows/CI.yml | 20 + Cargo.lock | 1 + README.md | 8 + crates/devup-access-checker-cli/Cargo.toml | 3 + crates/devup-access-checker-cli/src/main.rs | 143 +++++- .../devup-access-checker-cli/tests/binary.rs | 20 + crates/devup-access-checker/src/checks.rs | 450 ++++++++++++++++-- crates/devup-access-checker/src/fetch.rs | 260 +++++++++- crates/devup-access-checker/src/html.rs | 54 +++ crates/devup-access-checker/src/lib.rs | 86 +++- crates/devup-access-checker/src/model.rs | 30 ++ crates/devup-access-checker/src/robots.rs | 9 +- crates/devup-access-checker/src/signals.rs | 7 + .../devup-access-checker/tests/end_to_end.rs | 147 ++++++ .../tests/fixtures/cert.der | Bin 0 -> 388 bytes crates/devup-access-checker/tests/trace.rs | 26 + 16 files changed, 1166 insertions(+), 98 deletions(-) create mode 100644 crates/devup-access-checker-cli/tests/binary.rs create mode 100644 crates/devup-access-checker/tests/fixtures/cert.der create mode 100644 crates/devup-access-checker/tests/trace.rs diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 3687d90..483beee 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -67,6 +67,25 @@ jobs: - name: Test run: cargo test --workspace --all-features + # 라인 커버리지 100% 를 유지한다 (미달이면 실패) + coverage: + name: coverage (tarpaulin) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v7 + - uses: actions-rust-lang/setup-rust-toolchain@v2 + - uses: taiki-e/install-action@v2 + with: + tool: cargo-tarpaulin + - name: Coverage + # llvm 엔진은 CLI 통합 테스트가 실행한 바이너리의 커버리지도 함께 수집한다 + run: cargo tarpaulin --workspace --engine llvm --fail-under 100 --out Xml --out Stdout + - uses: actions/upload-artifact@v7 + if: always() + with: + name: coverage + path: cobertura.xml + msrv: name: msrv (1.88) runs-on: ubuntu-latest @@ -108,6 +127,7 @@ jobs: - fmt - clippy - test + - coverage - msrv - doc - package diff --git a/Cargo.lock b/Cargo.lock index 6d8cc77..0496661 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,6 +504,7 @@ dependencies = [ "futures", "serde_json", "tokio", + "wiremock", ] [[package]] diff --git a/README.md b/README.md index 54af169..ace7cd1 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,14 @@ if report.get("geo.llms_txt").map(|c| c.presence) == Some(Presence::Missing) { / `present`는 "좋다"는 뜻이 아니라 "있다"는 뜻입니다. 그래서 `indexing.meta_noindex`, `transport.mixed_content`, `content.img_alt_missing`처럼 부정적인 항목은 `present`가 곧 문제가 발견되었다는 의미입니다. +## 테스트 + +`cargo test --workspace`로 실행합니다. 모든 테스트는 로컬 mock 서버만 쓰고 외부 네트워크에 의존하지 않습니다. CI는 [cargo-tarpaulin](https://github.com/xd009642/tarpaulin)으로 라인 커버리지 100%를 확인하며, 미달이면 실패합니다. + +```sh +cargo tarpaulin --workspace --engine llvm --fail-under 100 +``` + ## 지원 Rust 버전 Rust 1.88 이상 (CI에서 확인). diff --git a/crates/devup-access-checker-cli/Cargo.toml b/crates/devup-access-checker-cli/Cargo.toml index e1f6a88..54e3f5c 100644 --- a/crates/devup-access-checker-cli/Cargo.toml +++ b/crates/devup-access-checker-cli/Cargo.toml @@ -24,3 +24,6 @@ clap = { version = "4.6", features = ["derive"] } tokio.workspace = true serde_json.workspace = true futures = "0.3" + +[dev-dependencies] +wiremock = "0.6" diff --git a/crates/devup-access-checker-cli/src/main.rs b/crates/devup-access-checker-cli/src/main.rs index 505f9b9..477dc63 100644 --- a/crates/devup-access-checker-cli/src/main.rs +++ b/crates/devup-access-checker-cli/src/main.rs @@ -1,3 +1,4 @@ +use std::io::Write; use std::process::ExitCode; use std::time::Duration; @@ -64,42 +65,43 @@ fn short_value(v: &serde_json::Value) -> String { } } -fn print_text(r: &Report, only_missing: bool) { - println!( +fn print_text(out: &mut impl Write, r: &Report, only_missing: bool) -> std::io::Result<()> { + writeln!( + out, "{} → {} (HTTP {}, {}ms)", r.url, r.final_url, r.status_code, r.duration_ms - ); + )?; let mut last: Option = None; for c in &r.checks { if only_missing && c.presence != Presence::Missing { continue; } if last != Some(c.category) { - println!("\n[{}]", c.category.label()); + writeln!(out, "\n[{}]", c.category.label())?; last = Some(c.category); } let mut line = format!(" {} {:<36} {}", mark(c.presence), c.label, c.id); if let Some(v) = &c.value { line.push_str(&format!(" = {}", short_value(v))); } - println!("{line}"); + writeln!(out, "{line}")?; if let Some(n) = &c.note { - println!(" {n}"); + writeln!(out, " {n}")?; } } let count = |p| r.checks.iter().filter(|c| c.presence == p).count(); - println!( + writeln!( + out, "\n있음 {} · 없음 {} · 판별 불가 {} · 해당 없음 {}", count(Presence::Present), count(Presence::Missing), count(Presence::Unknown), count(Presence::NotApplicable) - ); + ) } -#[tokio::main] -async fn main() -> ExitCode { - let cli = Cli::parse(); +/// 점검을 실행하고 결과를 쓴다. 반환값은 종료 코드 (0 성공, 2 일부 URL 실패). +async fn run(cli: Cli, out: &mut impl Write, err: &mut impl Write) -> std::io::Result { let checker = Checker::new(Options { page_timeout: Duration::from_secs(cli.timeout), check_links: !cli.no_links, @@ -118,28 +120,127 @@ async fn main() -> ExitCode { match result { Ok(r) => { if let Format::Text = cli.format { - print_text(&r, cli.only_missing); - println!(); + print_text(out, &r, cli.only_missing)?; + writeln!(out)?; } reports.push(r); } Err(e) => { - eprintln!("error: {e}"); + writeln!(err, "error: {e}")?; failed = true; } } } if let Format::Json = cli.format { - let out = if reports.len() == 1 && cli.urls.len() == 1 { + let json = if reports.len() == 1 && cli.urls.len() == 1 { serde_json::to_string_pretty(&reports[0]) } else { serde_json::to_string_pretty(&reports) - }; - println!("{}", out.expect("serialize report")); + } + .map_err(std::io::Error::other)?; + writeln!(out, "{json}")?; } - if failed { - ExitCode::from(2) - } else { - ExitCode::SUCCESS + Ok(if failed { 2 } else { 0 }) +} + +#[tokio::main] +async fn main() -> ExitCode { + let code = run( + Cli::parse(), + &mut std::io::stdout().lock(), + &mut std::io::stderr().lock(), + ) + .await; + ExitCode::from(code.unwrap_or(1)) +} + +#[cfg(test)] +mod tests { + use super::*; + use wiremock::matchers::{method, path}; + use wiremock::{Mock, MockServer, ResponseTemplate}; + + async fn server() -> MockServer { + let s = MockServer::start().await; + Mock::given(method("GET")) + .and(path("/")) + .respond_with( + ResponseTemplate::new(200) + .insert_header("content-type", "text/html") + .set_body_string(format!( + "t

h

", + "긴 설명 ".repeat(30) + )), + ) + .mount(&s) + .await; + s + } + + async fn exec(args: &[&str]) -> (u8, String, String) { + let cli = Cli::parse_from( + [ + "devup-access-checker", + "--no-ai-ua", + "--no-transport", + "--pages", + "0", + ] + .iter() + .chain(args), + ); + let (mut out, mut err) = (Vec::new(), Vec::new()); + let code = run(cli, &mut out, &mut err).await.unwrap(); + ( + code, + String::from_utf8(out).unwrap(), + String::from_utf8(err).unwrap(), + ) + } + + #[tokio::test] + async fn text_output_lists_categories_values_and_notes() { + let s = server().await; + let (code, out, _) = exec(&[&s.uri()]).await; + assert_eq!(code, 0); + assert!(out.contains("[기본 메타]")); + assert!(out.contains("✓") && out.contains("✗") && out.contains("?") && out.contains("-")); + assert!(out.contains("…"), "긴 값은 줄인다"); + assert!(out.contains("있음 ")); + } + + #[tokio::test] + async fn only_missing_and_json_formats() { + let s = server().await; + let (_, out, _) = exec(&["--only-missing", &s.uri()]).await; + assert!(!out.contains(" ✓ ")); + let (_, out, _) = exec(&["-f", "json", &s.uri()]).await; + assert!( + serde_json::from_str::(&out) + .unwrap() + .is_object() + ); + let (_, out, _) = exec(&["-f", "json", &s.uri(), &s.uri()]).await; + assert!( + serde_json::from_str::(&out) + .unwrap() + .is_array() + ); + } + + #[tokio::test] + async fn unreachable_url_exits_with_2() { + let s = server().await; + let (code, _, err) = exec(&[ + "--no-links", + "--no-resources", + "--timeout", + "5", + &s.uri(), + "http://127.0.0.1:9", + ]) + .await; + assert_eq!(code, 2); + assert!(err.contains("error:")); } } diff --git a/crates/devup-access-checker-cli/tests/binary.rs b/crates/devup-access-checker-cli/tests/binary.rs new file mode 100644 index 0000000..294dc04 --- /dev/null +++ b/crates/devup-access-checker-cli/tests/binary.rs @@ -0,0 +1,20 @@ +//! 실제 바이너리의 진입점(인자 파싱, 종료 코드)을 확인한다. +use std::process::Command; + +#[test] +fn binary_reports_failure_exit_code() { + let out = Command::new(env!("CARGO_BIN_EXE_devup-access-checker")) + .args([ + "--no-ai-ua", + "--no-transport", + "--pages", + "0", + "--timeout", + "5", + "http://127.0.0.1:9", + ]) + .output() + .unwrap(); + assert_eq!(out.status.code(), Some(2)); + assert!(String::from_utf8_lossy(&out.stderr).contains("error:")); +} diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index 75eb347..ca5fec4 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -1496,41 +1496,34 @@ pub fn build(i: &Inputs) -> Vec { } /// 카탈로그의 모든 id 를 카탈로그 순서로 담는다. 만들어지지 않은 항목(옵션으로 생략 등)은 unknown. -pub fn fill_catalog(mut checks: Vec) -> Vec { +pub fn fill_catalog(checks: Vec) -> Vec { use crate::catalog::{CATALOG, position}; - debug_assert!( - checks.iter().all(|c| position(&c.id).is_some()), - "카탈로그에 없는 id: {:?}", - checks - .iter() - .filter(|c| position(&c.id).is_none()) - .map(|c| &c.id) - .collect::>() - ); - for (id, category, label) in CATALOG { - if !checks.iter().any(|c| c.id == *id) { - checks.push(Check { + let mut slots: Vec> = vec![None; CATALOG.len()]; + for c in checks { + let pos = position(&c.id); + debug_assert!(pos.is_some(), "카탈로그에 없는 id: {}", c.id); + if let Some(pos) = pos { + slots[pos] = Some(c); + } + } + // 항목명·분류는 카탈로그가 기준이다 + CATALOG + .iter() + .zip(slots) + .map(|((id, category, label), c)| { + let mut c = c.unwrap_or_else(|| Check { id: (*id).to_string(), category: *category, - label: (*label).to_string(), + label: String::new(), presence: Presence::Unknown, value: None, note: Some("점검하지 않음 (옵션으로 생략했거나 수행 조건이 아님)".into()), }); - } - } - // 항목명·분류는 카탈로그가 기준이다 - for c in &mut checks { - if let Some(pos) = position(&c.id) { - let (_, category, label) = CATALOG[pos]; - c.category = category; - if c.label != label { - c.label = label.to_string(); - } - } - } - checks.sort_by_key(|c| position(&c.id).unwrap_or(usize::MAX)); - checks + c.category = *category; + c.label = (*label).to_string(); + c + }) + .collect() } fn host_mismatch( @@ -3303,4 +3296,405 @@ mod tests { assert_eq!(year_of(1_798_675_200), 2026); // 2026-12-31 assert_eq!(year_of(1_798_761_600), 2027); // 2027-01-01 } + + // ===== build() 를 직접 호출하는 입력 픽스처 ===== + use crate::fetch::{CertInfo, Page}; + use std::time::Duration; + + const HTML: &str = r#" +제목 + + + + +

h

abouta"#; + + fn page(url: &str, html: &str) -> Page { + let mut h = HeaderMap::new(); + h.insert("x-robots-tag", "noindex".parse().unwrap()); + Page { + status: 200, + final_url: Url::parse(url).unwrap(), + headers: h, + body: html.to_string(), + elapsed: Duration::from_millis(5), + body_bytes: html.len(), + truncated: true, + version: "HTTP/2.0".into(), + certificate: None, + } + } + + fn failed(url: &str) -> FileProbe { + FileProbe { + url: url.into(), + error: Some("boom".into()), + ..Default::default() + } + } + + fn found(url: &str, body: &str) -> FileProbe { + FileProbe { + url: url.into(), + status_code: Some(200), + exists: true, + format_valid: true, + body: Some(body.into()), + size: Some(body.len()), + ..Default::default() + } + } + + fn sample_page(status: u16) -> SamplePage { + SamplePage { + status, + final_url: Url::parse("https://a.com/p").unwrap(), + noindex: false, + canonical: None, + title: Some("t".into()), + description: None, + lang: None, + h1_count: 1, + img_total: 0, + img_without_alt: 0, + body_text_len: 10, + hreflang: Vec::new(), + } + } + + fn err() -> Result { + Err("boom".to_string()) + } + + fn u(s: &str) -> Url { + Url::parse(s).unwrap() + } + + /// 모든 부속 요청이 실패한 상태. + struct Fx { + page: Page, + facts: PageFacts, + sitemap: FileProbe, + robots: FileProbe, + not_found: Result<(u16, String), String>, + http_version: Option>, + content_encoding: Option, String>>, + links: Option, + ai_ua: Vec, + well_known: WellKnown, + sitemap_detail: SitemapDetail, + site: Option, + redirect_chain: Option, String>>, + host_variant: Option, + extended: Extended, + } + + impl Fx { + fn failing() -> Self { + let page = page("https://a.com/", HTML); + let facts = crate::html::extract(&page.body, &page.final_url); + Fx { + page, + facts, + sitemap: failed("https://a.com/sitemap.xml"), + robots: failed("https://a.com/robots.txt"), + not_found: err(), + http_version: Some(err()), + content_encoding: Some(err()), + links: Some(LinkProbes { + // 링크는 있는데 검증 결과가 없음 / 상태도 오류도 없음 + favicon: None, + canonical: Some(LinkProbe::default()), + ..Default::default() + }), + ai_ua: vec![("gptbot", err())], + well_known: WellKnown { + favicon_ico: failed("f"), + apple_touch_icon: failed("a"), + security_txt: failed("s"), + tdmrep: failed("t"), + apple_app_site_association: failed("aa"), + assetlinks: failed("al"), + ads_txt: failed("ads"), + }, + sitemap_detail: SitemapDetail::default(), + site: Some(SiteSample { + source: "internal_links", + pages: vec![("https://a.com/x".into(), err())], + }), + redirect_chain: Some(err()), + host_variant: Some(HostVariant { + url: u("https://www.a.com/"), + result: err(), + }), + extended: Extended { + tls: Some(err()), + url_variants: vec![UrlVariant { + kind: "uppercase", + url: u("https://a.com/X"), + result: err(), + }], + og_image: Some(err()), + internal_samples: Some(vec![("https://a.com/about".into(), err())]), + manifest: Some(err()), + favicon_image: Some(err()), + static_asset: Some(("https://a.com/a.css".into(), err())), + hreflang_targets: vec![("en".into(), "https://a.com/en".into(), err())], + ..Default::default() + }, + } + } + + fn run(&self) -> Vec { + build(&Inputs { + page: &self.page, + facts: &self.facts, + sitemap: &self.sitemap, + robots: &self.robots, + llms: &failed("l"), + llms_full: &failed("lf"), + ai_txt: &failed("ai"), + not_found: &self.not_found, + http_version: self.http_version.as_ref(), + content_encoding: self.content_encoding.as_ref(), + links: self.links.as_ref(), + ai_ua: &self.ai_ua, + well_known: &self.well_known, + sitemap_detail: &self.sitemap_detail, + site: self.site.as_ref(), + refresh_hops: &[], + blocked: None, + challenge: None, + redirect_chain: self.redirect_chain.as_ref(), + host_variant: self.host_variant.as_ref(), + extended: &self.extended, + }) + } + } + + fn get<'a>(checks: &'a [Check], id: &str) -> &'a Check { + checks + .iter() + .find(|c| c.id == id) + .unwrap_or_else(|| panic!("{id}")) + } + + #[test] + fn failed_requests_are_unknown_not_missing() { + let c = Fx::failing().run(); + for id in [ + "crawling.robots_txt", + "crawling.robots_allows.googlebot", + "crawling.robots_blocks_resources", + "links.favicon", + "links.canonical", + "performance.compression", + "transport.http_to_https_redirect", + "transport.redirect", + "transport.temporary_redirect", + "geo.ua_access.gptbot", + "geo.tdm_reservation", + "not_found_page.returns_404", + "not_found_page.custom", + "open_graph.image_file", + "transport.tls_certificate", + "transport.url_variant.uppercase", + "meta.manifest_content", + "meta.manifest_icons_192_512", + "meta.favicon_size", + "performance.static_asset_cache", + ] { + assert_eq!(get(&c, id).presence, Presence::Unknown, "{id}"); + } + assert_eq!( + get(&c, "transport.host_variant_duplicate").presence, + Presence::NotApplicable + ); + // 실패한 표본은 '깨짐' 목록에 오류와 함께 남는다 + assert!( + get(&c, "content.broken_internal_links") + .value + .as_ref() + .unwrap() + .to_string() + .contains("boom") + ); + assert!( + get(&c, "site.failed_pages") + .value + .as_ref() + .unwrap() + .to_string() + .contains("boom") + ); + assert!( + get(&c, "structured_data.hreflang_reciprocal") + .value + .as_ref() + .unwrap() + .to_string() + .contains("boom") + ); + // 잘린 본문, 헤더 noindex, https 페이지의 http 리소스 + assert!(get(&c, "performance.html_bytes").note.is_some()); + assert_eq!( + get(&c, "indexing.header_noindex").presence, + Presence::Present + ); + assert_eq!( + get(&c, "transport.mixed_content").presence, + Presence::Present + ); + } + + #[test] + fn successful_network_results() { + let mut fx = Fx::failing(); + fx.robots = FileProbe { + status_code: Some(503), + ..failed("https://a.com/robots.txt") + }; + fx.robots.error = None; + fx.not_found = Ok((200, "x".into())); + fx.host_variant = Some(HostVariant { + url: u("https://www.a.com/"), + result: Ok((503, u("https://www.a.com/"))), + }); + fx.extended.tls = Some(Ok(Some(CertInfo { + subject: "CN=a.com".into(), + issuer: "CN=CA".into(), + not_after: 86_400 * 10, + not_after_text: "1970-01-11".into(), + }))); + fx.extended.manifest = Some(Ok((200, None))); + let c = fx.run(); + assert!( + get(&c, "crawling.robots_txt").note.is_some() + || get(&c, "crawling.robots_allows.googlebot").note.is_some() + ); + assert_eq!( + get(&c, "crawling.robots_allows.googlebot").presence, + Presence::Unknown + ); + assert_eq!( + get(&c, "not_found_page.custom").presence, + Presence::NotApplicable + ); + assert_eq!( + get(&c, "transport.host_variant_duplicate").presence, + Presence::NotApplicable + ); + assert_eq!( + get(&c, "transport.tls_certificate").presence, + Presence::Present + ); + assert_eq!( + get(&c, "meta.manifest_icons_192_512").presence, + Presence::NotApplicable + ); + + fx.host_variant = Some(HostVariant { + url: u("https://www.a.com/"), + result: Ok((200, u("https://www.a.com/"))), + }); + let c = fx.run(); + assert_eq!( + get(&c, "transport.host_variant_duplicate").presence, + Presence::Present + ); + } + + #[test] + fn declared_sitemaps_and_sitemap_shapes() { + let mut fx = Fx::failing(); + let index = r#"https://a.com/s1.xml"#; + fx.robots = found( + "https://a.com/robots.txt", + "User-agent: *\nAllow: /\nSitemap: https://a.com/sitemap.xml\n", + ); + fx.sitemap = found("https://a.com/sitemap.xml", index); + fx.sitemap_detail.samples = vec![("https://a.com/p".into(), Ok(sample_page(200)))]; + let c = fx.run(); + assert_eq!( + get(&c, "crawling.robots_declared_sitemaps").presence, + Presence::Present + ); + assert!( + get(&c, "crawling.sitemap_broken_urls") + .note + .as_deref() + .unwrap() + .contains("index") + ); + + // 선언했지만 요청 상한으로 확인하지 못한 sitemap + fx.robots = found( + "https://a.com/robots.txt", + "Sitemap: https://a.com/sitemap.xml\nSitemap: https://a.com/other.xml\n", + ); + let c = fx.run(); + let d = get(&c, "crawling.robots_declared_sitemaps"); + assert_eq!(d.presence, Presence::Unknown); + assert!( + d.value + .as_ref() + .unwrap() + .to_string() + .contains("\"checked\":false") + ); + + // 빈 sitemap 과 gzip sitemap + fx.sitemap = found( + "https://a.com/sitemap.xml", + "", + ); + let c = fx.run(); + assert_eq!( + get(&c, "crawling.sitemap_lastmod").presence, + Presence::NotApplicable + ); + assert_eq!( + get(&c, "crawling.sitemap_foreign_host").presence, + Presence::NotApplicable + ); + fx.sitemap = found("https://a.com/sitemap.xml.gz", ""); + let c = fx.run(); + assert_eq!( + get(&c, "crawling.sitemap_entries").presence, + Presence::Unknown + ); + } + + #[test] + fn cert_mark_signal_combinations() { + let run = |s: CertMarkSignals, len: usize| { + let mut o = Out(Vec::new()); + cert_mark_check(&mut o, &s, len); + o.0.remove(0) + }; + let issuer = CertMarkSignals { + issuer: Some("한국웹접근성인증평가원"), + ..Default::default() + }; + assert_eq!(run(issuer, 9_999).presence, Presence::Present); + let both = CertMarkSignals { + text_signal: true, + filename_signal: true, + ..Default::default() + }; + assert_eq!(run(both, 9_999).presence, Presence::Present); + let one = CertMarkSignals { + text_signal: true, + ..Default::default() + }; + assert_eq!(run(one, 9_999).presence, Presence::Unknown); + assert_eq!( + run(CertMarkSignals::default(), 9_999).presence, + Presence::Missing + ); + assert_eq!( + run(CertMarkSignals::default(), 0).presence, + Presence::Unknown + ); + } } diff --git a/crates/devup-access-checker/src/fetch.rs b/crates/devup-access-checker/src/fetch.rs index 4edcc69..4a666d2 100644 --- a/crates/devup-access-checker/src/fetch.rs +++ b/crates/devup-access-checker/src/fetch.rs @@ -375,16 +375,13 @@ pub async fn probe_file(client: &Client, url: &Url, expected: Expected) -> FileP let mut res = res; let mut buf = Vec::new(); let mut read = 0usize; - loop { + while read < COUNT_LIMIT { match res.chunk().await { Ok(Some(chunk)) => { read += chunk.len(); if buf.len() <= max { buf.extend_from_slice(&chunk); } - if read >= COUNT_LIMIT { - break; - } } Ok(None) => break, Err(e) => { @@ -782,26 +779,251 @@ mod tests { #[test] fn html_detection_skips_prolog_and_comments() { + assert!(looks_like_html("\n")); assert!(looks_like_html( - " -" - )); - assert!(looks_like_html( - " -" + "\n" )); assert!(looks_like_html(" ")); assert!(looks_like_html("")); - assert!(!looks_like_html( - "# Title - -> 태그 설명" - )); + assert!(!looks_like_html("# Title\n\n> 태그 설명")); assert!(!looks_like_html("")); - assert!(!looks_like_html( - "User-agent: * -Disallow: /" - )); + assert!(!looks_like_html("User-agent: *\nDisallow: /")); assert!(!looks_like_html("")); + // 닫히지 않은 주석·선언 + assert!(!looks_like_html("").unwrap()); +static YANDEX_NOINDEX_CLOSE: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)|").unwrap()); + +/// Google 이미지가 지원하는 형식 (확장자 기준). +const IMAGE_FORMATS: &[&str] = &[ + "bmp", "gif", "jpg", "jpeg", "png", "webp", "svg", "avif", "ico", +]; + +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct HreflangLink { + pub lang: String, + pub href: String, + pub media: bool, +} + +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct GoogleFacts { + /// data-nosnippet 이 span·div·section 외 요소에 붙은 수 + pub data_nosnippet_invalid: Vec, + pub hreflang: Vec, + pub rel_prev: bool, + pub rel_next: bool, + /// src 없는 img (data-src 만 등)·img 없는 picture + pub img_missing_src: usize, + /// Google 이미지 미지원 형식의 img src + pub img_unsupported: Vec, + /// 인라인 style 로 숨긴 텍스트·링크 + pub hidden_text: Vec, + /// 퍼센트 인코딩 안 된 링크 URL (공백·비ASCII) + pub unencoded_links: Vec, + /// 외부 링크 rel 별 수 (sponsored, ugc, nofollow) + pub outbound_sponsored: usize, + pub outbound_ugc: usize, + pub outbound_nofollow: usize, + pub outbound_total: usize, + /// 밑줄로 단어를 구분한 같은 호스트 링크 경로 + pub underscore_paths: Vec, + /// Yandex `` 여는·닫는 태그 수 + pub yandex_noindex_open: usize, + pub yandex_noindex_close: usize, + /// apple-itunes-app meta 가 head 밖에 있음 + pub itunes_meta_outside_head: bool, + /// 본문에서 가장 많이 쓴 문자 체계 + pub body_script: Option<&'static str>, +} + +fn push(v: &mut Vec, s: &str) { + if v.len() < 20 && !v.iter().any(|x| x == s) { + v.push(s.to_string()); + } +} + +fn own_text(el: &ElementRef) -> bool { + el.children() + .any(|c| matches!(c.value(), Node::Text(t) if !t.trim().is_empty())) +} + +pub fn extract(doc: &Html, html: &str, base: &Url) -> GoogleFacts { + let mut f = GoogleFacts { + yandex_noindex_open: YANDEX_NOINDEX_OPEN.find_iter(html).count(), + yandex_noindex_close: YANDEX_NOINDEX_CLOSE.find_iter(html).count(), + ..Default::default() + }; + let host = base.host_str().unwrap_or_default(); + for el in doc.select(&ALL) { + let e = el.value(); + let name = e.name(); + let get = |a: &str| e.attr(a).map(str::trim); + let rel = get("rel").unwrap_or_default().to_ascii_lowercase(); + let rels: Vec<&str> = rel.split_ascii_whitespace().collect(); + if e.attr("data-nosnippet").is_some() && !matches!(name, "span" | "div" | "section") { + push(&mut f.data_nosnippet_invalid, name); + } + if name == "link" + && rels.contains(&"alternate") + && let Some(lang) = get("hreflang") + { + f.hreflang.push(HreflangLink { + lang: lang.to_string(), + href: get("href").unwrap_or_default().to_string(), + media: e.attr("media").is_some(), + }); + } + if matches!(name, "link" | "a") { + f.rel_prev |= rels.contains(&"prev") || rels.contains(&"previous"); + f.rel_next |= rels.contains(&"next"); + } + if name == "img" { + let src = get("src").unwrap_or_default(); + if src.is_empty() { + f.img_missing_src += 1; + } else if !src.starts_with("data:") { + let path = src.split(['?', '#']).next().unwrap_or_default(); + let file = path.rsplit('/').next().unwrap_or_default(); + if let Some((_, ext)) = file.rsplit_once('.') + && ext.len() <= 5 + && !IMAGE_FORMATS.contains(&ext.to_ascii_lowercase().as_str()) + { + push(&mut f.img_unsupported, src); + } + } + } + if name == "picture" + && !el + .children() + .filter_map(ElementRef::wrap) + .any(|c| c.value().name() == "img") + { + f.img_missing_src += 1; + } + if let Some(style) = get("style") + && HIDDEN_STYLE.is_match(style) + && (own_text(&el) || name == "a") + { + push(&mut f.hidden_text, &format!("{name}[style=\"{style}\"]")); + } + if name == "a" + && let Some(href) = e.attr("href") + { + let h = href.trim(); + if h.contains(' ') || !h.is_ascii() { + push(&mut f.unencoded_links, h); + } + if let Ok(u) = base.join(h) + && matches!(u.scheme(), "http" | "https") + { + if u.host_str() == Some(host) { + if u.path().contains('_') { + push(&mut f.underscore_paths, u.path()); + } + } else { + f.outbound_total += 1; + f.outbound_sponsored += usize::from(rels.contains(&"sponsored")); + f.outbound_ugc += usize::from(rels.contains(&"ugc")); + f.outbound_nofollow += usize::from(rels.contains(&"nofollow")); + } + } + } + if name == "meta" + && get("name").is_some_and(|n| n.eq_ignore_ascii_case("apple-itunes-app")) + && !el + .ancestors() + .filter_map(ElementRef::wrap) + .any(|a| a.value().name() == "head") + { + f.itunes_meta_outside_head = true; + } + } + let mut text = String::new(); + if let Some(body) = doc + .select(&Selector::parse("body").expect("valid selector")) + .next() + { + for node in body.descendants() { + if let Some(t) = node.value().as_text() + && !node.ancestors().filter_map(ElementRef::wrap).any(|a| { + matches!( + a.value().name(), + "script" | "style" | "noscript" | "template" + ) + }) + && text.len() < 20_000 + { + text.push_str(t); + } + } + } + f.body_script = dominant_script(&text); + f +} + +/// Google 이 정의한 robots meta 규칙 (robots-tags.json) + 다른 검색엔진의 알려진 값. +pub const KNOWN_ROBOTS: &[&str] = &[ + "all", + "noindex", + "nofollow", + "none", + "nosnippet", + "indexifembedded", + "max-snippet", + "max-image-preview", + "max-video-preview", + "notranslate", + "noimageindex", + "unavailable_after", + "index", + "follow", + "noarchive", + "nocache", + "nosourceinfo", + "noodp", + "noydir", + "noyaca", + "ai-training", + "ai-grounding", +]; + +/// hreflang 값이 ISO 639-1(-ISO 3166-1 alpha-2) 또는 x-default 인지. +pub fn hreflang_valid(code: &str) -> bool { + static RE: LazyLock = LazyLock::new(|| { + Regex::new(r"(?i)^(?:x-default|[a-z]{2}(?:-[a-z]{4})?(?:-[a-z]{2})?)$").unwrap() + }); + RE.is_match(code.trim()) && !code.trim().eq_ignore_ascii_case("en-uk") +} + +/// 문자열에서 가장 많이 쓴 문자 체계 (hangul/latin/han/kana/cyrillic/arabic/other). 글자가 없으면 None. +pub fn dominant_script(text: &str) -> Option<&'static str> { + let mut counts = [0usize; 6]; + for c in text.chars().filter(|c| c.is_alphabetic()) { + let i = match c as u32 { + 0xAC00..=0xD7A3 | 0x1100..=0x11FF | 0x3130..=0x318F => 0, + 0x41..=0x5A | 0x61..=0x7A | 0xC0..=0x24F => 1, + 0x4E00..=0x9FFF | 0x3400..=0x4DBF => 2, + 0x3040..=0x30FF => 3, + 0x400..=0x4FF => 4, + 0x600..=0x6FF => 5, + _ => continue, + }; + counts[i] += 1; + } + let (i, n) = counts.iter().enumerate().max_by_key(|(_, n)| **n)?; + (*n > 0).then_some(["hangul", "latin", "han", "kana", "cyrillic", "arabic"][i]) +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn extracts_signals() { + let base = Url::parse("https://a.com/").unwrap(); + let html = r#" + +

x

ok + +

숨김

안쪽
+한글광고댓글 +밑줄메일 +숨김"#; + let f = extract(&Html::parse_document(html), html, &base); + assert_eq!(f.data_nosnippet_invalid, ["p"]); + assert_eq!(f.hreflang.len(), 2); + assert!(f.hreflang[0].media && !f.hreflang[1].media); + assert!(f.rel_prev && f.rel_next); + assert_eq!(f.img_missing_src, 2); + assert_eq!(f.img_unsupported, ["b.tiff?x=1"]); + assert_eq!(f.hidden_text.len(), 2, "{:?}", f.hidden_text); + assert_eq!(f.unencoded_links, ["/검색 결과"]); + assert_eq!( + ( + f.outbound_total, + f.outbound_sponsored, + f.outbound_ugc, + f.outbound_nofollow + ), + (2, 1, 1, 1) + ); + assert_eq!(f.underscore_paths, ["/my_page"]); + assert_eq!((f.yandex_noindex_open, f.yandex_noindex_close), (2, 1)); + assert!(!f.itunes_meta_outside_head); + assert_eq!(f.body_script, Some("hangul")); + let html = r#""#; + assert!(extract(&Html::parse_document(html), html, &base).itunes_meta_outside_head); + } + + #[test] + fn helpers() { + for c in ["en", "ko-KR", "zh-Hant-TW", "x-default", "EN-us"] { + assert!(hreflang_valid(c), "{c}"); + } + for c in ["en-UK", "kor", "es-419", ""] { + assert!(!hreflang_valid(c), "{c}"); + } + assert_eq!( + dominant_script("데브파이브 홈페이지 DevFive"), + Some("hangul") + ); + assert_eq!(dominant_script("Hello 세계"), Some("latin")); + assert_eq!(dominant_script("中文 日本語 かな"), Some("han")); + assert_eq!(dominant_script("かなカナ"), Some("kana")); + assert_eq!(dominant_script("Привет"), Some("cyrillic")); + assert_eq!(dominant_script("مرحبا"), Some("arabic")); + assert_eq!(dominant_script("123 !!"), None); + assert_eq!(dominant_script("ไทย"), None); + } +} diff --git a/crates/devup-access-checker/src/html.rs b/crates/devup-access-checker/src/html.rs index 338b4a2..e7238ca 100644 --- a/crates/devup-access-checker/src/html.rs +++ b/crates/devup-access-checker/src/html.rs @@ -96,6 +96,7 @@ pub struct PageFacts { pub spec: crate::spec::SpecFacts, pub search: crate::search::SearchFacts, pub sec: crate::sec::SecFacts, + pub google: crate::google::GoogleFacts, /// 신뢰·법적 정보 pub trust: crate::trust::TrustFacts, } @@ -368,6 +369,7 @@ pub fn extract(html: &str, page_url: &Url) -> PageFacts { f.spec = crate::spec::extract(&doc); f.search = crate::search::extract(&doc, base); f.sec = crate::sec::extract(&doc, base); + f.google = crate::google::extract(&doc, html, base); f } diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 455450c..0b11b88 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -18,6 +18,7 @@ mod checks; mod css; mod extra; mod fetch; +mod google; mod html; mod llms; mod model; @@ -761,22 +762,34 @@ impl Checker { let url = at("/.well-known/change-password"); Some(fetch::redirect_chain(&opts.user_agent, opts.probe_timeout, &url, 0).await) }; + let conditional = async { + let etag = page.headers.get("etag").and_then(|v| v.to_str().ok()); + let lm = page + .headers + .get("last-modified") + .and_then(|v| v.to_str().ok()); + if etag.is_none() && lm.is_none() { + return None; + } + Some(fetch::conditional_status(&probe, &base, etag, lm).await) + }; let gpc_url = at("/.well-known/gpc.json"); let gpc = fetch::probe_file(&probe, &gpc_url, Json); let ( (feed, bing, not_found_chain, indexnow), (llms_subpath, agent_card, robots_chain), - (change_password, gpc), + (change_password, gpc, conditional), ) = tokio::join!( async { tokio::join!(feed, bing, not_found_chain, indexnow) }, async { tokio::join!(llms_subpath, agent_card, robots_chain) }, - async { tokio::join!(change_password, gpc) }, + async { tokio::join!(change_password, gpc, conditional) }, ); checks::SearchProbes { llms_subpath, agent_card: Some(agent_card), change_password, gpc: Some(gpc), + conditional, robots_chain, feed, bing_site_auth: Some(bing), diff --git a/crates/devup-access-checker/src/robots.rs b/crates/devup-access-checker/src/robots.rs index 6801ee1..36a393c 100644 --- a/crates/devup-access-checker/src/robots.rs +++ b/crates/devup-access-checker/src/robots.rs @@ -31,6 +31,12 @@ pub struct Robots { pub licenses: Vec, /// 첫 `User-agent` 앞에 있어 어느 그룹에도 속하지 않는 Allow/Disallow 수 pub orphan_rules: usize, + /// 규칙 형식 오류 (경로가 `/`·`*` 로 시작하지 않음, 1024자 초과, 비ASCII, 절대 URL 이 아닌 Sitemap) + pub rule_errors: Vec, + /// Google 이 지원하지 않는 지시자 줄 (noindex·host·request-rate·visit-time) + pub unsupported: Vec, + /// Yandex `Clean-param` 값 + pub clean_params: Vec, } impl Robots { @@ -54,15 +60,42 @@ impl Robots { if !last_was_agent && let Some(g) = current.take() { robots.groups.push(g); } + // Google: 제품 토큰 뒤의 텍스트(`Googlebot/2.1`)는 무시한다 + let token = if value.starts_with('*') { + "*".to_string() + } else { + value + .split(['/', ' ', '*']) + .next() + .unwrap_or_default() + .to_ascii_lowercase() + }; current .get_or_insert_with(Group::default) .agents - .push(value.to_ascii_lowercase()); + .push(token); last_was_agent = true; } "allow" | "disallow" => { last_was_agent = false; robots.orphan_rules += usize::from(current.is_none()); + if !value.is_empty() { + let problem = if !(value.starts_with('/') || value.starts_with('*')) { + Some("경로가 / 로 시작하지 않음") + } else if value.len() > 1024 { + Some("1024자 초과") + } else if !value.is_ascii() { + Some("비ASCII 문자 (퍼센트 인코딩 필요)") + } else { + None + }; + if let Some(p) = problem { + robots.rule_errors.push(format!( + "{p}: {}", + line.chars().take(120).collect::() + )); + } + } if let Some(g) = current.as_mut() && !value.is_empty() { @@ -76,10 +109,15 @@ impl Robots { // RFC 상 그룹과 무관한 전역 지시자. `Sitemap: https://...` 의 콜론 이후 전체를 사용. if !value.is_empty() { robots.sitemaps.push(value.to_string()); + let lower = value.to_ascii_lowercase(); + if !(lower.starts_with("http://") || lower.starts_with("https://")) { + robots + .rule_errors + .push(format!("Sitemap 이 절대 URL 이 아님: {value}")); + } } } "crawl-delay" => { - last_was_agent = false; let agents = current .as_ref() .map(|g| g.agents.join(",")) @@ -87,7 +125,6 @@ impl Robots { robots.crawl_delays.push((agents, value.to_string())); } "content-signal" | "content-usage" => { - last_was_agent = false; let agents = current .as_ref() .map(|g| g.agents.join(",")) @@ -104,9 +141,10 @@ impl Robots { robots.licenses.push(value.to_string()); } } - // 표준 외이지만 널리 쓰이는 지시자 - "host" | "clean-param" | "noindex" | "request-rate" | "visit-time" => { - last_was_agent = false + "clean-param" => robots.clean_params.push(value.to_string()), + // 표준 외 지시자 (Google 은 무시) + "host" | "noindex" | "request-rate" | "visit-time" => { + robots.unsupported.push(line.to_string()) } _ => { last_was_agent = false; @@ -134,6 +172,16 @@ impl Robots { .iter() .filter(|g| g.agents.contains(&token)) .collect(); + // 가장 구체적인 그룹: googlebot-image 는 googlebot 그룹을 따른다 (Google) + if selected.is_empty() + && let Some((family, _)) = token.split_once('-') + { + selected = self + .groups + .iter() + .filter(|g| g.agents.iter().any(|a| a == family)) + .collect(); + } // Applebot 은 자기 그룹이 없으면 Googlebot 규칙을 따른다 (Apple 문서) if selected.is_empty() && token == "applebot" { selected = self @@ -307,4 +355,29 @@ Sitemap: https://example.com/sitemap.xml # main let r = Robots::parse("User-agent: *\nDisallow: /\n"); assert!(!r.is_allowed("Applebot", "/")); } + + #[test] + fn google_parsing_rules() { + let r = Robots::parse( + "User-agent: Googlebot/2.1 (+http://www.google.com/bot.html)\nCrawl-delay: 5\nUser-agent: Daum\nDisallow: /private\n\ + Disallow: private2\nAllow: /한글\nDisallow: /xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nSitemap: /sitemap.xml\nHost: a.com\nNoindex: /x\n\ + Clean-param: ref /some_dir/\nUser-agent: *star\nAllow: /\n", + ); + assert!( + !r.is_allowed("Googlebot", "/private"), + "Crawl-delay 는 그룹을 끊지 않는다" + ); + assert!(!r.is_allowed("daum", "/private")); + assert!( + !r.is_allowed("Googlebot-Image", "/private"), + "googlebot 그룹을 따른다" + ); + assert!( + r.is_allowed("Mistral-AI", "/private"), + "그룹 없는 계열은 * 로" + ); + assert_eq!(r.rule_errors.len(), 4, "{:?}", r.rule_errors); + assert_eq!(r.unsupported, ["Host: a.com", "Noindex: /x"]); + assert_eq!(r.clean_params, ["ref /some_dir/"]); + } } diff --git a/crates/devup-access-checker/src/sitemap.rs b/crates/devup-access-checker/src/sitemap.rs index 810a243..04ff353 100644 --- a/crates/devup-access-checker/src/sitemap.rs +++ b/crates/devup-access-checker/src/sitemap.rs @@ -69,6 +69,16 @@ pub struct SitemapIssues { pub invalid_loc: Vec, /// sitemap 파일이 있는 디렉터리 밖(또는 스킴·포트가 다른) 같은 호스트 URL pub out_of_scope: Vec, + /// 구조 오류 (루트 요소, loc 없는 url, 중첩 index) + pub structure_errors: Vec, + /// lastmod 값 전체 + pub lastmods: Vec, + /// 확장 사용 수 (image, video, news, xhtml:link) + pub extensions: [usize; 4], + /// 확장 태그 오류 + pub extension_errors: Vec, + /// news:publication_date 값 + pub news_dates: Vec, } fn sample(v: &mut Vec, s: &str) { @@ -100,6 +110,70 @@ pub fn validate(xml: &str, sitemap_url: &url::Url) -> SitemapIssues { sample(&mut out.invalid_lastmod, &c[1]); } } + static URL_BLOCK: LazyLock = + LazyLock::new(|| Regex::new(r"(?is)(.*?)").unwrap()); + static VIDEO: LazyLock = + LazyLock::new(|| Regex::new(r"(?is)(.*?)").unwrap()); + static NEWS: LazyLock = + LazyLock::new(|| Regex::new(r"(?is)(.*?)").unwrap()); + static NEWS_DATE: LazyLock = LazyLock::new(|| { + Regex::new(r"(?is)\s*(.*?)\s*").unwrap() + }); + let lower = xml.to_ascii_lowercase(); + if !lower.contains(" 1 { + out.structure_errors.push("sitemap index 안에 index".into()); + } + for c in URL_BLOCK.captures_iter(xml) { + if !c[1].to_ascii_lowercase().contains(" 1000 { + sample(&mut out.extension_errors, "url 하나에 image 1000개 초과"); + } + } + out.lastmods = LASTMOD_VALUE + .captures_iter(xml) + .map(|c| c[1].to_string()) + .collect(); + out.extensions = [" 1000 { + out.extension_errors.push("news 1000개 초과".into()); + } + for c in VIDEO.captures_iter(xml) { + let b = c[1].to_ascii_lowercase(); + let missing: Vec<&str> = ["thumbnail_loc", "title", "description"] + .into_iter() + .filter(|t| !b.contains(&format!("https://a.com/x
", &root, ); - assert_eq!(v, SitemapIssues::default()); + assert_eq!(v.out_of_scope, Vec::::new()); + assert!(v.structure_errors.is_empty() && v.extension_errors.is_empty()); + let ext = validate( + "2030-01-01\ + https://a.com/vt\ + 2026-01-01\ + ", + &root, + ); + assert_eq!( + ext.structure_errors, + ["sitemap index 안에 index", "loc 없는 url"] + ); + assert_eq!( + ext.extension_errors, + ["video 필수 태그 누락", "news 필수 태그 누락"] + ); + assert_eq!(ext.extensions, [1, 1, 1, 1]); + assert_eq!((ext.lastmods.len(), ext.news_dates.len()), (1, 1)); + let ok = validate( + "https://a.com/vtt\ + dp\ + nko\ + 2026t", + &root, + ); + assert!(ok.extension_errors.is_empty()); + assert_eq!( + validate("", &root).structure_errors, + ["루트 요소가 urlset·sitemapindex 가 아님"] + ); + let images: String = (0..1001).map(|_| "").collect(); + let news: String = (0..1001).map(|_| "").collect(); + let big = validate( + &format!("https://a.com/{images}{news}"), + &root, + ); + assert_eq!( + big.extension_errors, + ["url 하나에 image 1000개 초과", "news 1000개 초과"] + ); let many: String = (0..25).map(|_| "9").collect(); assert_eq!(validate(&many, &root).invalid_priority.len(), 20); } diff --git a/crates/devup-access-checker/tests/end_to_end.rs b/crates/devup-access-checker/tests/end_to_end.rs index 53f791f..793b134 100644 --- a/crates/devup-access-checker/tests/end_to_end.rs +++ b/crates/devup-access-checker/tests/end_to_end.rs @@ -1287,7 +1287,11 @@ async fn search_engine_network_items() { }; Mock::given(method("GET")) .and(path("/")) - .respond_with(ok("text/html", page)) + .respond_with( + ok("text/html", page) + .insert_header("etag", "\"v1\"") + .insert_header("last-modified", "Wed, 21 Oct 2026 07:28:00 GMT"), + ) .mount(&s) .await; Mock::given(method("GET")) From 2af3b3e02bef414cf31918ebf28361f42f8a01a0 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 16:25:57 +0900 Subject: [PATCH 18/21] =?UTF-8?q?feat:=20ARIA=20in=20HTML=C2=B7IBM=20Equal?= =?UTF-8?q?=20Access=C2=B7HTML=5FCodeSniffer=C2=B7WAVE=C2=B7W3C=20i18n?= =?UTF-8?q?=C2=B7EN=20301=20549=20=EB=8C=80=EC=A1=B0=EB=A1=9C=20=EC=A0=91?= =?UTF-8?q?=EA=B7=BC=EC=84=B1=2043=EA=B0=9C=20=EC=B6=94=EA=B0=80=20(632?= =?UTF-8?q?=EA=B0=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 역할·aria 속성 규칙(중복·불허·충돌·폐기), 랜드마크 이름, combobox, 초점, 폼 레이블·제출, 이미지·figure·canvas, 같은 페이지 링크 - 국제화: xml:lang·dir·bdo·translate·ruby·양방향 제어 문자·BOM·XML 선언·Content-Language meta - 접근성 성명 링크, 문서 링크, schema.org 접근성 메타데이터 Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_initial-release.json | 2 +- README.md | 43 + crates/devup-access-checker/src/aria.rs | 1069 +++++++++++++++++ crates/devup-access-checker/src/catalog.rs | 203 ++++ crates/devup-access-checker/src/checks.rs | 432 +++++++ crates/devup-access-checker/src/css.rs | 5 + crates/devup-access-checker/src/html.rs | 2 + crates/devup-access-checker/src/lib.rs | 1 + 8 files changed, 1756 insertions(+), 1 deletion(-) create mode 100644 crates/devup-access-checker/src/aria.rs diff --git a/.changepacks/changepack_log_initial-release.json b/.changepacks/changepack_log_initial-release.json index e1bc877..ea8db05 100644 --- a/.changepacks/changepack_log_initial-release.json +++ b/.changepacks/changepack_log_initial-release.json @@ -1 +1 @@ -{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 589개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} +{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 632개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} diff --git a/README.md b/README.md index 9db3e21..6fc7ea7 100644 --- a/README.md +++ b/README.md @@ -343,6 +343,8 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `content.unencoded_link_urls` | 퍼센트 인코딩 안 된 링크 URL (공백·비ASCII) | | `content.outbound_link_qualifiers` | 외부 링크 rel (sponsored·ugc·nofollow) | | `content.underscore_url_paths` | 밑줄로 단어를 구분한 URL | +| `content.linked_documents` | 비HTML 문서 링크 (PDF·HWP·Office) | +| `content.bidi_control_chars` | 본문의 양방향 제어 문자 | | `performance.render_blocking_scripts` | head 렌더링 차단 스크립트 (async/defer 없음) | | `performance.head_stylesheets` | head 외부 스타일시트 | | `performance.preconnect` | preconnect / dns-prefetch | @@ -452,6 +454,43 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `accessibility.obsolete_attributes` | 폐기된 HTML 속성 (align·bgcolor·border 등) | | `accessibility.onfocus_navigation` | 초점만 받아도 이동·제출하는 onfocus | | `accessibility.video_audio_description_missing` | 음성 해설 트랙 없는 영상 | +| `accessibility.statement_link` | 접근성 성명(정책) 링크 | +| `accessibility.media_controls_missing` | 기본 컨트롤 없는 video·audio | +| `accessibility.aria_role_redundant` | 암묵 역할과 같은 명시 role | +| `accessibility.aria_role_not_allowed` | 요소에 허용되지 않는 role | +| `accessibility.aria_attr_on_prohibited_element` | aria-* 를 쓸 수 없는 요소의 aria 속성 | +| `accessibility.aria_attr_not_allowed_for_role` | 역할에 허용되지 않는 aria-* 속성 | +| `accessibility.aria_html_attr_conflict` | HTML 속성과 충돌하는 aria-* | +| `accessibility.aria_html_attr_redundant` | HTML 속성과 중복된 aria-* | +| `accessibility.aria_deprecated_attr` | 폐기된 ARIA 속성 (aria-grabbed·aria-dropeffect) | +| `accessibility.presentational_children_roles` | 자식이 무시되는 역할 안의 의미 요소 | +| `accessibility.presentation_semantic_children` | role=presentation 인데 의미 구조를 가진 표·목록 | +| `accessibility.duplicate_landmark_names` | 같은 역할·같은 이름의 랜드마크 | +| `accessibility.landmark_role_unnamed` | 이름 없는 region·application | +| `accessibility.activedescendant_unfocusable` | 초점을 받을 수 없는 aria-activedescendant 소유자 | +| `accessibility.combobox_pattern_invalid` | 잘못된 combobox 패턴 | +| `accessibility.tabbable_non_interactive` | 역할 없이 tabindex 로 초점을 받는 요소 | +| `accessibility.iframe_tabindex_negative` | tabindex=-1 로 탭 순서에서 빠진 iframe | +| `accessibility.empty_labels` | 내용 없는 label | +| `accessibility.label_for_not_control` | 입력 요소가 아닌 대상을 가리키는 label[for] | +| `accessibility.placeholder_only_label` | placeholder 외에 보이는 레이블이 없는 입력 | +| `accessibility.form_submit_missing` | 제출 버튼 없는 form | +| `accessibility.decorative_img_conflict` | 장식 표시가 충돌하는 이미지 | +| `accessibility.alt_redundant_with_text` | 링크 텍스트와 중복된 이미지 alt | +| `accessibility.adjacent_duplicate_links` | 같은 URL 로 가는 연속 링크 | +| `accessibility.figure_unlabeled` | 캡션·이름 없는 figure | +| `accessibility.canvas_fallback_missing` | 대체 콘텐츠 없는 canvas | +| `accessibility.redundant_title_attr` | 텍스트와 같은 title 속성 | +| `accessibility.broken_fragment_links` | 대상이 없는 같은 페이지 링크 (건너뛰기 링크 포함) | +| `accessibility.mouse_only_handlers` | 키보드 대응 없는 마우스 이벤트 | +| `accessibility.css_blink` | CSS text-decoration: blink | +| `accessibility.xml_lang_without_lang` | lang 없는 xml:lang·불일치 | +| `accessibility.dir_invalid` | 잘못된 dir 값 | +| `accessibility.rtl_dir_missing` | RTL 언어인데 dir=rtl 없음 | +| `accessibility.css_direction` | CSS 로 지정한 글 방향 (direction·unicode-bidi) | +| `accessibility.bdo_without_dir` | dir 없는(또는 auto) bdo | +| `accessibility.translate_invalid` | 잘못된 translate 값 | +| `accessibility.ruby_without_rt` | rt 없는 ruby | | `trust.privacy_policy` | 개인정보처리방침 링크 | | `trust.terms` | 이용약관 링크 | | `trust.phone` | 전화번호 링크 (tel:) | @@ -630,6 +669,9 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `meta.title_script_mismatch` | title 과 본문의 문자 체계 불일치 | | `meta.apple_app_site_association_valid` | AASA 파일 요건 위반 | | `meta.apple_itunes_app_valid` | apple-itunes-app 형식 오류 | +| `meta.bom_in_content` | 본문 중간의 BOM (U+FEFF) | +| `meta.xml_declaration` | text/html 문서의 XML 선언 | +| `meta.content_language_meta` | 폐기된 Content-Language meta | | `structured_data.hreflang_reciprocal` | hreflang 상호 참조 | | `structured_data.unknown_types` | schema.org 에 없는 @type | | `structured_data.rdfa` | RDFa | @@ -653,6 +695,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `structured_data.website_duplicate` | WebSite 구조화 데이터 중복 | | `structured_data.site_name_mismatch` | WebSite.name 과 og:site_name 불일치 | | `structured_data.is_accessible_for_free` | isAccessibleForFree (유료 콘텐츠 표시) | +| `structured_data.accessibility_metadata` | schema.org 접근성 메타데이터 | | `performance.external_css` | 외부 CSS 분석 | | `performance.font_face_without_display` | font-display 없는 @font-face | | `performance.page_weight` | 페이지 리소스 무게 | diff --git a/crates/devup-access-checker/src/aria.rs b/crates/devup-access-checker/src/aria.rs new file mode 100644 index 0000000..54754fe --- /dev/null +++ b/crates/devup-access-checker/src/aria.rs @@ -0,0 +1,1069 @@ +//! ARIA in HTML·IBM Equal Access·HTML_CodeSniffer·WAVE·W3C i18n checker·EN 301 549 와 대조해 추가한 정적 신호. +//! 대조 결과는 `docs/coverage.md` 에 있다. 네트워크 접근 없음. + +use std::collections::HashMap; +use std::sync::LazyLock; + +use regex::Regex; +use scraper::{ElementRef, Html, Selector}; +use url::Url; + +static ALL: LazyLock = LazyLock::new(|| Selector::parse("*").expect("valid selector")); +static BLINK: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)text-decoration(?:-line)?\s*:[^;}]*\bblink\b").unwrap()); +static DIRECTION: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)\bdirection\s*:\s*(?:rtl|ltr)|unicode-bidi\s*:").unwrap()); + +/// 역할을 지정할 수 없는 요소 (ARIA in HTML "No role") +const NO_ROLE: &[&str] = &[ + "base", "col", "colgroup", "head", "link", "map", "meta", "noscript", "param", "script", + "slot", "source", "style", "template", "title", "track", "dd", "label", "legend", "picture", + "datalist", +]; +/// 자기 역할만 허용하는 요소 +const OWN_ROLE: &[(&str, &str)] = &[ + ("main", "main"), + ("meter", "meter"), + ("progress", "progressbar"), + ("optgroup", "group"), + ("option", "option"), + ("textarea", "textbox"), + ("body", "generic"), +]; +/// aria-* 를 쓸 수 없는 요소 +const NO_ARIA: &[&str] = &[ + "base", "col", "colgroup", "head", "html", "link", "map", "meta", "noscript", "param", + "script", "slot", "source", "style", "template", "title", "track", "datalist", +]; +/// aria-hidden 만 쓸 수 있는 요소 +const ONLY_HIDDEN: &[&str] = &["br", "wbr", "picture"]; + +/// 역할에 묶인(전역이 아닌) ARIA 속성 → 허용 역할 (WAI-ARIA 1.2) +const ROLE_ATTRS: &[(&str, &[&str])] = &[ + ( + "aria-checked", + &[ + "checkbox", + "menuitemcheckbox", + "menuitemradio", + "option", + "radio", + "switch", + "treeitem", + ], + ), + ("aria-pressed", &["button"]), + ( + "aria-selected", + &[ + "gridcell", + "option", + "row", + "tab", + "columnheader", + "rowheader", + "treeitem", + ], + ), + ( + "aria-expanded", + &[ + "application", + "button", + "checkbox", + "combobox", + "gridcell", + "link", + "listbox", + "menuitem", + "row", + "rowheader", + "tab", + "treeitem", + "columnheader", + "menuitemcheckbox", + "menuitemradio", + "switch", + ], + ), + ( + "aria-valuenow", + &[ + "meter", + "progressbar", + "scrollbar", + "separator", + "slider", + "spinbutton", + ], + ), + ( + "aria-valuemin", + &[ + "meter", + "progressbar", + "scrollbar", + "separator", + "slider", + "spinbutton", + ], + ), + ( + "aria-valuemax", + &[ + "meter", + "progressbar", + "scrollbar", + "separator", + "slider", + "spinbutton", + ], + ), + ( + "aria-valuetext", + &[ + "meter", + "progressbar", + "scrollbar", + "separator", + "slider", + "spinbutton", + ], + ), + ( + "aria-level", + &["heading", "listitem", "row", "treeitem", "comment"], + ), + ( + "aria-multiselectable", + &["grid", "listbox", "tablist", "tree", "treegrid"], + ), + ( + "aria-required", + &[ + "checkbox", + "combobox", + "gridcell", + "listbox", + "radiogroup", + "spinbutton", + "textbox", + "searchbox", + "tree", + "columnheader", + "rowheader", + "treegrid", + ], + ), + ("aria-autocomplete", &["combobox", "searchbox", "textbox"]), + ("aria-multiline", &["textbox", "searchbox"]), + ("aria-placeholder", &["textbox", "searchbox"]), + ("aria-modal", &["dialog", "alertdialog"]), + ("aria-sort", &["columnheader", "rowheader"]), + ("aria-colcount", &["table", "grid", "treegrid"]), + ("aria-rowcount", &["table", "grid", "treegrid"]), +]; + +/// 자식이 표현용으로만 취급되는 역할 +const PRESENTATIONAL_CHILDREN: &[&str] = &[ + "button", + "checkbox", + "img", + "meter", + "menuitemcheckbox", + "menuitemradio", + "option", + "progressbar", + "radio", + "scrollbar", + "separator", + "slider", + "switch", + "tab", +]; +const LANDMARKS: &[&str] = &[ + "navigation", + "complementary", + "region", + "form", + "search", + "banner", + "contentinfo", + "main", +]; +const RTL_LANGS: &[&str] = &[ + "ar", "he", "iw", "fa", "ur", "yi", "ps", "sd", "ug", "dv", "ckb", "syr", +]; +const LABELABLE: &[&str] = &[ + "input", "select", "textarea", "button", "meter", "output", "progress", +]; +const DOC_EXTS: &[&str] = &[ + "pdf", "doc", "docx", "xls", "xlsx", "ppt", "pptx", "hwp", "hwpx", "odt", "rtf", +]; +const STATEMENT_WORDS: &[&str] = &[ + "accessibility", + "barrierefreiheit", + "accessibilité", + "accesibilidad", + "accessibilità", + "toegankelijkheid", + "웹 접근성", + "웹접근성", + "접근성 정책", + "접근성 안내", + "접근성 성명", +]; + +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct AriaFacts { + pub role_redundant: Vec, + pub role_not_allowed: Vec, + pub aria_on_prohibited: Vec, + pub attr_not_for_role: Vec, + pub attr_conflict: Vec, + pub attr_redundant: Vec, + pub deprecated_attrs: Vec, + pub presentational_children: Vec, + pub presentation_semantic: Vec, + pub duplicate_landmark_names: Vec, + pub unnamed_region_app: usize, + pub activedescendant_unfocusable: usize, + pub combobox_invalid: Vec, + pub tabbable_non_interactive: usize, + pub iframes: usize, + pub iframe_tabindex_negative: usize, + pub labels: usize, + pub empty_labels: usize, + pub label_for_not_control: Vec, + pub placeholder_only: usize, + pub forms_with_text: usize, + pub forms_without_submit: usize, + pub decorative_conflict: usize, + pub alt_redundant_with_text: usize, + pub adjacent_duplicate_links: usize, + pub figures: usize, + pub figures_unlabeled: usize, + pub canvases: usize, + pub canvases_without_fallback: usize, + pub redundant_title: usize, + pub broken_fragment_links: Vec, + /// 끊어진 같은 페이지 링크가 본문 첫 세 링크 안에 있음 (건너뛰기 링크) + pub broken_skip_link: bool, + pub mouse_only_handlers: usize, + pub inline_blink: usize, + pub media: usize, + pub media_without_controls: usize, + pub statement_links: Vec, + pub document_links: Vec<(String, usize)>, + pub xml_lang_issues: Vec, + pub dir_invalid: Vec, + pub any_dir_rtl: bool, + pub html_dir_rtl: bool, + pub inline_direction: usize, + pub bdo_without_dir: usize, + pub bidi_controls: usize, + pub translate_invalid: Vec, + pub ruby_without_rt: usize, + pub content_language_meta: Option, + pub bom_in_content: usize, + pub accessibility_metadata: Vec, +} + +fn push(v: &mut Vec, s: String) { + if v.len() < 20 && !v.contains(&s) { + v.push(s); + } +} + +fn has_attr(el: &ElementRef, a: &str) -> bool { + el.value().attr(a).is_some() +} + +fn attr_lc(el: &ElementRef, a: &str) -> Option { + el.value().attr(a).map(|v| v.trim().to_ascii_lowercase()) +} + +fn text_of(el: &ElementRef) -> String { + el.text() + .collect::>() + .join(" ") + .split_whitespace() + .collect::>() + .join(" ") +} + +fn norm(s: &str) -> String { + s.chars() + .filter(|c| c.is_alphanumeric()) + .flat_map(char::to_lowercase) + .collect() +} + +fn named(el: &ElementRef) -> bool { + ["aria-label", "aria-labelledby", "title"] + .iter() + .any(|a| el.value().attr(a).is_some_and(|v| !v.trim().is_empty())) +} + +fn has_ancestor(el: &ElementRef, names: &[&str]) -> bool { + el.ancestors() + .filter_map(ElementRef::wrap) + .any(|a| names.contains(&a.value().name())) +} + +/// 요소의 암묵 역할 (주요 요소만). +pub fn implicit_role(el: &ElementRef) -> Option<&'static str> { + let name = el.value().name(); + let typ = attr_lc(el, "type").unwrap_or_default(); + Some(match name { + "a" | "area" if has_attr(el, "href") => "link", + "article" => "article", + "aside" => "complementary", + "button" => "button", + "datalist" => "listbox", + "details" => "group", + "dialog" => "dialog", + "fieldset" => "group", + "figure" => "figure", + "footer" if !has_ancestor(el, &["article", "aside", "main", "nav", "section"]) => { + "contentinfo" + } + "form" if named(el) => "form", + "h1" | "h2" | "h3" | "h4" | "h5" | "h6" => "heading", + "header" if !has_ancestor(el, &["article", "aside", "main", "nav", "section"]) => "banner", + "hr" => "separator", + "img" if el.value().attr("alt") == Some("") => "presentation", + "img" => "img", + "input" => match typ.as_str() { + "button" | "image" | "reset" | "submit" => "button", + "checkbox" => "checkbox", + "radio" => "radio", + "range" => "slider", + "number" => "spinbutton", + "search" if !has_attr(el, "list") => "searchbox", + "" | "text" | "email" | "tel" | "url" if !has_attr(el, "list") => "textbox", + "" | "text" | "email" | "tel" | "url" | "search" => "combobox", + _ => return None, + }, + "li" => "listitem", + "main" => "main", + "menu" | "ol" | "ul" => "list", + "meter" => "meter", + "nav" => "navigation", + "option" => "option", + "output" => "status", + "progress" => "progressbar", + "search" => "search", + "section" if named(el) => "region", + "select" + if has_attr(el, "multiple") + || attr_lc(el, "size").is_some_and(|s| s.parse::().is_ok_and(|n| n > 1)) => + { + "listbox" + } + "select" => "combobox", + "table" => "table", + "tbody" | "thead" | "tfoot" => "rowgroup", + "td" => "cell", + "th" => "columnheader", + "textarea" => "textbox", + "tr" => "row", + _ => return None, + }) +} + +fn explicit_role(el: &ElementRef) -> Option { + attr_lc(el, "role").and_then(|r| r.split_whitespace().next().map(str::to_string)) +} + +fn natively_focusable(el: &ElementRef) -> bool { + match el.value().name() { + "a" | "area" => has_attr(el, "href"), + "button" | "select" | "textarea" | "iframe" | "summary" => true, + "input" => attr_lc(el, "type").as_deref() != Some("hidden"), + _ => has_attr(el, "contenteditable"), + } +} + +pub fn extract(doc: &Html, base: &Url) -> AriaFacts { + let mut f = AriaFacts::default(); + let ids: HashMap<&str, ElementRef> = doc + .select(&ALL) + .filter_map(|e| e.value().attr("id").map(|i| (i, e))) + .collect(); + let anchors: Vec<&str> = doc + .select(&ALL) + .filter(|e| e.value().name() == "a") + .filter_map(|e| e.value().attr("name")) + .collect(); + let role_attrs: HashMap<&str, &[&str]> = ROLE_ATTRS.iter().copied().collect(); + let mut landmark_names: Vec<(String, String)> = Vec::new(); + let mut body_links = 0usize; + let mut prev_link: Option<(String, ElementRef)> = None; + + for el in doc.select(&ALL) { + let e = el.value(); + let name = e.name(); + let role = explicit_role(&el); + let implicit = implicit_role(&el); + let effective = role.clone().or_else(|| implicit.map(str::to_string)); + let tag = |s: &str| format!("{name}: {s}"); + + // ===== 역할 ===== + if let Some(r) = &role { + if implicit == Some(r.as_str()) || r == "generic" && name != "body" { + push(&mut f.role_redundant, tag(r)); + } + let own = OWN_ROLE.iter().find(|(n, _)| *n == name).map(|(_, r)| *r); + let hidden_input = name == "input" && attr_lc(&el, "type").as_deref() == Some("hidden"); + if NO_ROLE.contains(&name) || hidden_input || own.is_some_and(|o| o != r) { + push(&mut f.role_not_allowed, tag(r)); + } + if (r == "region" || r == "application") && !named(&el) { + f.unnamed_region_app += 1; + } + if r == "combobox" { + if el + .descendants() + .filter_map(ElementRef::wrap) + .skip(1) + .any(|d| { + explicit_role(&d).as_deref() == Some("textbox") + || d.value().name() == "input" + }) + { + push( + &mut f.combobox_invalid, + "ARIA 1.1 패턴 (combobox 안에 textbox)".into(), + ); + } + if attr_lc(&el, "aria-autocomplete").as_deref() == Some("inline") { + push(&mut f.combobox_invalid, "aria-autocomplete=inline".into()); + } + } + if (r == "presentation" || r == "none") + && matches!(name, "table" | "ul" | "ol" | "dl") + && el + .descendants() + .filter_map(ElementRef::wrap) + .skip(1) + .any(|d| { + matches!( + d.value().name(), + "th" | "caption" + | "thead" + | "tfoot" + | "h1" + | "h2" + | "h3" + | "h4" + | "h5" + | "h6" + ) || has_attr(&d, "scope") + || has_attr(&d, "headers") + }) + { + push(&mut f.presentation_semantic, tag(r)); + } + } + if let Some(r) = &effective { + if PRESENTATIONAL_CHILDREN.contains(&r.as_str()) + && !(name == "img" + || name == "input" + || name == "meter" + || name == "progress" + || name == "hr") + && el + .descendants() + .filter_map(ElementRef::wrap) + .skip(1) + .any(|d| { + has_attr(&d, "role") + || matches!( + d.value().name(), + "h1" | "h2" + | "h3" + | "h4" + | "h5" + | "h6" + | "ul" + | "ol" + | "table" + | "nav" + | "main" + ) + }) + { + push(&mut f.presentational_children, tag(r)); + } + if LANDMARKS.contains(&r.as_str()) && named(&el) { + let label = attr_lc(&el, "aria-label") + .or_else(|| attr_lc(&el, "title")) + .unwrap_or_else(|| { + attr_lc(&el, "aria-labelledby") + .and_then(|id| ids.get(id.as_str()).map(|t| text_of(t).to_lowercase())) + .unwrap_or_default() + }); + landmark_names.push((r.clone(), label)); + } + } + + // ===== aria-* 속성 ===== + let arias: Vec<(&str, &str)> = e.attrs().filter(|(k, _)| k.starts_with("aria-")).collect(); + if !arias.is_empty() { + let hidden_input = name == "input" && attr_lc(&el, "type").as_deref() == Some("hidden"); + if NO_ARIA.contains(&name) + || hidden_input + || (ONLY_HIDDEN.contains(&name) && arias.iter().any(|(k, _)| *k != "aria-hidden")) + { + push(&mut f.aria_on_prohibited, name.to_string()); + } + } + for (k, v) in &arias { + if matches!(*k, "aria-grabbed" | "aria-dropeffect") { + push(&mut f.deprecated_attrs, k.to_string()); + } + if let Some(allowed) = role_attrs.get(k) + && !effective.as_deref().is_some_and(|r| allowed.contains(&r)) + { + push(&mut f.attr_not_for_role, format!("{name}[{k}]")); + } + let v = v.trim().to_ascii_lowercase(); + let conflict = match *k { + "aria-disabled" => has_attr(&el, "disabled") && v == "false", + "aria-readonly" => { + (has_attr(&el, "readonly") && v == "false") + || (has_attr(&el, "contenteditable") && v == "true") + } + "aria-required" => has_attr(&el, "required") && v == "false", + "aria-hidden" => { + attr_lc(&el, "hidden").as_deref() == Some("until-found") && v == "true" + } + "aria-placeholder" => has_attr(&el, "placeholder"), + "aria-valuemax" => { + has_attr(&el, "max") + && el.value().attr("max").map(str::trim) != Some(v.as_str()) + } + "aria-valuemin" => { + has_attr(&el, "min") + && el.value().attr("min").map(str::trim) != Some(v.as_str()) + } + "aria-checked" => { + name == "input" + && matches!(attr_lc(&el, "type").as_deref(), Some("checkbox" | "radio")) + } + "aria-selected" => name == "option", + "aria-multiselectable" => name == "select", + "aria-haspopup" => name == "input" && has_attr(&el, "list"), + _ => false, + }; + if conflict { + push(&mut f.attr_conflict, format!("{name}[{k}]")); + } + let redundant = match *k { + "aria-disabled" => has_attr(&el, "disabled") && v == "true", + "aria-readonly" => has_attr(&el, "readonly") && v == "true", + "aria-required" => has_attr(&el, "required") && v == "true", + "aria-hidden" => { + attr_lc(&el, "hidden").is_some_and(|h| h != "until-found") && v == "true" + } + _ => false, + }; + if redundant { + push(&mut f.attr_redundant, format!("{name}[{k}]")); + } + } + if has_attr(&el, "aria-activedescendant") + && !natively_focusable(&el) + && !has_attr(&el, "tabindex") + { + f.activedescendant_unfocusable += 1; + } + let tabindex = attr_lc(&el, "tabindex").and_then(|t| t.parse::().ok()); + if tabindex.is_some_and(|t| t >= 0) && !natively_focusable(&el) && role.is_none() { + f.tabbable_non_interactive += 1; + } + if name == "iframe" { + f.iframes += 1; + f.iframe_tabindex_negative += usize::from(tabindex.is_some_and(|t| t < 0)); + } + + // ===== 폼 ===== + if name == "label" { + f.labels += 1; + let img_alt = el + .descendants() + .filter_map(ElementRef::wrap) + .filter(|d| d.value().name() == "img") + .any(|d| d.value().attr("alt").is_some_and(|a| !a.trim().is_empty())); + if text_of(&el).is_empty() && !img_alt && !named(&el) { + f.empty_labels += 1; + } + if let Some(target) = el.value().attr("for").and_then(|t| ids.get(t)) { + let tn = target.value().name(); + let hidden = tn == "input" && attr_lc(target, "type").as_deref() == Some("hidden"); + if !LABELABLE.contains(&tn) || hidden { + push(&mut f.label_for_not_control, format!("for → {tn}")); + } + } + } + if matches!(name, "input" | "textarea") + && e.attr("placeholder").is_some_and(|p| !p.trim().is_empty()) + { + let id = e.attr("id"); + let labelled = has_ancestor(&el, &["label"]) + || has_attr(&el, "aria-labelledby") + || id.is_some_and(|id| { + doc.select(&ALL) + .any(|l| l.value().name() == "label" && l.value().attr("for") == Some(id)) + }); + f.placeholder_only += usize::from(!labelled); + } + if name == "form" { + let fields = el.descendants().filter_map(ElementRef::wrap).filter(|d| { + (d.value().name() == "input" + && matches!( + attr_lc(d, "type").as_deref(), + None | Some( + "" | "text" + | "email" + | "search" + | "tel" + | "url" + | "password" + | "number" + ) + )) + || d.value().name() == "textarea" + }); + if fields.count() > 0 { + f.forms_with_text += 1; + let submit = el.descendants().filter_map(ElementRef::wrap).any(|d| { + (d.value().name() == "button" + && matches!(attr_lc(&d, "type").as_deref(), None | Some("submit"))) + || (d.value().name() == "input" + && matches!(attr_lc(&d, "type").as_deref(), Some("submit" | "image"))) + }) || e.attr("id").is_some_and(|id| { + doc.select(&ALL) + .any(|b| b.value().name() == "button" && b.value().attr("form") == Some(id)) + }); + f.forms_without_submit += usize::from(!submit); + } + } + + // ===== 이미지·미디어 ===== + if name == "img" { + let alt = e.attr("alt"); + if (alt == Some("") && named(&el)) + || (matches!(role.as_deref(), Some("presentation" | "none")) + && alt.is_some_and(|a| !a.trim().is_empty())) + { + f.decorative_conflict += 1; + } + if let Some(a) = alt.filter(|a| !a.trim().is_empty()) + && let Some(link) = el + .ancestors() + .filter_map(ElementRef::wrap) + .find(|x| x.value().name() == "a") + && norm(&text_of(&link)) == norm(a) + { + f.alt_redundant_with_text += 1; + } + } + if name == "figure" { + f.figures += 1; + let caption = el + .children() + .filter_map(ElementRef::wrap) + .any(|c| c.value().name() == "figcaption" && !text_of(&c).is_empty()); + f.figures_unlabeled += usize::from(!caption && !named(&el)); + } + if name == "canvas" { + f.canvases += 1; + let fallback = !text_of(&el).is_empty() + || el.children().filter_map(ElementRef::wrap).next().is_some(); + f.canvases_without_fallback += usize::from( + !fallback && !named(&el) && attr_lc(&el, "aria-hidden").as_deref() != Some("true"), + ); + } + if (name == "video" && !has_attr(&el, "muted")) || name == "audio" { + f.media += 1; + f.media_without_controls += usize::from(!has_attr(&el, "controls")); + } + if let Some(title) = e.attr("title").map(norm).filter(|t| !t.is_empty()) + && [ + Some(text_of(&el)), + e.attr("alt").map(str::to_string), + e.attr("aria-label").map(str::to_string), + ] + .into_iter() + .flatten() + .any(|x| norm(&x) == title) + { + f.redundant_title += 1; + } + + // ===== 링크 ===== + if name == "a" + && let Some(href) = e.attr("href").map(str::trim) + { + if has_ancestor(&el, &["body"]) { + body_links += 1; + } + if let Some(frag) = href.strip_prefix('#') + && !frag.is_empty() + && !matches!(frag, "top") + && !frag.starts_with('!') + && !frag.starts_with('/') + { + let target = percent_decode(frag); + if !ids.contains_key(target.as_str()) && !anchors.contains(&target.as_str()) { + push(&mut f.broken_fragment_links, href.to_string()); + f.broken_skip_link |= body_links <= 3; + } + } + let resolved = base.join(href).map(|u| u.to_string()).unwrap_or_default(); + if let Some((prev, prev_el)) = &prev_link + && *prev == resolved + && prev_el + .next_siblings() + .find(|n| !n.value().as_text().is_some_and(|t| t.trim().is_empty())) + .map(|n| n.id()) + == Some(el.id()) + { + f.adjacent_duplicate_links += 1; + } + prev_link = Some((resolved, el)); + } + let has = |a: &str| e.attr(a).is_some(); + if !natively_focusable(&el) + && ((has("onmouseover") && !has("onfocus")) + || (has("onmouseout") && !has("onblur")) + || ((has("onmousedown") || has("onmouseup")) + && !has("onkeydown") + && !has("onkeyup")) + || has("ondblclick") + || has("onmousemove")) + { + f.mouse_only_handlers += 1; + } + if let Some(style) = e.attr("style") { + f.inline_blink += usize::from(BLINK.is_match(style)); + f.inline_direction += usize::from(DIRECTION.is_match(style)); + } + if name == "a" + && let Some(href) = e.attr("href") + { + let label = format!( + "{} {} {}", + text_of(&el), + e.attr("aria-label").unwrap_or_default(), + e.attr("title").unwrap_or_default() + ) + .to_lowercase(); + let path = href.to_ascii_lowercase(); + if STATEMENT_WORDS.iter().any(|w| label.contains(w)) + || [ + "/accessibility", + "/barrierefreiheit", + "/accessibilite", + "/a11y", + ] + .iter() + .any(|p| path.contains(p)) + { + push(&mut f.statement_links, href.trim().to_string()); + } + let file = path.split(['?', '#']).next().unwrap_or_default(); + if let Some((_, ext)) = file.rsplit('/').next().unwrap_or_default().rsplit_once('.') + && DOC_EXTS.contains(&ext) + { + match f.document_links.iter_mut().find(|(x, _)| x == ext) { + Some((_, n)) => *n += 1, + None => f.document_links.push((ext.to_string(), 1)), + } + } + } + + // ===== 국제화 ===== + let lang = e.attr("lang"); + let xml_lang = e.attr("xml:lang"); + match (lang, xml_lang) { + (None, Some(x)) => push( + &mut f.xml_lang_issues, + format!("{name}: xml:lang={x} 만 있음"), + ), + (Some(l), Some(x)) if !l.trim().eq_ignore_ascii_case(x.trim()) => push( + &mut f.xml_lang_issues, + format!("{name}: lang={l} xml:lang={x}"), + ), + _ => {} + } + if let Some(d) = attr_lc(&el, "dir") { + if !matches!(d.as_str(), "ltr" | "rtl" | "auto") { + push(&mut f.dir_invalid, format!("{name}: {d}")); + } + f.any_dir_rtl |= d == "rtl"; + f.html_dir_rtl |= name == "html" && d == "rtl"; + } + if name == "bdo" && !matches!(attr_lc(&el, "dir").as_deref(), Some("ltr" | "rtl")) { + f.bdo_without_dir += 1; + } + if let Some(t) = attr_lc(&el, "translate") + && !matches!(t.as_str(), "" | "yes" | "no") + { + push(&mut f.translate_invalid, t); + } + if name == "ruby" + && !el + .descendants() + .filter_map(ElementRef::wrap) + .any(|d| d.value().name() == "rt") + { + f.ruby_without_rt += 1; + } + if name == "meta" && attr_lc(&el, "http-equiv").as_deref() == Some("content-language") { + f.content_language_meta = e.attr("content").map(str::to_string); + } + if let Some(v) = e.attr("itemprop") + && v.split_whitespace() + .any(|p| p.starts_with("accessibility") || p.starts_with("accessMode")) + { + push(&mut f.accessibility_metadata, v.to_string()); + } + } + // 같은 역할·같은 이름의 랜드마크 + for (i, (r, n)) in landmark_names.iter().enumerate() { + if landmark_names[..i] + .iter() + .any(|(r2, n2)| r2 == r && n2 == n) + { + push(&mut f.duplicate_landmark_names, format!("{r}: {n}")); + } + } + // 본문 텍스트의 양방향 제어 문자·중간 BOM + if let Some(body) = doc + .select(&Selector::parse("body").expect("valid selector")) + .next() + { + for t in body.text() { + f.bidi_controls += t + .chars() + .filter(|c| matches!(*c as u32, 0x202A..=0x202E | 0x2066..=0x2069)) + .count(); + f.bom_in_content += t.matches('\u{feff}').count(); + } + } + f +} + +fn percent_decode(s: &str) -> String { + url::form_urlencoded::parse(format!("x={s}").as_bytes()) + .next() + .map(|(_, v)| v.into_owned()) + .unwrap_or_default() +} + +/// RTL 문자를 쓰는 언어인지 (주 언어 하위 태그 또는 문자 체계 하위 태그 기준). +pub fn is_rtl_lang(lang: &str) -> bool { + let lower = lang.trim().to_ascii_lowercase(); + let mut parts = lower.split(['-', '_']); + let primary = parts.next().unwrap_or_default(); + RTL_LANGS.contains(&primary) + || parts.any(|p| { + matches!( + p, + "arab" | "hebr" | "thaa" | "syrc" | "nkoo" | "adlm" | "rohg" + ) + }) +} + +/// CSS 텍스트의 `text-decoration: blink` 수. +pub fn css_blink(css: &str) -> usize { + BLINK.find_iter(css).count() +} + +#[cfg(test)] +mod tests { + use super::*; + + fn run(html: &str) -> AriaFacts { + extract( + &Html::parse_document(html), + &Url::parse("https://a.com/").unwrap(), + ) + } + + #[test] + fn roles_and_attributes() { + let f = run(r#" +
+
+
+
+ + + +
+ +

제목

+
h
  • x
+
+메뉴 +
+
+x
+
+l + +
    +"#); + assert!(f.role_redundant.len() >= 10, "{:?}", f.role_redundant); + for s in [ + "button: button", + "nav: navigation", + "div: generic", + "header: banner", + "select: combobox", + "select: listbox", + "img: presentation", + "input: spinbutton", + ] { + assert!( + f.role_redundant.contains(&s.to_string()), + "{s} {:?}", + f.role_redundant + ); + } + assert!(!f.role_redundant.contains(&"body: generic".to_string())); + assert_eq!( + f.role_not_allowed, + ["label: button", "input: button", "main: region"] + ); + assert_eq!(f.aria_on_prohibited, ["meta", "br", "input"]); + assert_eq!( + f.attr_not_for_role, + ["div[aria-checked]", "select[aria-multiselectable]"] + ); + assert_eq!(f.attr_conflict.len(), 9, "{:?}", f.attr_conflict); + assert_eq!(f.attr_redundant.len(), 4, "{:?}", f.attr_redundant); + let mut dep = f.deprecated_attrs.clone(); + dep.sort(); + assert_eq!(dep, ["aria-dropeffect", "aria-grabbed"]); + assert_eq!(f.presentational_children, ["div: button", "button: button"]); + assert_eq!(f.presentation_semantic, ["table: presentation"]); + assert_eq!( + f.duplicate_landmark_names, + ["navigation: 메뉴", "complementary: 메뉴"] + ); + assert_eq!(f.unnamed_region_app, 1); + assert_eq!(f.activedescendant_unfocusable, 1); + assert_eq!(f.combobox_invalid.len(), 2); + assert_eq!(f.tabbable_non_interactive, 1); + } + + #[test] + fn forms_images_links_i18n() { + let f = run( + r##" +본문 바로가기위x한글a +
    + +
    +
    +로고홈 홈 +상품상품 +
    캡션
    +대체 + +링크같음 +
    +깜빡

    r

    b

    +접근성웹 접근성 정책pdfpdf2hwp +

    x

    y

    z

    qrs +

    t

    u

    漢漢한 +

    ‮뒤집힘 중간

    x
    +"##, + ); + assert_eq!(f.broken_fragment_links, ["#main", "#%EB%B3%B8"]); + assert!(f.broken_skip_link); + assert_eq!((f.labels, f.empty_labels), (6, 1)); + assert_eq!(f.label_for_not_control, ["for → div", "for → input"]); + assert_eq!(f.placeholder_only, 1); + assert_eq!((f.forms_with_text, f.forms_without_submit), (3, 1)); + assert_eq!(f.decorative_conflict, 2); + assert_eq!(f.alt_redundant_with_text, 1); + assert_eq!(f.adjacent_duplicate_links, 1); + assert_eq!((f.figures, f.figures_unlabeled), (3, 1)); + assert_eq!((f.canvases, f.canvases_without_fallback), (3, 1)); + assert_eq!((f.media, f.media_without_controls), (3, 2)); + assert_eq!(f.redundant_title, 2); + assert_eq!(f.mouse_only_handlers, 2); + assert_eq!((f.inline_blink, f.inline_direction), (1, 2)); + assert_eq!(f.statement_links, ["/accessibility", "/policy"]); + assert_eq!( + f.document_links, + [("pdf".to_string(), 2), ("hwp".to_string(), 1)] + ); + assert_eq!( + f.xml_lang_issues, + ["p: xml:lang=en 만 있음", "p: lang=en xml:lang=fr"] + ); + assert_eq!(f.dir_invalid, ["p: sideways"]); + assert!(!f.html_dir_rtl && f.any_dir_rtl); + assert_eq!(f.bdo_without_dir, 2); + assert_eq!(f.translate_invalid, ["maybe"]); + assert_eq!(f.ruby_without_rt, 1); + assert_eq!(f.content_language_meta.as_deref(), Some("ko")); + assert_eq!((f.bidi_controls, f.bom_in_content), (1, 1)); + assert_eq!(f.accessibility_metadata, ["accessibilityFeature"]); + let f = run( + r##"abcdx"##, + ); + assert!(f.html_dir_rtl && f.any_dir_rtl && !f.broken_skip_link); + } + + #[test] + fn implicit_roles_and_frames() { + let f = run( + r#"
    +

    +
    "#, + ); + for s in [ + "details: group", + "dialog: dialog", + "fieldset: group", + "hr: separator", + "meter: meter", + "progress: progressbar", + "search: search", + ] { + assert!( + f.role_redundant.contains(&s.to_string()), + "{s} {:?}", + f.role_redundant + ); + } + assert_eq!( + (f.iframes, f.iframe_tabindex_negative, f.mouse_only_handlers), + (2, 1, 1) + ); + } + + #[test] + fn helpers() { + assert!( + is_rtl_lang("ar") + && is_rtl_lang("he-IL") + && is_rtl_lang("ku-Arab") + && !is_rtl_lang("ko") + && !is_rtl_lang("en-US") + ); + assert_eq!( + css_blink("a{text-decoration: underline blink} b{text-decoration-line:blink}"), + 2 + ); + assert_eq!(percent_decode("%EB%B3%B8"), "본"); + } +} diff --git a/crates/devup-access-checker/src/catalog.rs b/crates/devup-access-checker/src/catalog.rs index b089fde..3118fdf 100644 --- a/crates/devup-access-checker/src/catalog.rs +++ b/crates/devup-access-checker/src/catalog.rs @@ -794,6 +794,16 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Content, "밑줄로 단어를 구분한 URL", ), + ( + "content.linked_documents", + Content, + "비HTML 문서 링크 (PDF·HWP·Office)", + ), + ( + "content.bidi_control_chars", + Content, + "본문의 양방향 제어 문자", + ), ( "performance.render_blocking_scripts", Performance, @@ -1287,6 +1297,187 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Accessibility, "음성 해설 트랙 없는 영상", ), + ( + "accessibility.statement_link", + Accessibility, + "접근성 성명(정책) 링크", + ), + ( + "accessibility.media_controls_missing", + Accessibility, + "기본 컨트롤 없는 video·audio", + ), + ( + "accessibility.aria_role_redundant", + Accessibility, + "암묵 역할과 같은 명시 role", + ), + ( + "accessibility.aria_role_not_allowed", + Accessibility, + "요소에 허용되지 않는 role", + ), + ( + "accessibility.aria_attr_on_prohibited_element", + Accessibility, + "aria-* 를 쓸 수 없는 요소의 aria 속성", + ), + ( + "accessibility.aria_attr_not_allowed_for_role", + Accessibility, + "역할에 허용되지 않는 aria-* 속성", + ), + ( + "accessibility.aria_html_attr_conflict", + Accessibility, + "HTML 속성과 충돌하는 aria-*", + ), + ( + "accessibility.aria_html_attr_redundant", + Accessibility, + "HTML 속성과 중복된 aria-*", + ), + ( + "accessibility.aria_deprecated_attr", + Accessibility, + "폐기된 ARIA 속성 (aria-grabbed·aria-dropeffect)", + ), + ( + "accessibility.presentational_children_roles", + Accessibility, + "자식이 무시되는 역할 안의 의미 요소", + ), + ( + "accessibility.presentation_semantic_children", + Accessibility, + "role=presentation 인데 의미 구조를 가진 표·목록", + ), + ( + "accessibility.duplicate_landmark_names", + Accessibility, + "같은 역할·같은 이름의 랜드마크", + ), + ( + "accessibility.landmark_role_unnamed", + Accessibility, + "이름 없는 region·application", + ), + ( + "accessibility.activedescendant_unfocusable", + Accessibility, + "초점을 받을 수 없는 aria-activedescendant 소유자", + ), + ( + "accessibility.combobox_pattern_invalid", + Accessibility, + "잘못된 combobox 패턴", + ), + ( + "accessibility.tabbable_non_interactive", + Accessibility, + "역할 없이 tabindex 로 초점을 받는 요소", + ), + ( + "accessibility.iframe_tabindex_negative", + Accessibility, + "tabindex=-1 로 탭 순서에서 빠진 iframe", + ), + ( + "accessibility.empty_labels", + Accessibility, + "내용 없는 label", + ), + ( + "accessibility.label_for_not_control", + Accessibility, + "입력 요소가 아닌 대상을 가리키는 label[for]", + ), + ( + "accessibility.placeholder_only_label", + Accessibility, + "placeholder 외에 보이는 레이블이 없는 입력", + ), + ( + "accessibility.form_submit_missing", + Accessibility, + "제출 버튼 없는 form", + ), + ( + "accessibility.decorative_img_conflict", + Accessibility, + "장식 표시가 충돌하는 이미지", + ), + ( + "accessibility.alt_redundant_with_text", + Accessibility, + "링크 텍스트와 중복된 이미지 alt", + ), + ( + "accessibility.adjacent_duplicate_links", + Accessibility, + "같은 URL 로 가는 연속 링크", + ), + ( + "accessibility.figure_unlabeled", + Accessibility, + "캡션·이름 없는 figure", + ), + ( + "accessibility.canvas_fallback_missing", + Accessibility, + "대체 콘텐츠 없는 canvas", + ), + ( + "accessibility.redundant_title_attr", + Accessibility, + "텍스트와 같은 title 속성", + ), + ( + "accessibility.broken_fragment_links", + Accessibility, + "대상이 없는 같은 페이지 링크 (건너뛰기 링크 포함)", + ), + ( + "accessibility.mouse_only_handlers", + Accessibility, + "키보드 대응 없는 마우스 이벤트", + ), + ( + "accessibility.css_blink", + Accessibility, + "CSS text-decoration: blink", + ), + ( + "accessibility.xml_lang_without_lang", + Accessibility, + "lang 없는 xml:lang·불일치", + ), + ("accessibility.dir_invalid", Accessibility, "잘못된 dir 값"), + ( + "accessibility.rtl_dir_missing", + Accessibility, + "RTL 언어인데 dir=rtl 없음", + ), + ( + "accessibility.css_direction", + Accessibility, + "CSS 로 지정한 글 방향 (direction·unicode-bidi)", + ), + ( + "accessibility.bdo_without_dir", + Accessibility, + "dir 없는(또는 auto) bdo", + ), + ( + "accessibility.translate_invalid", + Accessibility, + "잘못된 translate 값", + ), + ( + "accessibility.ruby_without_rt", + Accessibility, + "rt 없는 ruby", + ), ("trust.privacy_policy", Trust, "개인정보처리방침 링크"), ("trust.terms", Trust, "이용약관 링크"), ("trust.phone", Trust, "전화번호 링크 (tel:)"), @@ -1925,6 +2116,13 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Meta, "apple-itunes-app 형식 오류", ), + ("meta.bom_in_content", Meta, "본문 중간의 BOM (U+FEFF)"), + ("meta.xml_declaration", Meta, "text/html 문서의 XML 선언"), + ( + "meta.content_language_meta", + Meta, + "폐기된 Content-Language meta", + ), ( "structured_data.hreflang_reciprocal", StructuredData, @@ -2036,6 +2234,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ StructuredData, "isAccessibleForFree (유료 콘텐츠 표시)", ), + ( + "structured_data.accessibility_metadata", + StructuredData, + "schema.org 접근성 메타데이터", + ), ("performance.external_css", Performance, "외부 CSS 분석"), ( "performance.font_face_without_display", diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index de035be..77c5146 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -1558,6 +1558,7 @@ pub fn build(i: &Inputs) -> Vec { geo_spec_checks(&mut o, i, &robots); security_spec_checks(&mut o, i); google_spec_checks(&mut o, i, &robots); + aria_spec_checks(&mut o, i); if let Some(site) = i.site { site_checks(&mut o, i, site); } @@ -7464,6 +7465,393 @@ fn google_spec_checks(o: &mut Out, i: &Inputs, robots: &Result) ); } +/// ARIA in HTML·IBM Equal Access·HTML_CodeSniffer·WAVE·W3C i18n·EN 301 549 대조 항목. +fn aria_spec_checks(o: &mut Out, i: &Inputs) { + use Category::*; + let f = i.facts; + let a = &f.aria; + let list = |v: &[String]| (!v.is_empty()).then(|| json!(v)); + let blink = a.inline_blink + + f.extra.inline_css.blink + + i.extended + .external_css + .as_ref() + .map_or(0, |c| c.facts.blink); + let rtl = match f.lang.as_deref() { + Some(l) if crate::aria::is_rtl_lang(l) => Presence::from_bool(!a.html_dir_rtl), + _ => Presence::NotApplicable, + }; + let mut meta: Vec = a.accessibility_metadata.clone(); + for ob in &f.extra.ld_objects { + for k in &ob.keys { + if (k.starts_with("accessibility") || k.starts_with("accessMode")) && !meta.contains(k) + { + meta.push(k.clone()); + } + } + } + let xml_decl = i + .page + .body + .trim_start_matches('\u{feff}') + .trim_start() + .get(..5) + .is_some_and(|h| h.eq_ignore_ascii_case(" 0), + Some(json!(a.unnamed_region_app)), + None, + ); + o.push( + "accessibility.activedescendant_unfocusable", + Accessibility, + "초점을 받을 수 없는 aria-activedescendant 소유자", + Presence::from_bool(a.activedescendant_unfocusable > 0), + Some(json!(a.activedescendant_unfocusable)), + None, + ); + o.push( + "accessibility.combobox_pattern_invalid", + Accessibility, + "잘못된 combobox 패턴", + Presence::from_bool(!a.combobox_invalid.is_empty()), + list(&a.combobox_invalid), + None, + ); + o.push( + "accessibility.tabbable_non_interactive", + Accessibility, + "역할 없이 tabindex 로 초점을 받는 요소", + Presence::from_bool(a.tabbable_non_interactive > 0), + Some(json!(a.tabbable_non_interactive)), + Some("스크롤 영역처럼 의도된 경우도 포함".into()), + ); + o.push( + "accessibility.iframe_tabindex_negative", + Accessibility, + "tabindex=-1 로 탭 순서에서 빠진 iframe", + count_presence(a.iframe_tabindex_negative, a.iframes), + Some(json!(a.iframe_tabindex_negative)), + None, + ); + o.push( + "accessibility.empty_labels", + Accessibility, + "내용 없는 label", + count_presence(a.empty_labels, a.labels), + Some(json!(a.empty_labels)), + None, + ); + o.push( + "accessibility.label_for_not_control", + Accessibility, + "입력 요소가 아닌 대상을 가리키는 label[for]", + Presence::from_bool(!a.label_for_not_control.is_empty()), + list(&a.label_for_not_control), + None, + ); + o.push( + "accessibility.placeholder_only_label", + Accessibility, + "placeholder 외에 보이는 레이블이 없는 입력", + Presence::from_bool(a.placeholder_only > 0), + Some(json!(a.placeholder_only)), + None, + ); + o.push( + "accessibility.form_submit_missing", + Accessibility, + "제출 버튼 없는 form", + count_presence(a.forms_without_submit, a.forms_with_text), + Some(json!(a.forms_without_submit)), + Some("KWCAG·WCAG 3.2.2 (H32)".into()), + ); + o.push( + "accessibility.decorative_img_conflict", + Accessibility, + "장식 표시가 충돌하는 이미지", + Presence::from_bool(a.decorative_conflict > 0), + Some(json!(a.decorative_conflict)), + Some("alt=\"\" 인데 title·aria-label, 또는 role=none 인데 alt".into()), + ); + o.push( + "accessibility.alt_redundant_with_text", + Accessibility, + "링크 텍스트와 중복된 이미지 alt", + Presence::from_bool(a.alt_redundant_with_text > 0), + Some(json!(a.alt_redundant_with_text)), + None, + ); + o.push( + "accessibility.adjacent_duplicate_links", + Accessibility, + "같은 URL 로 가는 연속 링크", + Presence::from_bool(a.adjacent_duplicate_links > 0), + Some(json!(a.adjacent_duplicate_links)), + None, + ); + o.push( + "accessibility.figure_unlabeled", + Accessibility, + "캡션·이름 없는 figure", + count_presence(a.figures_unlabeled, a.figures), + Some(json!(a.figures_unlabeled)), + None, + ); + o.push( + "accessibility.canvas_fallback_missing", + Accessibility, + "대체 콘텐츠 없는 canvas", + count_presence(a.canvases_without_fallback, a.canvases), + Some(json!(a.canvases_without_fallback)), + None, + ); + o.push( + "accessibility.redundant_title_attr", + Accessibility, + "텍스트와 같은 title 속성", + Presence::from_bool(a.redundant_title > 0), + Some(json!(a.redundant_title)), + None, + ); + o.push( + "accessibility.broken_fragment_links", + Accessibility, + "대상이 없는 같은 페이지 링크 (건너뛰기 링크 포함)", + Presence::from_bool(!a.broken_fragment_links.is_empty()), + (!a.broken_fragment_links.is_empty()).then( + || json!({ "links": a.broken_fragment_links, "brokenSkipLink": a.broken_skip_link }), + ), + None, + ); + o.push( + "accessibility.mouse_only_handlers", + Accessibility, + "키보드 대응 없는 마우스 이벤트", + Presence::from_bool(a.mouse_only_handlers > 0), + Some(json!(a.mouse_only_handlers)), + Some("onmouseover·onmouseout·onmousedown·ondblclick 등".into()), + ); + o.push( + "accessibility.css_blink", + Accessibility, + "CSS text-decoration: blink", + Presence::from_bool(blink > 0), + Some(json!(blink)), + None, + ); + o.push( + "accessibility.xml_lang_without_lang", + Accessibility, + "lang 없는 xml:lang·불일치", + Presence::from_bool(!a.xml_lang_issues.is_empty()), + list(&a.xml_lang_issues), + None, + ); + o.push( + "accessibility.dir_invalid", + Accessibility, + "잘못된 dir 값", + Presence::from_bool(!a.dir_invalid.is_empty()), + list(&a.dir_invalid), + None, + ); + o.push( + "accessibility.rtl_dir_missing", + Accessibility, + "RTL 언어인데 dir=rtl 없음", + rtl, + Some(json!({ "htmlDirRtl": a.html_dir_rtl, "anyDirRtl": a.any_dir_rtl })), + None, + ); + o.push( + "accessibility.css_direction", + Accessibility, + "CSS 로 지정한 글 방향 (direction·unicode-bidi)", + Presence::from_bool(a.inline_direction > 0), + Some(json!(a.inline_direction)), + Some("W3C i18n: dir 속성 사용 권장".into()), + ); + o.push( + "accessibility.bdo_without_dir", + Accessibility, + "dir 없는(또는 auto) bdo", + Presence::from_bool(a.bdo_without_dir > 0), + Some(json!(a.bdo_without_dir)), + None, + ); + o.push( + "accessibility.translate_invalid", + Accessibility, + "잘못된 translate 값", + Presence::from_bool(!a.translate_invalid.is_empty()), + list(&a.translate_invalid), + None, + ); + o.push( + "accessibility.ruby_without_rt", + Accessibility, + "rt 없는 ruby", + Presence::from_bool(a.ruby_without_rt > 0), + Some(json!(a.ruby_without_rt)), + None, + ); + o.push( + "content.linked_documents", + Content, + "비HTML 문서 링크 (PDF·HWP·Office)", + Presence::from_bool(!a.document_links.is_empty()), + (!a.document_links.is_empty()).then(|| { + json!( + a.document_links + .iter() + .map(|(k, n)| (k.clone(), *n)) + .collect::>() + ) + }), + Some("EN 301 549 10장: 문서 자체의 접근성은 확인하지 않음".into()), + ); + o.push( + "content.bidi_control_chars", + Content, + "본문의 양방향 제어 문자", + Presence::from_bool(a.bidi_controls > 0), + Some(json!(a.bidi_controls)), + None, + ); + o.push( + "structured_data.accessibility_metadata", + StructuredData, + "schema.org 접근성 메타데이터", + Presence::from_bool(!meta.is_empty()), + list(&meta), + Some("accessibilityFeature·accessMode 등 (EN 301 549 12.1.1)".into()), + ); + o.push( + "meta.bom_in_content", + Meta, + "본문 중간의 BOM (U+FEFF)", + Presence::from_bool(a.bom_in_content > 0), + Some(json!(a.bom_in_content)), + None, + ); + o.push( + "meta.xml_declaration", + Meta, + "text/html 문서의 XML 선언", + Presence::from_bool(xml_decl), + None, + None, + ); + o.push( + "meta.content_language_meta", + Meta, + "폐기된 Content-Language meta", + Presence::from_bool(a.content_language_meta.is_some()), + a.content_language_meta.clone().map(Value::from), + Some("HTML 명세상 폐기, lang 속성 사용".into()), + ); +} + fn canonical_hreflang_weight_checks(o: &mut Out, i: &Inputs) { use Category::*; let ext = i.extended; @@ -9792,4 +10180,48 @@ mod tests { Presence::Present ); } + + #[test] + fn aria_and_i18n_items() { + let mut fx = Fx::failing(); + let p = |c: &[Check], id: &str| get(c, id).presence; + let html = r##" + +skip접근성pdf

    ‮x

    "##; + fx.page = page("https://a.com/", html); + fx.facts = crate::html::extract(html, &fx.page.final_url); + fx.extended.external_css = Some(ExternalCss { + facts: crate::css::analyze("b{text-decoration: blink}"), + ..Default::default() + }); + let c = fx.run(); + for id in [ + "accessibility.statement_link", + "accessibility.aria_role_redundant", + "accessibility.css_blink", + "accessibility.rtl_dir_missing", + "content.linked_documents", + "content.bidi_control_chars", + "structured_data.accessibility_metadata", + "meta.xml_declaration", + ] { + assert_eq!(p(&c, id), Presence::Present, "{id}"); + } + assert_eq!(get(&c, "accessibility.css_blink").value, Some(json!(2))); + let html = r#"

    x

    "#; + fx.page = page("https://a.com/", html); + fx.facts = crate::html::extract(html, &fx.page.final_url); + fx.extended.external_css = None; + let c = fx.run(); + assert_eq!( + p(&c, "accessibility.rtl_dir_missing"), + Presence::NotApplicable + ); + assert_eq!( + p(&c, "accessibility.media_controls_missing"), + Presence::NotApplicable + ); + assert_eq!(p(&c, "meta.xml_declaration"), Presence::Missing); + assert_eq!(p(&c, "accessibility.statement_link"), Presence::Missing); + } } diff --git a/crates/devup-access-checker/src/css.rs b/crates/devup-access-checker/src/css.rs index 1be95fd..32becdb 100644 --- a/crates/devup-access-checker/src/css.rs +++ b/crates/devup-access-checker/src/css.rs @@ -44,6 +44,8 @@ pub struct CssFacts { pub reduced_motion: bool, /// `text-align: justify` 선언 수 pub justify: usize, + /// `text-decoration: blink` 선언 수 + pub blink: usize, } impl CssFacts { @@ -59,6 +61,7 @@ impl CssFacts { self.animations += other.animations; self.reduced_motion |= other.reduced_motion; self.justify += other.justify; + self.blink += other.blink; } } @@ -79,6 +82,7 @@ pub fn analyze(css: &str) -> CssFacts { .count(), reduced_motion: css.to_ascii_lowercase().contains("prefers-reduced-motion"), justify: JUSTIFY.find_iter(&css).count(), + blink: crate::aria::css_blink(&css), ..Default::default() }; for c in FONT_FACE.captures_iter(&css) { @@ -114,6 +118,7 @@ mod tests { animations: 0, reduced_motion: false, justify: 0, + blink: 0, } ); } diff --git a/crates/devup-access-checker/src/html.rs b/crates/devup-access-checker/src/html.rs index e7238ca..573c285 100644 --- a/crates/devup-access-checker/src/html.rs +++ b/crates/devup-access-checker/src/html.rs @@ -97,6 +97,7 @@ pub struct PageFacts { pub search: crate::search::SearchFacts, pub sec: crate::sec::SecFacts, pub google: crate::google::GoogleFacts, + pub aria: crate::aria::AriaFacts, /// 신뢰·법적 정보 pub trust: crate::trust::TrustFacts, } @@ -370,6 +371,7 @@ pub fn extract(html: &str, page_url: &Url) -> PageFacts { f.search = crate::search::extract(&doc, base); f.sec = crate::sec::extract(&doc, base); f.google = crate::google::extract(&doc, html, base); + f.aria = crate::aria::extract(&doc, base); f } diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 0b11b88..7070883 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -13,6 +13,7 @@ //! ``` mod a11y; +mod aria; mod catalog; mod checks; mod css; From 2bec0d6b59271a6d703bf5edd4edccb1feea7288 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 16:37:27 +0900 Subject: [PATCH 19/21] =?UTF-8?q?feat:=20Nu=20HTML=20Checker=C2=B7HTMLHint?= =?UTF-8?q?=C2=B7webhint=C2=B7DevTools=20=EB=8C=80=EC=A1=B0=EB=A1=9C=20HTM?= =?UTF-8?q?L=20=EC=A0=81=ED=95=A9=EC=84=B1=C2=B7=EC=84=B1=EB=8A=A5=2044?= =?UTF-8?q?=EA=B0=9C=20=EC=B6=94=EA=B0=80=20(676=EA=B0=9C)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 요소 중첩·구문 콘텐츠·폼 적합성·URL·열거형 속성·time·microdata·NFC·알 수 없는 요소 - preload·preconnect·script 속성·importmap/speculationrules·iframe lazy·파사드·video preload - CSS: WOFF2 없는 글꼴·레이아웃 애니메이션·접두사 순서·summary display·content-visibility - 하위 리소스 표본: 압축·Content-Type·깨짐·리다이렉트·minify·레거시 JS - broken_id_refs 가 aria-owns·aria-activedescendant·list·form·popovertarget 등도 확인 Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_initial-release.json | 2 +- Cargo.lock | 10 + README.md | 44 + crates/devup-access-checker/Cargo.toml | 1 + crates/devup-access-checker/src/a11y.rs | 16 +- crates/devup-access-checker/src/catalog.rs | 216 +++++ crates/devup-access-checker/src/checks.rs | 626 +++++++++++++ crates/devup-access-checker/src/css.rs | 119 +++ crates/devup-access-checker/src/fetch.rs | 109 ++- crates/devup-access-checker/src/html.rs | 2 + crates/devup-access-checker/src/lib.rs | 63 +- crates/devup-access-checker/src/quality.rs | 886 ++++++++++++++++++ 12 files changed, 2064 insertions(+), 30 deletions(-) create mode 100644 crates/devup-access-checker/src/quality.rs diff --git a/.changepacks/changepack_log_initial-release.json b/.changepacks/changepack_log_initial-release.json index ea8db05..c294455 100644 --- a/.changepacks/changepack_log_initial-release.json +++ b/.changepacks/changepack_log_initial-release.json @@ -1 +1 @@ -{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 632개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} +{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 676개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} diff --git a/Cargo.lock b/Cargo.lock index 4414d82..de938a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,6 +491,7 @@ dependencies = [ "serde_json", "thiserror", "tokio", + "unicode-normalization", "url", "wiremock", "x509-parser", @@ -2203,6 +2204,15 @@ version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563" +[[package]] +name = "unicode-normalization" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cd3fb03d5288b3ba9a1ee103ac7e9cbb59f0b03d64f8ddfcc04dd42758a85d" +dependencies = [ + "tinyvec", +] + [[package]] name = "unicode-width" version = "0.2.3" diff --git a/README.md b/README.md index 6fc7ea7..59ef28b 100644 --- a/README.md +++ b/README.md @@ -345,6 +345,17 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `content.underscore_url_paths` | 밑줄로 단어를 구분한 URL | | `content.linked_documents` | 비HTML 문서 링크 (PDF·HWP·Office) | | `content.bidi_control_chars` | 본문의 양방향 제어 문자 | +| `content.invalid_urls` | 형식이 잘못된 URL (공백·역슬래시·잘못된 % 인코딩) | +| `content.invalid_enum_attrs` | 명세에 없는 열거형 속성 값 | +| `content.time_datetime_invalid` | 형식이 잘못된 time datetime | +| `content.unknown_elements` | HTML 에 없는 요소 (사용자 정의 요소 제외) | +| `content.text_not_nfc` | NFC 로 정규화되지 않은 텍스트 | +| `content.section_without_heading` | 제목 없는 section·article | +| `content.input_type_generic` | 이메일·전화 등에 type=text | +| `content.form_method_missing` | method 없는 form | +| `content.ad_blocker_class_names` | 광고 차단기에 가려지는 id·class | +| `content.attr_unsafe_chars` | 보이지 않는 제어 문자가 든 속성 값 | +| `content.broken_resources` | 깨진 하위 리소스 (JS·CSS) | | `performance.render_blocking_scripts` | head 렌더링 차단 스크립트 (async/defer 없음) | | `performance.head_stylesheets` | head 외부 스타일시트 | | `performance.preconnect` | preconnect / dns-prefetch | @@ -491,6 +502,10 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `accessibility.bdo_without_dir` | dir 없는(또는 auto) bdo | | `accessibility.translate_invalid` | 잘못된 translate 값 | | `accessibility.ruby_without_rt` | rt 없는 ruby | +| `accessibility.invalid_nesting` | 허용되지 않는 요소 중첩 | +| `accessibility.phrasing_content_violation` | 구문 전용 요소 안의 블록 요소 | +| `accessibility.form_conformance_errors` | 폼 요소 적합성 오류 | +| `accessibility.summary_display_changed` | summary 의 display 변경 | | `trust.privacy_policy` | 개인정보처리방침 링크 | | `trust.terms` | 이용약관 링크 | | `trust.phone` | 전화번호 링크 (tel:) | @@ -553,6 +568,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `security.sri_invalid` | integrity 속성 오류 | | `security.protocol_relative_urls` | 프로토콜 상대 URL (//) | | `security.change_password_url` | 비밀번호 변경 URL (/.well-known/change-password) | +| `security.inline_event_handlers` | 인라인 이벤트 핸들러 (onclick 등) | | `performance.static_asset_cache` | 정적 리소스 Cache-Control | | `performance.dom_size` | DOM 크기 | | `performance.third_party_scripts` | 서드파티 스크립트 호스트 | @@ -672,6 +688,8 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `meta.bom_in_content` | 본문 중간의 BOM (U+FEFF) | | `meta.xml_declaration` | text/html 문서의 XML 선언 | | `meta.content_language_meta` | 폐기된 Content-Language meta | +| `meta.http_equiv_invalid` | 브라우저가 무시하는 http-equiv | +| `meta.base_after_resources` | link·script 뒤에 온 base (또는 base 여러 개) | | `structured_data.hreflang_reciprocal` | hreflang 상호 참조 | | `structured_data.unknown_types` | schema.org 에 없는 @type | | `structured_data.rdfa` | RDFa | @@ -696,6 +714,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `structured_data.site_name_mismatch` | WebSite.name 과 og:site_name 불일치 | | `structured_data.is_accessible_for_free` | isAccessibleForFree (유료 콘텐츠 표시) | | `structured_data.accessibility_metadata` | schema.org 접근성 메타데이터 | +| `structured_data.microdata_invalid` | 잘못된 microdata (itemprop·itemref·itemtype) | | `performance.external_css` | 외부 CSS 분석 | | `performance.font_face_without_display` | font-display 없는 @font-face | | `performance.page_weight` | 페이지 리소스 무게 | @@ -712,6 +731,30 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `performance.large_gifs` | 큰 GIF 이미지 (100KB 초과) | | `performance.cache_control_conflict` | Cache-Control 지시어 충돌·오류 | | `performance.vary_accept_encoding_missing` | 압축 응답에 Vary: Accept-Encoding 없음 | +| `performance.empty_src` | 빈 src·href (페이지 자신을 다시 요청) | +| `performance.srcset_sizes_invalid` | srcset w 서술자에 sizes 누락 등 | +| `performance.preload_invalid` | 잘못된 preload (as 누락·글꼴 crossorigin 누락) | +| `performance.script_attr_ineffective` | 효과 없는·잘못된 script 속성 | +| `performance.script_json_invalid` | importmap·speculationrules JSON 오류 | +| `performance.speculation_rules` | Speculation Rules (prefetch·prerender) | +| `performance.excess_preconnect` | preconnect 4개 초과 | +| `performance.preconnect_unused` | 참조되지 않는 preconnect 출처 | +| `performance.preconnect_crossorigin_missing` | 글꼴 출처 preconnect 의 crossorigin 누락 | +| `performance.iframe_lazy` | loading=lazy 없는 iframe (첫 번째 제외) | +| `performance.third_party_embeds` | 무거운 서드파티 임베드 (파사드 후보) | +| `performance.video_preload` | preload 를 줄이지 않은 video | +| `performance.img_decoding` | decoding=async 이미지 | +| `performance.inline_style_attrs` | style 속성 사용 요소 | +| `performance.legacy_font_formats` | WOFF2 없는 글꼴 (ttf·otf·eot) | +| `performance.content_visibility` | content-visibility 사용 | +| `performance.layout_animations` | 레이아웃 속성을 움직이는 @keyframes | +| `performance.css_prefix_order` | 표준 속성 뒤의 접두사 속성 | +| `performance.server_timing` | Server-Timing 헤더 | +| `performance.link_header_preload` | Link 헤더 preload·preconnect | +| `performance.asset_compression` | 압축 없이 전달되는 CSS·JS | +| `performance.asset_redirects` | 리다이렉트되는 JS | +| `performance.unminified_js` | 압축(minify)되지 않은 JS | +| `performance.legacy_javascript` | 레거시 JS (Babel 변환·폴리필 흔적) | | `site.pages_sampled` | 표본 페이지 수집 | | `site.failed_pages` | 표본 중 2xx 아닌 페이지 | | `site.duplicate_titles` | 페이지 간 중복 title | @@ -744,3 +787,4 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `transport.security_txt_signed` | security.txt 전자서명 | | `transport.security_txt_canonical_mismatch` | security.txt Canonical 에 실제 URL 없음 | | `transport.ua_redirect_mismatch` | UA 별 다른 최종 호스트 (교묘한 리다이렉트 의심) | +| `transport.asset_content_type_mismatch` | JavaScript 가 아닌 Content-Type 의 JS | diff --git a/crates/devup-access-checker/Cargo.toml b/crates/devup-access-checker/Cargo.toml index d681880..ae26c60 100644 --- a/crates/devup-access-checker/Cargo.toml +++ b/crates/devup-access-checker/Cargo.toml @@ -26,6 +26,7 @@ futures = "0.3" encoding_rs = "0.8" flate2 = "1.1.11" psl = "2.1.258" +unicode-normalization = "0.1.26" [dev-dependencies] wiremock = "0.6" diff --git a/crates/devup-access-checker/src/a11y.rs b/crates/devup-access-checker/src/a11y.rs index 59bae20..8f11603 100644 --- a/crates/devup-access-checker/src/a11y.rs +++ b/crates/devup-access-checker/src/a11y.rs @@ -91,7 +91,11 @@ pub struct A11yFacts { static HEADINGS: LazyLock = LazyLock::new(|| sel("h1, h2, h3, h4, h5, h6")); static IMG_ALT: LazyLock = LazyLock::new(|| sel("img[alt]")); static ID_REFS: LazyLock = LazyLock::new(|| { - sel("label[for], [aria-labelledby], [aria-describedby], [aria-controls], [headers]") + sel( + "label[for], [aria-labelledby], [aria-describedby], [aria-controls], [headers], [aria-owns], \ + [aria-activedescendant], [aria-details], [aria-errormessage], [aria-flowto], input[list], [form], \ + [popovertarget], [commandfor], [itemref]", + ) }); static ARIA_HIDDEN: LazyLock = LazyLock::new(|| sel("[aria-hidden=true]")); static FOCUSABLE: LazyLock = LazyLock::new(|| { @@ -337,6 +341,16 @@ pub fn extract(doc: &Html) -> A11yFacts { "aria-describedby", "aria-controls", "headers", + "aria-owns", + "aria-activedescendant", + "aria-details", + "aria-errormessage", + "aria-flowto", + "list", + "form", + "popovertarget", + "commandfor", + "itemref", ] { if attr_name == "for" && el.value().name() != "label" { continue; diff --git a/crates/devup-access-checker/src/catalog.rs b/crates/devup-access-checker/src/catalog.rs index 3118fdf..9c498ca 100644 --- a/crates/devup-access-checker/src/catalog.rs +++ b/crates/devup-access-checker/src/catalog.rs @@ -804,6 +804,57 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Content, "본문의 양방향 제어 문자", ), + ( + "content.invalid_urls", + Content, + "형식이 잘못된 URL (공백·역슬래시·잘못된 % 인코딩)", + ), + ( + "content.invalid_enum_attrs", + Content, + "명세에 없는 열거형 속성 값", + ), + ( + "content.time_datetime_invalid", + Content, + "형식이 잘못된 time datetime", + ), + ( + "content.unknown_elements", + Content, + "HTML 에 없는 요소 (사용자 정의 요소 제외)", + ), + ( + "content.text_not_nfc", + Content, + "NFC 로 정규화되지 않은 텍스트", + ), + ( + "content.section_without_heading", + Content, + "제목 없는 section·article", + ), + ( + "content.input_type_generic", + Content, + "이메일·전화 등에 type=text", + ), + ("content.form_method_missing", Content, "method 없는 form"), + ( + "content.ad_blocker_class_names", + Content, + "광고 차단기에 가려지는 id·class", + ), + ( + "content.attr_unsafe_chars", + Content, + "보이지 않는 제어 문자가 든 속성 값", + ), + ( + "content.broken_resources", + Content, + "깨진 하위 리소스 (JS·CSS)", + ), ( "performance.render_blocking_scripts", Performance, @@ -1478,6 +1529,26 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Accessibility, "rt 없는 ruby", ), + ( + "accessibility.invalid_nesting", + Accessibility, + "허용되지 않는 요소 중첩", + ), + ( + "accessibility.phrasing_content_violation", + Accessibility, + "구문 전용 요소 안의 블록 요소", + ), + ( + "accessibility.form_conformance_errors", + Accessibility, + "폼 요소 적합성 오류", + ), + ( + "accessibility.summary_display_changed", + Accessibility, + "summary 의 display 변경", + ), ("trust.privacy_policy", Trust, "개인정보처리방침 링크"), ("trust.terms", Trust, "이용약관 링크"), ("trust.phone", Trust, "전화번호 링크 (tel:)"), @@ -1700,6 +1771,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Security, "비밀번호 변경 URL (/.well-known/change-password)", ), + ( + "security.inline_event_handlers", + Security, + "인라인 이벤트 핸들러 (onclick 등)", + ), ( "performance.static_asset_cache", Performance, @@ -2123,6 +2199,16 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Meta, "폐기된 Content-Language meta", ), + ( + "meta.http_equiv_invalid", + Meta, + "브라우저가 무시하는 http-equiv", + ), + ( + "meta.base_after_resources", + Meta, + "link·script 뒤에 온 base (또는 base 여러 개)", + ), ( "structured_data.hreflang_reciprocal", StructuredData, @@ -2239,6 +2325,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ StructuredData, "schema.org 접근성 메타데이터", ), + ( + "structured_data.microdata_invalid", + StructuredData, + "잘못된 microdata (itemprop·itemref·itemtype)", + ), ("performance.external_css", Performance, "외부 CSS 분석"), ( "performance.font_face_without_display", @@ -2307,6 +2398,126 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Performance, "압축 응답에 Vary: Accept-Encoding 없음", ), + ( + "performance.empty_src", + Performance, + "빈 src·href (페이지 자신을 다시 요청)", + ), + ( + "performance.srcset_sizes_invalid", + Performance, + "srcset w 서술자에 sizes 누락 등", + ), + ( + "performance.preload_invalid", + Performance, + "잘못된 preload (as 누락·글꼴 crossorigin 누락)", + ), + ( + "performance.script_attr_ineffective", + Performance, + "효과 없는·잘못된 script 속성", + ), + ( + "performance.script_json_invalid", + Performance, + "importmap·speculationrules JSON 오류", + ), + ( + "performance.speculation_rules", + Performance, + "Speculation Rules (prefetch·prerender)", + ), + ( + "performance.excess_preconnect", + Performance, + "preconnect 4개 초과", + ), + ( + "performance.preconnect_unused", + Performance, + "참조되지 않는 preconnect 출처", + ), + ( + "performance.preconnect_crossorigin_missing", + Performance, + "글꼴 출처 preconnect 의 crossorigin 누락", + ), + ( + "performance.iframe_lazy", + Performance, + "loading=lazy 없는 iframe (첫 번째 제외)", + ), + ( + "performance.third_party_embeds", + Performance, + "무거운 서드파티 임베드 (파사드 후보)", + ), + ( + "performance.video_preload", + Performance, + "preload 를 줄이지 않은 video", + ), + ( + "performance.img_decoding", + Performance, + "decoding=async 이미지", + ), + ( + "performance.inline_style_attrs", + Performance, + "style 속성 사용 요소", + ), + ( + "performance.legacy_font_formats", + Performance, + "WOFF2 없는 글꼴 (ttf·otf·eot)", + ), + ( + "performance.content_visibility", + Performance, + "content-visibility 사용", + ), + ( + "performance.layout_animations", + Performance, + "레이아웃 속성을 움직이는 @keyframes", + ), + ( + "performance.css_prefix_order", + Performance, + "표준 속성 뒤의 접두사 속성", + ), + ( + "performance.server_timing", + Performance, + "Server-Timing 헤더", + ), + ( + "performance.link_header_preload", + Performance, + "Link 헤더 preload·preconnect", + ), + ( + "performance.asset_compression", + Performance, + "압축 없이 전달되는 CSS·JS", + ), + ( + "performance.asset_redirects", + Performance, + "리다이렉트되는 JS", + ), + ( + "performance.unminified_js", + Performance, + "압축(minify)되지 않은 JS", + ), + ( + "performance.legacy_javascript", + Performance, + "레거시 JS (Babel 변환·폴리필 흔적)", + ), ("site.pages_sampled", Site, "표본 페이지 수집"), ("site.failed_pages", Site, "표본 중 2xx 아닌 페이지"), ("site.duplicate_titles", Site, "페이지 간 중복 title"), @@ -2427,6 +2638,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Transport, "UA 별 다른 최종 호스트 (교묘한 리다이렉트 의심)", ), + ( + "transport.asset_content_type_mismatch", + Transport, + "JavaScript 가 아닌 Content-Type 의 JS", + ), ]; /// id 로 카탈로그 위치를 찾는다. diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index 77c5146..d9b1a73 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -183,6 +183,8 @@ pub struct PageWeight { pub large_images: Vec<(String, u64)>, /// [`LARGE_GIF_BYTES`] 를 넘는 GIF (움직이는 이미지는 동영상이 훨씬 작다) pub large_gifs: Vec<(String, u64)>, + /// JS 표본 (URL, 결과) — 상태·Content-Type·리다이렉트·본문 분석용 + pub scripts: Vec<(String, Result)>, } /// 큰 GIF 기준 (Lighthouse "효율적인 애니메이션 콘텐츠" 와 같은 100KB) @@ -248,6 +250,9 @@ pub struct ImageInfo { pub height: Option, } +/// (CSS·JS URL, (상태, Content-Encoding)) +pub type AssetEncoding = (String, Result<(u16, Option), String>); + /// 검색엔진 가이드 대조로 추가 요청한 결과. #[derive(Debug, Default)] pub struct SearchProbes { @@ -263,6 +268,8 @@ pub struct SearchProbes { pub gpc: Option, /// ETag·Last-Modified 조건부 요청 상태. None = 두 헤더가 없음 pub conditional: Option>, + /// 압축을 풀지 않고 받은 CSS·JS 표본의 (URL, (상태, Content-Encoding)) + pub asset_encodings: Vec, /// 첫 RSS/Atom 피드 본문. None = 피드 링크 없음 또는 수행 안 함 pub feed: Option, /// `/BingSiteAuth.xml`. None = 수행 안 함 @@ -1559,6 +1566,7 @@ pub fn build(i: &Inputs) -> Vec { security_spec_checks(&mut o, i); google_spec_checks(&mut o, i, &robots); aria_spec_checks(&mut o, i); + quality_spec_checks(&mut o, i); if let Some(site) = i.site { site_checks(&mut o, i, site); } @@ -7852,6 +7860,523 @@ fn aria_spec_checks(o: &mut Out, i: &Inputs) { ); } +/// 레거시 JS 흔적 (Babel 헬퍼·폴리필). +const LEGACY_JS: &[&str] = &[ + "regeneratorRuntime", + "_classCallCheck(", + "_createClass(", + "_inherits(", + "_asyncToGenerator(", + "_toConsumableArray(", + "core-js/modules", + "__core-js_shared__", + "Array.prototype.includes||", + "Object.assign||", +]; + +/// 줄 앞 들여쓰기·빈 줄 바이트 (minify 로 줄일 수 있는 양의 추정). +fn indentation_bytes(text: &str) -> usize { + text.lines() + .map(|l| l.len() - l.trim_start().len() + 1) + .sum() +} + +/// Nu HTML Checker·HTMLHint·webhint·DevTools 대조 항목. +fn quality_spec_checks(o: &mut Out, i: &Inputs) { + use Category::*; + let f = i.facts; + let q = &f.quality; + let h = &i.page.headers; + let list = |v: &[String]| (!v.is_empty()).then(|| json!(v)); + let flag = |b: bool, applicable: bool| { + if applicable { + Presence::from_bool(b) + } else { + Presence::NotApplicable + } + }; + let ext_css = i.extended.external_css.as_ref(); + let css_sum = |g: fn(&crate::css::CssFacts) -> usize| { + g(&f.extra.inline_css) + ext_css.map_or(0, |c| g(&c.facts)) + }; + let equiv_bad: Vec = f + .sec + .http_equiv + .iter() + .filter(|e| { + !matches!( + e.as_str(), + "refresh" + | "default-style" + | "content-security-policy" + | "x-ua-compatible" + | "content-type" + ) + }) + .cloned() + .collect(); + let link_preload: Vec = header(h, "link") + .unwrap_or_default() + .split(',') + .filter(|p| { + let l = p.to_ascii_lowercase(); + l.contains("rel=preload") + || l.contains("rel=\"preload") + || l.contains("preconnect") + || l.contains("modulepreload") + }) + .map(|p| p.trim().to_string()) + .collect(); + let encodings = &i.extended.search.asset_encodings; + let encodings_ok = encodings + .iter() + .filter(|(_, r)| r.as_ref().is_ok_and(|(s, _)| (200..300).contains(s))) + .count(); + let uncompressed: Vec = encodings + .iter() + .filter(|(_, r)| { + r.as_ref() + .is_ok_and(|(s, e)| (200..300).contains(s) && e.is_none()) + }) + .map(|(u, _)| u.clone()) + .collect(); + let scripts: Vec<&(String, Result)> = i + .extended + .page_weight + .iter() + .flat_map(|w| w.scripts.iter()) + .collect(); + let ok_scripts: Vec<(&String, &crate::fetch::ResourceSample)> = scripts + .iter() + .filter_map(|(u, r)| { + r.as_ref() + .ok() + .filter(|s| (200..300).contains(&s.status)) + .map(|s| (u, s)) + }) + .collect(); + let scripts_ok = ok_scripts.len(); + let bad_type: Vec = ok_scripts + .iter() + .filter(|(_, s)| { + let ct = s + .content_type + .as_deref() + .unwrap_or_default() + .to_ascii_lowercase(); + !(ct.contains("javascript") || ct.contains("ecmascript")) + }) + .map(|(u, s)| format!("{u} ({})", s.content_type.as_deref().unwrap_or("없음"))) + .collect(); + let broken: Vec = scripts + .iter() + .filter_map(|(u, r)| { + r.as_ref() + .ok() + .filter(|s| matches!(s.status, 404 | 410 | 500..=599)) + .map(|s| format!("{u} ({})", s.status)) + }) + .collect(); + let css_failed = ext_css.map_or(0, |c| c.failed); + let sampled = !scripts.is_empty() || ext_css.is_some_and(|c| c.checked + c.failed > 0); + let redirected: Vec = ok_scripts + .iter() + .filter(|(u, s)| s.final_url.trim_end_matches('/') != u.trim_end_matches('/')) + .map(|(u, _)| (*u).clone()) + .collect(); + let unminified: Vec = ok_scripts + .iter() + .filter(|(_, s)| { + let text = String::from_utf8_lossy(&s.body); + let waste = indentation_bytes(&text); + waste > 2048 && waste * 10 > text.len() + }) + .map(|(u, _)| (*u).clone()) + .collect(); + let legacy: Vec = ok_scripts + .iter() + .filter_map(|(u, s)| { + let text = String::from_utf8_lossy(&s.body); + let hits: Vec<&str> = LEGACY_JS + .iter() + .copied() + .filter(|p| text.contains(p)) + .collect(); + (!hits.is_empty()).then(|| format!("{u}: {}", hits.join(", "))) + }) + .collect(); + o.push( + "meta.http_equiv_invalid", + Meta, + "브라우저가 무시하는 http-equiv", + flag(!equiv_bad.is_empty(), !f.sec.http_equiv.is_empty()), + list(&equiv_bad), + Some( + "허용: refresh·default-style·content-security-policy·x-ua-compatible·content-type" + .into(), + ), + ); + o.push( + "meta.base_after_resources", + Meta, + "link·script 뒤에 온 base (또는 base 여러 개)", + flag(q.base_after_resources || q.bases > 1, q.bases > 0), + Some(json!(q.bases)), + None, + ); + o.push( + "accessibility.invalid_nesting", + Accessibility, + "허용되지 않는 요소 중첩", + Presence::from_bool(!q.invalid_nesting.is_empty()), + list(&q.invalid_nesting), + Some("Nu HTML Checker 금지 조상 규칙 (주요 쌍)".into()), + ); + o.push( + "accessibility.phrasing_content_violation", + Accessibility, + "구문 전용 요소 안의 블록 요소", + Presence::from_bool(!q.phrasing_violations.is_empty()), + list(&q.phrasing_violations), + Some("button·label·span·heading 안의 div·p·ul 등".into()), + ); + o.push( + "accessibility.form_conformance_errors", + Accessibility, + "폼 요소 적합성 오류", + flag(!q.form_errors.is_empty(), q.form_controls > 0), + list(&q.form_errors), + Some( + "required select·selected 중복·label 의 입력 여러 개·list·form 참조·autofocus 중복" + .into(), + ), + ); + o.push( + "content.invalid_urls", + Content, + "형식이 잘못된 URL (공백·역슬래시·잘못된 % 인코딩)", + Presence::from_bool(!q.invalid_urls.is_empty()), + list(&q.invalid_urls), + None, + ); + o.push( + "content.invalid_enum_attrs", + Content, + "명세에 없는 열거형 속성 값", + Presence::from_bool(!q.invalid_enums.is_empty()), + list(&q.invalid_enums), + Some("input type·button type·form method·loading·crossorigin 등".into()), + ); + o.push( + "content.time_datetime_invalid", + Content, + "형식이 잘못된 time datetime", + flag(!q.invalid_times.is_empty(), q.times > 0), + list(&q.invalid_times), + None, + ); + o.push( + "content.unknown_elements", + Content, + "HTML 에 없는 요소 (사용자 정의 요소 제외)", + Presence::from_bool(!q.unknown_elements.is_empty()), + list(&q.unknown_elements), + None, + ); + o.push( + "content.text_not_nfc", + Content, + "NFC 로 정규화되지 않은 텍스트", + Presence::from_bool(q.non_nfc > 0), + Some(json!(q.non_nfc)), + Some("macOS 에서 붙여넣은 자모 분리 한글 등".into()), + ); + o.push( + "structured_data.microdata_invalid", + StructuredData, + "잘못된 microdata (itemprop·itemref·itemtype)", + flag( + !q.microdata_errors.is_empty(), + q.microdata_items > 0 || !q.microdata_errors.is_empty(), + ), + list(&q.microdata_errors), + None, + ); + o.push( + "content.section_without_heading", + Content, + "제목 없는 section·article", + count_presence(q.sections_without_heading, q.sections), + Some(json!(q.sections_without_heading)), + None, + ); + o.push( + "performance.empty_src", + Performance, + "빈 src·href (페이지 자신을 다시 요청)", + Presence::from_bool(!q.empty_src.is_empty()), + list(&q.empty_src), + None, + ); + o.push( + "performance.srcset_sizes_invalid", + Performance, + "srcset w 서술자에 sizes 누락 등", + Presence::from_bool(!q.srcset_errors.is_empty()), + list(&q.srcset_errors), + None, + ); + o.push( + "performance.preload_invalid", + Performance, + "잘못된 preload (as 누락·글꼴 crossorigin 누락)", + flag(!q.preload_errors.is_empty(), q.preloads > 0), + list(&q.preload_errors), + None, + ); + o.push( + "performance.script_attr_ineffective", + Performance, + "효과 없는·잘못된 script 속성", + Presence::from_bool(!q.script_attr_errors.is_empty()), + list(&q.script_attr_errors), + Some("인라인 script 의 async·defer 는 무시되어 렌더링을 막을 수 있음".into()), + ); + o.push( + "performance.script_json_invalid", + Performance, + "importmap·speculationrules JSON 오류", + Presence::from_bool(!q.script_json_errors.is_empty()), + list(&q.script_json_errors), + None, + ); + o.push( + "performance.speculation_rules", + Performance, + "Speculation Rules (prefetch·prerender)", + Presence::from_bool(q.speculation_rules || h.contains_key("speculation-rules")), + None, + None, + ); + o.push( + "performance.excess_preconnect", + Performance, + "preconnect 4개 초과", + flag( + q.preconnect_origins.len() > 4, + !q.preconnect_origins.is_empty(), + ), + list(&q.preconnect_origins), + Some("Chrome DevTools: 4개 넘는 preconnect 는 경쟁을 일으킴".into()), + ); + o.push( + "performance.preconnect_unused", + Performance, + "참조되지 않는 preconnect 출처", + flag( + !q.preconnect_unused.is_empty(), + !q.preconnect_origins.is_empty(), + ), + list(&q.preconnect_unused), + Some("HTML 속성 기준 (스크립트·CSS 가 쓰는 출처는 알 수 없음)".into()), + ); + o.push( + "performance.preconnect_crossorigin_missing", + Performance, + "글꼴 출처 preconnect 의 crossorigin 누락", + Presence::from_bool(!q.preconnect_font_no_crossorigin.is_empty()), + list(&q.preconnect_font_no_crossorigin), + None, + ); + o.push( + "performance.iframe_lazy", + Performance, + "loading=lazy 없는 iframe (첫 번째 제외)", + count_presence(q.iframes_not_lazy, q.iframes.saturating_sub(1)), + Some(json!({ "iframes": q.iframes, "notLazy": q.iframes_not_lazy })), + None, + ); + o.push( + "performance.third_party_embeds", + Performance, + "무거운 서드파티 임베드 (파사드 후보)", + Presence::from_bool(!q.facade_embeds.is_empty()), + list(&q.facade_embeds), + Some("YouTube·Vimeo·채팅 위젯 등".into()), + ); + o.push( + "performance.video_preload", + Performance, + "preload 를 줄이지 않은 video", + count_presence(q.videos_preload_heavy, q.videos), + Some(json!(q.videos_preload_heavy)), + Some("autoplay 가 아니면 preload=none·metadata 권장".into()), + ); + o.push( + "performance.img_decoding", + Performance, + "decoding=async 이미지", + Presence::from_bool(q.img_decoding_async > 0), + Some(json!(q.img_decoding_async)), + None, + ); + o.push( + "content.input_type_generic", + Content, + "이메일·전화 등에 type=text", + Presence::from_bool(!q.generic_inputs.is_empty()), + list(&q.generic_inputs), + Some("이름·id·autocomplete 기준 휴리스틱".into()), + ); + o.push( + "content.form_method_missing", + Content, + "method 없는 form", + count_presence(q.forms_without_method, q.forms), + Some(json!(q.forms_without_method)), + None, + ); + o.push( + "performance.inline_style_attrs", + Performance, + "style 속성 사용 요소", + Presence::from_bool(q.inline_styles > 0), + Some(json!(q.inline_styles)), + None, + ); + o.push( + "security.inline_event_handlers", + Security, + "인라인 이벤트 핸들러 (onclick 등)", + Presence::from_bool(q.inline_handlers > 0), + Some(json!(q.inline_handlers)), + Some("엄격한 CSP 와 함께 쓸 수 없음".into()), + ); + o.push( + "content.ad_blocker_class_names", + Content, + "광고 차단기에 가려지는 id·class", + Presence::from_bool(!q.ad_class_names.is_empty()), + list(&q.ad_class_names), + None, + ); + o.push( + "content.attr_unsafe_chars", + Content, + "보이지 않는 제어 문자가 든 속성 값", + Presence::from_bool(!q.unsafe_attr_chars.is_empty()), + list(&q.unsafe_attr_chars), + None, + ); + o.push( + "performance.legacy_font_formats", + Performance, + "WOFF2 없는 글꼴 (ttf·otf·eot)", + flag( + css_sum(|c| c.legacy_fonts) > 0, + css_sum(|c| c.font_faces) > 0, + ), + Some(json!(css_sum(|c| c.legacy_fonts))), + None, + ); + o.push( + "performance.content_visibility", + Performance, + "content-visibility 사용", + Presence::from_bool(css_sum(|c| c.content_visibility) > 0), + None, + None, + ); + o.push( + "performance.layout_animations", + Performance, + "레이아웃 속성을 움직이는 @keyframes", + Presence::from_bool(css_sum(|c| c.layout_keyframes) > 0), + Some(json!(css_sum(|c| c.layout_keyframes))), + Some("width·top·margin 등은 매 프레임 레이아웃을 다시 계산".into()), + ); + o.push( + "performance.css_prefix_order", + Performance, + "표준 속성 뒤의 접두사 속성", + Presence::from_bool(css_sum(|c| c.prefix_after_standard) > 0), + Some(json!(css_sum(|c| c.prefix_after_standard))), + None, + ); + o.push( + "accessibility.summary_display_changed", + Accessibility, + "summary 의 display 변경", + Presence::from_bool(css_sum(|c| c.summary_display) > 0), + None, + Some("list-item 이 아니면 펼침 표시가 사라짐".into()), + ); + o.push( + "performance.server_timing", + Performance, + "Server-Timing 헤더", + Presence::from_bool(h.contains_key("server-timing")), + header(h, "server-timing").map(Value::from), + None, + ); + o.push( + "performance.link_header_preload", + Performance, + "Link 헤더 preload·preconnect", + Presence::from_bool(!link_preload.is_empty()), + list(&link_preload), + Some("103 Early Hints 와 같은 효과".into()), + ); + o.push( + "performance.asset_compression", + Performance, + "압축 없이 전달되는 CSS·JS", + flag(!uncompressed.is_empty(), encodings_ok > 0), + list(&uncompressed), + Some("압축을 풀지 않는 요청으로 표본 5개 확인".into()), + ); + o.push( + "transport.asset_content_type_mismatch", + Transport, + "JavaScript 가 아닌 Content-Type 의 JS", + flag(!bad_type.is_empty(), scripts_ok > 0), + list(&bad_type), + None, + ); + o.push( + "content.broken_resources", + Content, + "깨진 하위 리소스 (JS·CSS)", + flag(!broken.is_empty() || css_failed > 0, sampled), + Some(json!({ "scripts": broken, "cssFailed": css_failed })), + Some("표본 JS 의 4xx·5xx 와 받지 못한 CSS".into()), + ); + o.push( + "performance.asset_redirects", + Performance, + "리다이렉트되는 JS", + flag(!redirected.is_empty(), scripts_ok > 0), + list(&redirected), + None, + ); + o.push( + "performance.unminified_js", + Performance, + "압축(minify)되지 않은 JS", + flag(!unminified.is_empty(), scripts_ok > 0), + list(&unminified), + Some("들여쓰기·줄바꿈이 2KB 이상이고 10% 이상인 파일".into()), + ); + o.push( + "performance.legacy_javascript", + Performance, + "레거시 JS (Babel 변환·폴리필 흔적)", + flag(!legacy.is_empty(), scripts_ok > 0), + list(&legacy), + Some("regeneratorRuntime·_classCallCheck·core-js 등 (휴리스틱)".into()), + ); +} + fn canonical_hreflang_weight_checks(o: &mut Out, i: &Inputs) { use Category::*; let ext = i.extended; @@ -9296,6 +9821,7 @@ mod tests { change_password: None, gpc: None, conditional: None, + asset_encodings: Vec::new(), feed: Some(failed("https://a.com/feed")), bing_site_auth: Some(failed("https://a.com/BingSiteAuth.xml")), not_found_chain: Some(err()), @@ -9347,6 +9873,7 @@ mod tests { change_password: None, gpc: None, conditional: None, + asset_encodings: Vec::new(), feed: Some(feed), bing_site_auth: Some(found("https://a.com/BingSiteAuth.xml", "")), not_found_chain: Some(Ok(vec![ @@ -10224,4 +10751,103 @@ mod tests { assert_eq!(p(&c, "meta.xml_declaration"), Presence::Missing); assert_eq!(p(&c, "accessibility.statement_link"), Presence::Missing); } + + #[test] + fn quality_and_asset_items() { + use crate::fetch::ResourceSample; + let mut fx = Fx::failing(); + let p = |c: &[Check], id: &str| get(c, id).presence; + let html = r#"

    x

    "#; + fx.page = page("https://a.com/", html); + fx.facts = crate::html::extract(html, &fx.page.final_url); + fx.page + .headers + .insert("server-timing", "db;dur=5".parse().unwrap()); + fx.page + .headers + .insert("link", "; rel=preload; as=style".parse().unwrap()); + let ok = |ct: &str, body: &str, final_url: &str| { + Ok(ResourceSample { + status: 200, + final_url: final_url.into(), + content_type: Some(ct.into()), + bytes: body.len(), + body: body.as_bytes().to_vec(), + }) + }; + let pretty = format!( + "function a() {{\n{}}}\n", + " var x = 1;\n".repeat(400) + ); + fx.extended.page_weight = Some(PageWeight { + scripts: vec![ + ( + "https://a.com/a.js".into(), + ok("text/plain", &pretty, "https://a.com/a.js"), + ), + ( + "https://a.com/b.js".into(), + ok( + "text/javascript", + "regeneratorRuntime.mark()", + "https://cdn.a.com/b.js", + ), + ), + ( + "https://a.com/c.js".into(), + Ok(ResourceSample { + status: 404, + ..Default::default() + }), + ), + ("https://a.com/d.js".into(), Err("boom".into())), + ], + ..Default::default() + }); + fx.extended.search.asset_encodings = vec![ + ("https://a.com/a.css".into(), Ok((200, None))), + ("https://a.com/b.css".into(), Ok((200, Some("br".into())))), + ("https://a.com/c.css".into(), Err("boom".into())), + ]; + let c = fx.run(); + for id in [ + "meta.http_equiv_invalid", + "performance.legacy_font_formats", + "performance.content_visibility", + "performance.layout_animations", + "performance.css_prefix_order", + "accessibility.summary_display_changed", + "performance.server_timing", + "performance.link_header_preload", + "performance.asset_compression", + "transport.asset_content_type_mismatch", + "content.broken_resources", + "performance.asset_redirects", + "performance.unminified_js", + "performance.legacy_javascript", + ] { + assert_eq!(p(&c, id), Presence::Present, "{id}"); + } + fx.extended.page_weight = None; + fx.extended.search.asset_encodings = Vec::new(); + let html = ""; + fx.page = page("https://a.com/", html); + fx.facts = crate::html::extract(html, &fx.page.final_url); + let c = fx.run(); + for id in [ + "meta.http_equiv_invalid", + "performance.asset_compression", + "transport.asset_content_type_mismatch", + "content.broken_resources", + "performance.unminified_js", + "performance.legacy_font_formats", + "performance.iframe_lazy", + "content.time_datetime_invalid", + "structured_data.microdata_invalid", + ] { + assert_eq!(p(&c, id), Presence::NotApplicable, "{id}"); + } + assert_eq!(p(&c, "performance.link_header_preload"), Presence::Missing); + } } diff --git a/crates/devup-access-checker/src/css.rs b/crates/devup-access-checker/src/css.rs index 32becdb..7972599 100644 --- a/crates/devup-access-checker/src/css.rs +++ b/crates/devup-access-checker/src/css.rs @@ -20,6 +20,63 @@ static MOTION: LazyLock = LazyLock::new(|| { }); static JUSTIFY: LazyLock = LazyLock::new(|| Regex::new(r"(?i)text-align\s*:\s*justify").unwrap()); +static CONTENT_VISIBILITY: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)content-visibility\s*:\s*auto").unwrap()); +static BLOCK: LazyLock = LazyLock::new(|| Regex::new(r"\{([^{}]*)\}").unwrap()); +static SUMMARY: LazyLock = LazyLock::new(|| { + Regex::new(r"(?is)(?:^|[},\s])summary\s*(?:,[^{]*)?\{[^}]*?display\s*:\s*([a-z-]+)").unwrap() +}); +static KEYFRAMES: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)@(?:-webkit-|-moz-)?keyframes\b[^{]*\{").unwrap()); +static LAYOUT_PROP: LazyLock = LazyLock::new(|| { + Regex::new(r"(?i)(?:^|[;{\s])(?:width|height|top|left|right|bottom|margin(?:-[a-z]+)?|padding(?:-[a-z]+)?|font-size|border-width)\s*:").unwrap() +}); + +/// 레이아웃·페인트를 다시 하게 만드는 속성을 움직이는 @keyframes 수 (webhint detect-css-reflows). +fn layout_keyframes(css: &str) -> usize { + KEYFRAMES + .find_iter(css) + .filter(|m| { + // 여는 중괄호부터 짝이 맞는 닫는 중괄호까지 + let mut depth = 1usize; + let rest = &css[m.end()..]; + let end = rest + .char_indices() + .find(|(_, c)| { + match c { + '{' => depth += 1, + '}' => depth -= 1, + _ => {} + } + depth == 0 + }) + .map_or(rest.len(), |(i, _)| i); + LAYOUT_PROP.is_match(&rest[..end]) + }) + .count() +} + +/// 선언 블록 하나에서 접두사 없는 속성 뒤에 같은 속성의 접두사 버전이 오는 수. +fn prefix_after_standard(block: &str) -> usize { + let props: Vec = block + .split(';') + .filter_map(|d| { + d.split_once(':') + .map(|(p, _)| p.trim().to_ascii_lowercase()) + }) + .collect(); + props + .iter() + .enumerate() + .filter(|(i, p)| { + ["-webkit-", "-moz-", "-ms-", "-o-"].iter().any(|x| { + p.strip_prefix(x) + .is_some_and(|std| props[..*i].iter().any(|q| q == std)) + }) + }) + .count() +} + static COMMENT: LazyLock = LazyLock::new(|| Regex::new(r"(?s)/\*.*?\*/").unwrap()); #[derive(Debug, Clone, Default, PartialEq, Eq)] @@ -46,6 +103,16 @@ pub struct CssFacts { pub justify: usize, /// `text-decoration: blink` 선언 수 pub blink: usize, + /// WOFF2 없이 ttf·otf·eot·svg 만 쓰는 @font-face 수 + pub legacy_fonts: usize, + /// `content-visibility: auto` 선언 수 + pub content_visibility: usize, + /// 레이아웃·페인트 속성을 움직이는 @keyframes 수 + pub layout_keyframes: usize, + /// 접두사 없는 속성 뒤에 온 접두사 속성 수 (webhint css-prefix-order) + pub prefix_after_standard: usize, + /// summary 의 display 를 list-item 외로 바꾼 규칙 수 + pub summary_display: usize, } impl CssFacts { @@ -62,6 +129,11 @@ impl CssFacts { self.reduced_motion |= other.reduced_motion; self.justify += other.justify; self.blink += other.blink; + self.legacy_fonts += other.legacy_fonts; + self.content_visibility += other.content_visibility; + self.layout_keyframes += other.layout_keyframes; + self.prefix_after_standard += other.prefix_after_standard; + self.summary_display += other.summary_display; } } @@ -83,9 +155,27 @@ pub fn analyze(css: &str) -> CssFacts { reduced_motion: css.to_ascii_lowercase().contains("prefers-reduced-motion"), justify: JUSTIFY.find_iter(&css).count(), blink: crate::aria::css_blink(&css), + content_visibility: CONTENT_VISIBILITY.find_iter(&css).count(), + layout_keyframes: layout_keyframes(&css), + prefix_after_standard: BLOCK + .captures_iter(&css) + .map(|c| prefix_after_standard(&c[1])) + .sum(), + summary_display: SUMMARY + .captures_iter(&css) + .filter(|c| !c[1].eq_ignore_ascii_case("list-item")) + .count(), ..Default::default() }; for c in FONT_FACE.captures_iter(&css) { + let body = c[1].to_ascii_lowercase(); + if !body.contains("woff2") + && [".ttf", ".otf", ".eot", ".svg", "truetype", "opentype"] + .iter() + .any(|x| body.contains(x)) + { + f.legacy_fonts += 1; + } f.font_faces += 1; if !c[1].to_ascii_lowercase().contains("font-display") { f.font_faces_without_display += 1; @@ -119,6 +209,11 @@ mod tests { reduced_motion: false, justify: 0, blink: 0, + legacy_fonts: 0, + content_visibility: 0, + layout_keyframes: 0, + prefix_after_standard: 0, + summary_display: 0, } ); } @@ -147,4 +242,28 @@ mod tests { g.merge(&f); assert_eq!((g.animations, g.reduced_motion, g.justify), (2, true, 2)); } + + #[test] + fn performance_and_compat_rules() { + let f = analyze( + "@font-face{src:url(a.woff2) format('woff2'), url(a.ttf)} @font-face{src:url(b.eot)}\ + .x{content-visibility:auto} @keyframes grow{from{width:0}to{width:10px}} @-webkit-keyframes fade{0%{opacity:0}100%{opacity:1}}\ + @keyframes broken{from{top:0}\ + .y{transition:all 1s;-webkit-transition:all 1s} .z{-webkit-box-shadow:none;box-shadow:none}\ + details summary{display:block} summary{display:list-item}", + ); + assert_eq!( + ( + f.legacy_fonts, + f.content_visibility, + f.layout_keyframes, + f.prefix_after_standard, + f.summary_display + ), + (1, 1, 2, 1, 1) + ); + let mut g = analyze(""); + g.merge(&f); + assert_eq!(g.layout_keyframes, 2); + } } diff --git a/crates/devup-access-checker/src/fetch.rs b/crates/devup-access-checker/src/fetch.rs index cc82219..c77713f 100644 --- a/crates/devup-access-checker/src/fetch.rs +++ b/crates/devup-access-checker/src/fetch.rs @@ -612,22 +612,78 @@ pub async fn fetch_bytes( Ok((status, ct, buf, false)) } -/// 본문을 보관하지 않고 바이트 수만 센다 (`max` 에서 멈춤). 2xx 가 아니면 오류. -pub async fn count_bytes(client: &Client, url: &Url, max: usize) -> Result { +/// 하위 리소스 표본: 상태·최종 URL·Content-Type·전체 크기·앞부분 본문. +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct ResourceSample { + pub status: u16, + pub final_url: String, + pub content_type: Option, + /// 받은 바이트 (상한 `max` 에서 멈춤) + pub bytes: usize, + /// 앞 `keep` 바이트 + pub body: Vec, +} + +/// 리소스를 받아 상태와 크기, 앞부분 본문을 돌려준다 (상태가 오류여도 Ok). +pub async fn sample_resource( + client: &Client, + url: &Url, + max: usize, + keep: usize, +) -> Result { let mut res = send_get(client, url.as_str()) .await .map_err(describe_owned)?; - if !res.status().is_success() { - return Err(format!("HTTP {}", res.status().as_u16())); - } - let mut n = 0; + let mut s = ResourceSample { + status: res.status().as_u16(), + final_url: res.url().to_string(), + content_type: res + .headers() + .get(reqwest::header::CONTENT_TYPE) + .and_then(|v| v.to_str().ok()) + .map(str::to_string), + ..Default::default() + }; while let Some(chunk) = res.chunk().await.map_err(describe_owned)? { - n += chunk.len(); - if n >= max { - return Ok(max); + s.bytes += chunk.len(); + if s.body.len() < keep { + s.body + .extend_from_slice(&chunk[..chunk.len().min(keep - s.body.len())]); + } + if s.bytes >= max { + s.bytes = max; + break; } } - Ok(n) + Ok(s) +} + +/// 압축을 풀지 않는 클라이언트로 요청해 (상태, Content-Encoding) 을 본다. +pub async fn raw_encoding( + ua: &str, + timeout: Duration, + url: &Url, +) -> Result<(u16, Option), String> { + let client = Client::builder() + .user_agent(ua) + .timeout(timeout) + .gzip(false) + .brotli(false) + .build() + .expect("http client"); + let res = client + .get(url.as_str()) + .header(reqwest::header::ACCEPT_ENCODING, "gzip, br") + .send() + .await + .map_err(describe_owned)?; + Ok(( + res.status().as_u16(), + res.headers() + .get(reqwest::header::CONTENT_ENCODING) + .and_then(|v| v.to_str().ok()) + .map(str::to_string), + )) } /// 하위 sitemap 을 받아 URL 목록을 돌려준다. `.xml.gz` (gzip) 도 풀어서 읽는다. @@ -979,7 +1035,7 @@ mod tests { let (status, body) = probe_status_body(&client(), &url).await.unwrap(); assert_eq!((status, body.len()), (404, 65_536)); - // fetch_bytes / count_bytes 상한 + // fetch_bytes / sample_resource 상한 let (_s, url) = serve( "/bin", ResponseTemplate::new(200).set_body_bytes(vec![1u8; 5000]), @@ -987,7 +1043,36 @@ mod tests { .await; let (_, _, bytes, truncated) = fetch_bytes(&client(), &url, 100).await.unwrap(); assert_eq!((bytes.len(), truncated), (100, true)); - assert_eq!(count_bytes(&client(), &url, 100).await.unwrap(), 100); + let r = sample_resource(&client(), &url, 100, 10).await.unwrap(); + assert_eq!((r.status, r.bytes, r.body.len()), (200, 100, 10)); + let r = sample_resource(&client(), &url, 1_000_000, 10_000) + .await + .unwrap(); + assert_eq!((r.bytes, r.body.len()), (5000, 5000)); + assert_eq!( + raw_encoding("t", Duration::from_secs(5), &url) + .await + .unwrap(), + (200, None) + ); + let (_s2, gz) = serve( + "/gz", + ResponseTemplate::new(200).insert_header("content-encoding", "gzip"), + ) + .await; + assert_eq!( + raw_encoding("t", Duration::from_secs(5), &gz) + .await + .unwrap(), + (200, Some("gzip".into())) + ); + let closed = Url::parse("http://127.0.0.1:9/").unwrap(); + assert!( + raw_encoding("t", Duration::from_secs(5), &closed) + .await + .is_err() + ); + assert!(sample_resource(&client(), &closed, 10, 10).await.is_err()); // UA 요청은 앞 200KB 만 본다 let (_s, url) = serve( diff --git a/crates/devup-access-checker/src/html.rs b/crates/devup-access-checker/src/html.rs index 573c285..d650bfb 100644 --- a/crates/devup-access-checker/src/html.rs +++ b/crates/devup-access-checker/src/html.rs @@ -98,6 +98,7 @@ pub struct PageFacts { pub sec: crate::sec::SecFacts, pub google: crate::google::GoogleFacts, pub aria: crate::aria::AriaFacts, + pub quality: crate::quality::QualityFacts, /// 신뢰·법적 정보 pub trust: crate::trust::TrustFacts, } @@ -372,6 +373,7 @@ pub fn extract(html: &str, page_url: &Url) -> PageFacts { f.sec = crate::sec::extract(&doc, base); f.google = crate::google::extract(&doc, html, base); f.aria = crate::aria::extract(&doc, base); + f.quality = crate::quality::extract(&doc, base); f } diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 7070883..298ea69 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -25,6 +25,7 @@ mod llms; mod model; mod more; mod naver_ld; +mod quality; mod robots; mod rules; mod schema_types; @@ -653,21 +654,31 @@ impl Checker { return None; } let x = &facts.extra; - let js: Vec<(String, usize)> = stream::iter(sample(&x.script_urls, MAX_JS_FILES)) - .map(|u| { - let probe = &probe; - async move { - let url = Url::parse(u).ok()?; - let n = fetch::count_bytes(probe, &url, 20 * 1024 * 1024) - .await - .ok()?; - Some((u.clone(), n)) - } + let scripts: Vec<(String, Result)> = stream::iter( + sample(&x.script_urls, MAX_JS_FILES) + .into_iter() + .filter_map(|u| Url::parse(u).ok().map(|url| (u, url))), + ) + .map(|(u, url)| { + let probe = &probe; + async move { + let r = + fetch::sample_resource(probe, &url, 20 * 1024 * 1024, 1024 * 1024).await; + (u.clone(), r) + } + }) + .buffer_unordered(8) + .collect() + .await; + let js: Vec<(String, usize)> = scripts + .iter() + .filter_map(|(u, r)| { + r.as_ref() + .ok() + .filter(|s| (200..300).contains(&s.status)) + .map(|s| (u.clone(), s.bytes)) }) - .buffer_unordered(8) - .filter_map(|x| async move { x }) - .collect() - .await; + .collect(); let imgs: Vec<(String, Option)> = stream::iter(sample(&x.image_urls, MAX_IMAGES)) .map(|u| { let probe = &probe; @@ -702,6 +713,7 @@ impl Checker { checks::LARGE_SCRIPT_BYTES, ), large_images: checks::largest(sized.iter().cloned(), checks::LARGE_IMAGE_BYTES), + scripts, large_gifs: checks::largest( sized.iter().filter(|(u, _)| is_gif(u)).cloned(), checks::LARGE_GIF_BYTES, @@ -774,16 +786,34 @@ impl Checker { } Some(fetch::conditional_status(&probe, &base, etag, lm).await) }; + let asset_encodings = async { + if !opts.check_resources { + return Vec::new(); + } + let urls: Vec<(&String, Url)> = facts + .extra + .stylesheet_urls + .iter() + .chain(&facts.extra.script_urls) + .filter_map(|u| Url::parse(u).ok().map(|url| (u, url))) + .take(5) + .collect(); + join_all(urls.into_iter().map(|(u, url)| async move { + let r = fetch::raw_encoding(&opts.user_agent, opts.probe_timeout, &url).await; + (u.clone(), r) + })) + .await + }; let gpc_url = at("/.well-known/gpc.json"); let gpc = fetch::probe_file(&probe, &gpc_url, Json); let ( (feed, bing, not_found_chain, indexnow), (llms_subpath, agent_card, robots_chain), - (change_password, gpc, conditional), + (change_password, gpc, conditional, asset_encodings), ) = tokio::join!( async { tokio::join!(feed, bing, not_found_chain, indexnow) }, async { tokio::join!(llms_subpath, agent_card, robots_chain) }, - async { tokio::join!(change_password, gpc, conditional) }, + async { tokio::join!(change_password, gpc, conditional, asset_encodings) }, ); checks::SearchProbes { llms_subpath, @@ -791,6 +821,7 @@ impl Checker { change_password, gpc: Some(gpc), conditional, + asset_encodings, robots_chain, feed, bing_site_auth: Some(bing), diff --git a/crates/devup-access-checker/src/quality.rs b/crates/devup-access-checker/src/quality.rs new file mode 100644 index 0000000..5655d42 --- /dev/null +++ b/crates/devup-access-checker/src/quality.rs @@ -0,0 +1,886 @@ +//! Nu HTML Checker·HTMLHint·webhint·Chrome DevTools 와 대조해 추가한 HTML 적합성·성능 정적 신호. +//! 대조 결과는 `docs/coverage.md` 에 있다. 네트워크 접근 없음. + +use std::collections::HashSet; +use std::sync::LazyLock; + +use regex::Regex; +use scraper::{ElementRef, Html, Selector}; +use unicode_normalization::is_nfc; +use url::Url; + +static ALL: LazyLock = LazyLock::new(|| Selector::parse("*").expect("valid selector")); +static BAD_PERCENT: LazyLock = LazyLock::new(|| { + Regex::new(r"%(?:[^0-9A-Fa-f]|[0-9A-Fa-f][^0-9A-Fa-f]|[0-9A-Fa-f]?$)").unwrap() +}); +static DATETIME: LazyLock = LazyLock::new(|| { + Regex::new(concat!( + r"^(?:\d{4,}(?:-\d{2}(?:-\d{2})?)?", + r"|--\d{2}-\d{2}", + r"|\d{4,}-W\d{2}", + r"|\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?", + r"|\d{4,}-\d{2}-\d{2}[T ]\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?", + r"|Z|[+-]\d{2}:?\d{2}", + r"|P(?:\d+D)?(?:T(?:\d+H)?(?:\d+M)?(?:\d+(?:\.\d+)?S)?)?", + r"|(?:\s*\d+(?:\.\d+)?\s*[wdhms])+\s*)$" + )) + .unwrap() +}); +static AD_TOKEN: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)(?:^|[-_])ad(?:[-_]|$)").unwrap()); +static UNSAFE_CHARS: LazyLock = LazyLock::new(|| { + Regex::new("[\u{0}-\u{8}\u{b}\u{c}\u{e}-\u{1f}\u{7f}-\u{9f}\u{ad}\u{600}-\u{604}\u{70f}\u{17b4}\u{17b5}\u{200c}-\u{200f}\u{2028}-\u{202f}\u{2060}-\u{206f}\u{feff}\u{fff0}-\u{ffff}]").unwrap() +}); +static GENERIC_FIELD: LazyLock = + LazyLock::new(|| Regex::new(r"(?i)e-?mail|phone|\btel\b|mobile|zip|postal|card").unwrap()); + +/// HTML 명세 요소 목록 (현행 + 폐기, SVG·MathML 은 제외하고 svg·math 루트만). +const HTML_ELEMENTS: &[&str] = &[ + "a", + "abbr", + "address", + "area", + "article", + "aside", + "audio", + "b", + "base", + "bdi", + "bdo", + "blockquote", + "body", + "br", + "button", + "canvas", + "caption", + "cite", + "code", + "col", + "colgroup", + "data", + "datalist", + "dd", + "del", + "details", + "dfn", + "dialog", + "div", + "dl", + "dt", + "em", + "embed", + "fieldset", + "figcaption", + "figure", + "footer", + "form", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "head", + "header", + "hgroup", + "hr", + "html", + "i", + "iframe", + "img", + "input", + "ins", + "kbd", + "label", + "legend", + "li", + "link", + "main", + "map", + "mark", + "menu", + "meta", + "meter", + "nav", + "noscript", + "object", + "ol", + "optgroup", + "option", + "output", + "p", + "param", + "picture", + "pre", + "progress", + "q", + "rp", + "rt", + "ruby", + "s", + "samp", + "script", + "search", + "section", + "select", + "selectedcontent", + "slot", + "small", + "source", + "span", + "strong", + "style", + "sub", + "summary", + "sup", + "table", + "tbody", + "td", + "template", + "textarea", + "tfoot", + "th", + "thead", + "time", + "title", + "tr", + "track", + "u", + "ul", + "var", + "video", + "wbr", + "svg", + "math", + // 폐기 요소 (accessibility.obsolete_elements 가 따로 본다) + "acronym", + "applet", + "basefont", + "bgsound", + "big", + "blink", + "center", + "dir", + "font", + "frame", + "frameset", + "isindex", + "keygen", + "listing", + "marquee", + "menuitem", + "multicol", + "nextid", + "nobr", + "noembed", + "noframes", + "plaintext", + "rb", + "rtc", + "spacer", + "strike", + "tt", + "xmp", + "image", +]; +/// 같은 요소를 품을 수 없는 요소 (Nu "must not appear as a descendant of") +const NO_SELF_NEST: &[&str] = &[ + "form", "label", "progress", "meter", "dfn", "noscript", "address", "a", "button", +]; +const BLOCKS: &[&str] = &[ + "div", + "p", + "ul", + "ol", + "dl", + "table", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6", + "section", + "article", + "nav", + "header", + "footer", + "form", + "figure", + "blockquote", + "pre", + "hr", + "main", + "aside", + "address", + "fieldset", +]; +const PHRASING_ONLY: &[&str] = &[ + "button", "label", "span", "legend", "h1", "h2", "h3", "h4", "h5", "h6", "p", "a", +]; +const ENUMS: &[(&str, &str, &[&str])] = &[ + ( + "input", + "type", + &[ + "hidden", + "text", + "search", + "tel", + "url", + "email", + "password", + "date", + "month", + "week", + "time", + "datetime-local", + "number", + "range", + "color", + "checkbox", + "radio", + "file", + "submit", + "image", + "reset", + "button", + ], + ), + ("button", "type", &["submit", "reset", "button"]), + ("form", "method", &["get", "post", "dialog"]), + ( + "form", + "enctype", + &[ + "application/x-www-form-urlencoded", + "multipart/form-data", + "text/plain", + ], + ), + ("*", "loading", &["lazy", "eager"]), + ("*", "decoding", &["sync", "async", "auto"]), + ("*", "fetchpriority", &["high", "low", "auto"]), + ("*", "crossorigin", &["", "anonymous", "use-credentials"]), + ( + "*", + "referrerpolicy", + &[ + "", + "no-referrer", + "no-referrer-when-downgrade", + "same-origin", + "origin", + "strict-origin", + "origin-when-cross-origin", + "strict-origin-when-cross-origin", + "unsafe-url", + ], + ), + ("video", "preload", &["", "none", "metadata", "auto"]), + ("audio", "preload", &["", "none", "metadata", "auto"]), + ( + "track", + "kind", + &[ + "subtitles", + "captions", + "descriptions", + "chapters", + "metadata", + ], + ), +]; +const PRELOAD_AS: &[&str] = &[ + "audio", + "audioworklet", + "document", + "embed", + "fetch", + "font", + "image", + "manifest", + "object", + "paintworklet", + "report", + "script", + "serviceworker", + "sharedworker", + "style", + "track", + "video", + "worker", + "xslt", + "json", +]; +/// 파사드로 대체할 수 있는 무거운 임베드 (third-party-web 의 facades 와 국내 채팅 위젯) +const FACADE_HOSTS: &[&str] = &[ + "youtube.com", + "youtube-nocookie.com", + "player.vimeo.com", + "widget.intercom.io", + "js.intercomcdn.com", + "js.driftt.com", + "static.zdassets.com", + "cdn.livechatinc.com", + "embed.tawk.to", + "client.crisp.chat", + "cdn.channel.io", + "beacon-v2.helpscout.net", +]; + +#[derive(Debug, Clone, Default, PartialEq, Eq)] +pub struct QualityFacts { + pub base_after_resources: bool, + pub bases: usize, + pub invalid_nesting: Vec, + pub phrasing_violations: Vec, + pub form_controls: usize, + pub form_errors: Vec, + pub invalid_urls: Vec, + pub invalid_enums: Vec, + pub times: usize, + pub invalid_times: Vec, + pub unknown_elements: Vec, + pub non_nfc: usize, + pub microdata_items: usize, + pub microdata_errors: Vec, + pub sections: usize, + pub sections_without_heading: usize, + pub empty_src: Vec, + pub srcset_errors: Vec, + pub preloads: usize, + pub preload_errors: Vec, + pub script_attr_errors: Vec, + pub script_json_errors: Vec, + pub speculation_rules: bool, + pub preconnect_origins: Vec, + pub preconnect_unused: Vec, + pub preconnect_font_no_crossorigin: Vec, + pub iframes: usize, + pub iframes_not_lazy: usize, + pub facade_embeds: Vec, + pub videos: usize, + pub videos_preload_heavy: usize, + pub img_decoding_async: usize, + pub generic_inputs: Vec, + pub forms: usize, + pub forms_without_method: usize, + pub inline_styles: usize, + pub inline_handlers: usize, + pub ad_class_names: Vec, + pub unsafe_attr_chars: Vec, +} + +fn push(v: &mut Vec, s: String) { + if v.len() < 20 && !v.contains(&s) { + v.push(s); + } +} + +fn ancestors<'a>(el: &ElementRef<'a>) -> impl Iterator> { + el.ancestors().filter_map(ElementRef::wrap) +} + +fn in_foreign(el: &ElementRef) -> bool { + ancestors(el).any(|a| matches!(a.value().name(), "svg" | "math")) +} + +pub fn extract(doc: &Html, base: &Url) -> QualityFacts { + let mut f = QualityFacts::default(); + let ids: HashSet<&str> = doc + .select(&ALL) + .filter_map(|e| e.value().attr("id")) + .collect(); + let forms_by_id: HashSet<&str> = doc + .select(&ALL) + .filter(|e| e.value().name() == "form") + .filter_map(|e| e.value().attr("id")) + .collect(); + let datalists: HashSet<&str> = doc + .select(&ALL) + .filter(|e| e.value().name() == "datalist") + .filter_map(|e| e.value().attr("id")) + .collect(); + let itemref_ids: HashSet<&str> = doc + .select(&ALL) + .filter_map(|e| e.value().attr("itemref")) + .flat_map(str::split_ascii_whitespace) + .collect(); + let mut seen_resource = false; + let mut autofocus = 0; + let mut referenced = String::new(); + + for el in doc.select(&ALL) { + let e = el.value(); + let name = e.name(); + let get = |a: &str| e.attr(a).map(str::trim); + let lc = |a: &str| get(a).map(str::to_ascii_lowercase); + for (k, v) in e.attrs() { + let hint = name == "link" + && e.attr("rel").is_some_and(|r| { + let r = r.to_ascii_lowercase(); + r.contains("preconnect") || r.contains("dns-prefetch") + }); + if matches!(k, "src" | "href" | "srcset" | "action" | "data" | "poster") && !hint { + referenced.push_str(v); + referenced.push(' '); + } + if UNSAFE_CHARS.is_match(v) { + push(&mut f.unsafe_attr_chars, format!("{name}[{k}]")); + } + } + + // ===== 문서 구조 ===== + match name { + "link" | "script" => seen_resource = true, + "base" => { + f.bases += 1; + f.base_after_resources |= seen_resource; + } + _ => {} + } + if NO_SELF_NEST.contains(&name) && ancestors(&el).any(|a| a.value().name() == name) { + push(&mut f.invalid_nesting, format!("{name} 안의 {name}")); + } + if matches!(name, "header" | "footer") + && ancestors(&el).any(|a| matches!(a.value().name(), "header" | "footer")) + { + push(&mut f.invalid_nesting, format!("header·footer 안의 {name}")); + } + if name == "main" + && ancestors(&el).any(|a| { + matches!( + a.value().name(), + "article" | "aside" | "footer" | "header" | "nav" + ) + }) + { + push( + &mut f.invalid_nesting, + "article·aside·header·footer·nav 안의 main".into(), + ); + } + if BLOCKS.contains(&name) + && let Some(p) = ancestors(&el).find(|a| PHRASING_ONLY.contains(&a.value().name())) + && !(p.value().name() == "a" + && !ancestors(&p) + .any(|x| PHRASING_ONLY.contains(&x.value().name()) && x.value().name() != "a")) + { + push( + &mut f.phrasing_violations, + format!("{} 안의 {name}", p.value().name()), + ); + } + if !in_foreign(&el) && !HTML_ELEMENTS.contains(&name) && !name.contains('-') { + push(&mut f.unknown_elements, name.to_string()); + } + + // ===== 폼 ===== + if matches!(name, "input" | "select" | "textarea" | "button") { + f.form_controls += 1; + if let Some(fid) = get("form") + && !forms_by_id.contains(fid) + { + push(&mut f.form_errors, format!("form=\"{fid}\" 대상 없음")); + } + autofocus += usize::from(e.attr("autofocus").is_some()); + } + if name == "input" + && let Some(l) = get("list") + && !datalists.contains(l) + { + push( + &mut f.form_errors, + format!("list=\"{l}\" 가 datalist 가 아님"), + ); + } + if name == "select" { + let options: Vec = el + .descendants() + .filter_map(ElementRef::wrap) + .filter(|o| o.value().name() == "option") + .collect(); + let selected = options + .iter() + .filter(|o| o.value().attr("selected").is_some()) + .count(); + if selected > 1 && e.attr("multiple").is_none() { + push( + &mut f.form_errors, + "multiple 없는 select 에 selected 여러 개".into(), + ); + } + let single = e.attr("multiple").is_none() && get("size").is_none_or(|s| s == "1"); + if e.attr("required").is_some() && single { + let first_ok = options.first().is_some_and(|o| { + o.value().attr("value").map_or_else( + || o.text().collect::().trim().is_empty(), + |v| v.is_empty(), + ) && !ancestors(o).any(|a| a.value().name() == "optgroup") + }); + if !first_ok { + push( + &mut f.form_errors, + "required select 의 첫 option 값이 비어 있지 않음".into(), + ); + } + } + } + if name == "label" { + let labelable = el + .descendants() + .filter_map(ElementRef::wrap) + .filter(|d| { + matches!( + d.value().name(), + "input" + | "select" + | "textarea" + | "button" + | "meter" + | "output" + | "progress" + ) && d + .value() + .attr("type") + .is_none_or(|t| !t.eq_ignore_ascii_case("hidden")) + }) + .count(); + if labelable > 1 { + push(&mut f.form_errors, "label 하나에 입력 요소 여러 개".into()); + } + } + if name == "form" { + f.forms += 1; + f.forms_without_method += usize::from(e.attr("method").is_none()); + } + if name == "input" + && lc("type").is_none_or(|t| t == "text" || t.is_empty()) + && e.attr("inputmode").is_none() + { + let hint = format!( + "{} {} {}", + get("name").unwrap_or_default(), + get("id").unwrap_or_default(), + get("autocomplete").unwrap_or_default() + ); + if GENERIC_FIELD.is_match(&hint) { + push( + &mut f.generic_inputs, + hint.split_whitespace() + .next() + .unwrap_or_default() + .to_string(), + ); + } + } + + // ===== 속성 값 ===== + for a in ["href", "src", "action", "poster", "cite", "data"] { + if let Some(v) = e.attr(a) { + let t = v.trim(); + if !t.to_ascii_lowercase().starts_with("javascript:") + && !t.starts_with("data:") + && (t.contains([' ', '\\', '\t', '\n']) || BAD_PERCENT.is_match(t)) + { + push( + &mut f.invalid_urls, + format!("{name}[{a}]={}", t.chars().take(80).collect::()), + ); + } + } + } + for (el_name, attr, allowed) in ENUMS { + if (*el_name == "*" || *el_name == name) + && let Some(v) = lc(attr) + && !allowed.contains(&v.as_str()) + { + push(&mut f.invalid_enums, format!("{name}[{attr}={v}]")); + } + } + if name == "time" { + f.times += 1; + let v = get("datetime") + .map(str::to_string) + .unwrap_or_else(|| el.text().collect::().trim().to_string()); + if !DATETIME.is_match(&v) { + push(&mut f.invalid_times, v.chars().take(40).collect()); + } + } + + // ===== microdata ===== + let scope = e.attr("itemscope").is_some(); + f.microdata_items += usize::from(scope); + if e.attr("itemprop").is_some() + && !ancestors(&el).any(|a| a.value().attr("itemscope").is_some()) + && !e.attr("id").is_some_and(|id| itemref_ids.contains(id)) + { + push( + &mut f.microdata_errors, + format!("{name}[itemprop] 이 item 밖에 있음"), + ); + } + if !scope + && (e.attr("itemtype").is_some() + || e.attr("itemid").is_some() + || e.attr("itemref").is_some()) + { + push( + &mut f.microdata_errors, + format!("{name}: itemscope 없이 itemtype·itemid·itemref"), + ); + } + for r in get("itemref").unwrap_or_default().split_ascii_whitespace() { + if !ids.contains(r) { + push( + &mut f.microdata_errors, + format!("itemref=\"{r}\" 대상 없음"), + ); + } + } + if matches!(name, "section" | "article") { + f.sections += 1; + let heading = el + .descendants() + .filter_map(ElementRef::wrap) + .any(|d| matches!(d.value().name(), "h1" | "h2" | "h3" | "h4" | "h5" | "h6")); + f.sections_without_heading += usize::from(!heading); + } + + // ===== 리소스 ===== + if (matches!( + name, + "img" | "script" | "iframe" | "embed" | "source" | "audio" | "video" + ) && get("src") == Some("")) + || (name == "link" && get("href") == Some("")) + || (name == "img" + && e.attr("src").is_none() + && e.attr("srcset").is_none() + && e.attr("data-src").is_none()) + { + push(&mut f.empty_src, name.to_string()); + } + let srcset = get("srcset"); + if matches!(name, "img" | "source") { + if srcset.is_some_and(|s| s.split(',').any(|c| c.trim().ends_with('w'))) + && e.attr("sizes").is_none() + { + push( + &mut f.srcset_errors, + format!("{name}: w 서술자에 sizes 없음"), + ); + } + if e.attr("sizes").is_some() && srcset.is_none() { + push(&mut f.srcset_errors, format!("{name}: srcset 없이 sizes")); + } + } + let rel = lc("rel").unwrap_or_default(); + let rels: Vec<&str> = rel.split_ascii_whitespace().collect(); + if name == "link" && rels.contains(&"preload") { + f.preloads += 1; + match lc("as") { + None => push(&mut f.preload_errors, "as 없음".into()), + Some(a) if !PRELOAD_AS.contains(&a.as_str()) => { + push(&mut f.preload_errors, format!("as={a}")) + } + Some(a) if a == "font" && e.attr("crossorigin").is_none() => push( + &mut f.preload_errors, + "글꼴 preload 에 crossorigin 없음".into(), + ), + _ => {} + } + } + if name == "link" + && rels.contains(&"preconnect") + && let Some(u) = get("href").and_then(|h| base.join(h).ok()) + { + let origin = u.origin().ascii_serialization(); + if !f.preconnect_origins.contains(&origin) { + f.preconnect_origins.push(origin); + } + if u.host_str() == Some("fonts.gstatic.com") && e.attr("crossorigin").is_none() { + push(&mut f.preconnect_font_no_crossorigin, u.to_string()); + } + } + if name == "script" { + let typ = lc("type").unwrap_or_default(); + let inline = e.attr("src").is_none(); + if inline { + for a in ["async", "defer", "integrity"] { + if e.attr(a).is_some() { + push(&mut f.script_attr_errors, format!("인라인 script 의 {a}")); + } + } + if e.attr("charset").is_some() { + push( + &mut f.script_attr_errors, + "src 없는 script 의 charset".into(), + ); + } + } + if typ == "module" && e.attr("nomodule").is_some() { + push( + &mut f.script_attr_errors, + "type=module 과 nomodule 함께 사용".into(), + ); + } + if matches!(typ.as_str(), "importmap" | "speculationrules") { + f.speculation_rules |= typ == "speculationrules"; + let body = el.text().collect::(); + match serde_json::from_str::(body.trim()) { + Ok(serde_json::Value::Object(m)) => { + let allowed: &[&str] = if typ == "importmap" { + &["imports", "scopes", "integrity"] + } else { + &["prefetch", "prerender", "tag"] + }; + for k in m.keys().filter(|k| !allowed.contains(&k.as_str())) { + push( + &mut f.script_json_errors, + format!("{typ}: 알 수 없는 키 {k}"), + ); + } + } + _ => push( + &mut f.script_json_errors, + format!("{typ}: JSON 객체가 아님"), + ), + } + } + } + if name == "iframe" { + f.iframes += 1; + if f.iframes > 1 && lc("loading").as_deref() != Some("lazy") { + f.iframes_not_lazy += 1; + } + } + if matches!(name, "iframe" | "script") + && let Some(u) = get("src").and_then(|s| base.join(s).ok()) + && let Some(h) = u.host_str() + && FACADE_HOSTS + .iter() + .any(|f2| h == *f2 || h.ends_with(&format!(".{f2}"))) + { + push(&mut f.facade_embeds, h.to_string()); + } + if name == "video" { + f.videos += 1; + if e.attr("autoplay").is_none() + && !matches!(lc("preload").as_deref(), Some("none" | "metadata")) + { + f.videos_preload_heavy += 1; + } + } + f.img_decoding_async += + usize::from(name == "img" && lc("decoding").as_deref() == Some("async")); + f.inline_styles += usize::from(e.attr("style").is_some()); + f.inline_handlers += usize::from(e.attrs().any(|(k, _)| k.starts_with("on"))); + for token in e.classes().chain(e.id()) { + if AD_TOKEN.is_match(token) { + push(&mut f.ad_class_names, token.to_string()); + } + } + } + if autofocus > 1 { + push(&mut f.form_errors, "autofocus 여러 개".into()); + } + for origin in &f.preconnect_origins { + let host = origin.split("://").nth(1).unwrap_or_default(); + if !referenced.contains(host) { + push(&mut f.preconnect_unused, origin.clone()); + } + } + if let Some(body) = doc + .select(&Selector::parse("body").expect("valid selector")) + .next() + { + f.non_nfc = body.text().filter(|t| !is_nfc(t)).count(); + } + f +} + +#[cfg(test)] +mod tests { + use super::*; + + fn run(html: &str) -> QualityFacts { + extract( + &Html::parse_document(html), + &Url::parse("https://a.com/").unwrap(), + ) + } + + #[test] + fn conformance_and_resources() { + let f = run( + r#" + + + + + +
    f
    +
    m
    허용
    금지
    +? + + + +spj +
    + +

    한글

    한글

    +
    a
    b

    ok

    ref

    +

    no heading

    ok

    + + + + +

    s

    z

    +"#, + ); + assert!(f.base_after_resources); + assert_eq!(f.bases, 2); + assert!(f.invalid_nesting.len() >= 3, "{:?}", f.invalid_nesting); + assert!( + f.phrasing_violations + .contains(&"button 안의 div".to_string()), + "{:?}", + f.phrasing_violations + ); + assert!( + f.phrasing_violations.contains(&"a 안의 div".to_string()), + "{:?}", + f.phrasing_violations + ); + assert_eq!(f.unknown_elements, ["foo"]); + assert_eq!(f.form_errors.len(), 6, "{:?}", f.form_errors); + assert_eq!(f.invalid_urls.len(), 3, "{:?}", f.invalid_urls); + assert_eq!(f.invalid_enums.len(), 5, "{:?}", f.invalid_enums); + assert_eq!((f.times, f.invalid_times.len()), (4, 2)); + assert_eq!(f.microdata_errors.len(), 3, "{:?}", f.microdata_errors); + assert_eq!((f.sections, f.sections_without_heading), (3, 2)); + assert_eq!(f.empty_src.len(), 2, "{:?}", f.empty_src); + assert_eq!(f.srcset_errors.len(), 2); + assert_eq!((f.preloads, f.preload_errors.len()), (4, 3)); + assert_eq!(f.script_attr_errors.len(), 3, "{:?}", f.script_attr_errors); + assert_eq!(f.script_json_errors.len(), 3, "{:?}", f.script_json_errors); + assert!(f.speculation_rules); + assert_eq!(f.preconnect_origins.len(), 5); + assert!(f.preconnect_unused.len() >= 4); + assert_eq!(f.preconnect_font_no_crossorigin.len(), 1); + assert_eq!((f.iframes, f.iframes_not_lazy), (3, 1)); + assert_eq!(f.facade_embeds, ["www.youtube.com"]); + assert_eq!((f.videos, f.videos_preload_heavy), (3, 1)); + assert_eq!(f.img_decoding_async, 1); + assert_eq!(f.generic_inputs, ["email"]); + assert_eq!((f.forms, f.forms_without_method), (2, 1)); + assert_eq!((f.inline_styles, f.inline_handlers), (1, 1)); + assert_eq!(f.ad_class_names, ["ad-banner"]); + assert_eq!(f.unsafe_attr_chars, ["p[title]"]); + let nfd: String = unicode_normalization::UnicodeNormalization::nfd("한글").collect(); + let f = run(&format!("

    {nfd}

    ")); + assert_eq!(f.non_nfc, 1); + assert_eq!(run(""), QualityFacts::default()); + } +} From abfd75c4057fe48bbf3292b1f6d62243bacdc6cd Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 16:45:54 +0900 Subject: [PATCH 20/21] =?UTF-8?q?docs:=202=EC=B0=A8=20=EB=8C=80=EC=A1=B0?= =?UTF-8?q?=20=EC=B6=9C=EC=B2=98=EB=A5=BC=20=EB=8C=80=EC=A1=B0=ED=91=9C?= =?UTF-8?q?=EC=97=90=20=EA=B8=B0=EB=A1=9D=ED=95=98=EA=B3=A0=20Observatory?= =?UTF-8?q?=C2=B7webhint=C2=B7HTMLHint=20=EB=A5=BC=20=EA=B8=B0=EA=B3=84=20?= =?UTF-8?q?=EB=8C=80=EC=A1=B0=EC=97=90=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 검색엔진 문서(2차)·AI·GEO 프로토콜·보안 스캐너·접근성 검사기·HTML 검사기 절 - 레거시 JS 판정에서 Object.assign 등 현대 코드에도 있는 패턴 제외 - Rust 1.99 커버리지에서 줄 단위로 세는 matches! 를 상수 목록으로 바꿈 Co-Authored-By: Claude Opus 5.5 --- crates/devup-access-checker/src/aria.rs | 21 +-- crates/devup-access-checker/src/checks.rs | 2 - docs/coverage.md | 172 +++++++++++++++++++++- scripts/check_coverage.py | 20 +++ 4 files changed, 196 insertions(+), 19 deletions(-) diff --git a/crates/devup-access-checker/src/aria.rs b/crates/devup-access-checker/src/aria.rs index 54754fe..bf95adc 100644 --- a/crates/devup-access-checker/src/aria.rs +++ b/crates/devup-access-checker/src/aria.rs @@ -181,6 +181,10 @@ const PRESENTATIONAL_CHILDREN: &[&str] = &[ "switch", "tab", ]; +/// 자식이 표현용인 역할 안에 있으면 의미를 잃는 요소 +const SEMANTIC_CHILDREN: &[&str] = &[ + "h1", "h2", "h3", "h4", "h5", "h6", "ul", "ol", "table", "nav", "main", +]; const LANDMARKS: &[&str] = &[ "navigation", "complementary", @@ -477,22 +481,7 @@ pub fn extract(doc: &Html, base: &Url) -> AriaFacts { .descendants() .filter_map(ElementRef::wrap) .skip(1) - .any(|d| { - has_attr(&d, "role") - || matches!( - d.value().name(), - "h1" | "h2" - | "h3" - | "h4" - | "h5" - | "h6" - | "ul" - | "ol" - | "table" - | "nav" - | "main" - ) - }) + .any(|d| has_attr(&d, "role") || SEMANTIC_CHILDREN.contains(&d.value().name())) { push(&mut f.presentational_children, tag(r)); } diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index d9b1a73..c1cc2d4 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -7870,8 +7870,6 @@ const LEGACY_JS: &[&str] = &[ "_toConsumableArray(", "core-js/modules", "__core-js_shared__", - "Array.prototype.includes||", - "Object.assign||", ]; /// 줄 앞 들여쓰기·빈 줄 바이트 (minify 로 줄일 수 있는 양의 추정). diff --git a/docs/coverage.md b/docs/coverage.md index 361f1f7..94ffdb9 100644 --- a/docs/coverage.md +++ b/docs/coverage.md @@ -4,7 +4,7 @@ 표의 항목 id 는 모두 [`CATALOG`](../crates/devup-access-checker/src/catalog.rs)에 있으며, 테스트(`coverage_doc_ids_exist`)가 이를 확인합니다. -`python scripts/check_coverage.py` 는 아래 기준의 최신 원문을 받아 대조표·내장 목록과 다시 대조하고, 빠진 이름이 있으면 출력합니다. axe-core 규칙, Lighthouse 감사, Google 구조화 데이터 문서, OWASP 권장 헤더, WCAG 2.2 성공 기준, Open Graph 속성, Web App Manifest 멤버, WHATWG HTML 폐기 속성, schema.org 타입, MDN 폐기·비표준 헤더가 대상입니다. KWCAG 2.2, Google 검색 센터 기본 요건, X Cards, 네이버 서치어드바이저, Bing 웹마스터 가이드라인은 원문이 기계로 읽을 수 있는 목록이 아니라서 사람이 대조했습니다. +`python scripts/check_coverage.py` 는 아래 기준의 최신 원문을 받아 대조표·내장 목록과 다시 대조하고, 빠진 이름이 있으면 출력합니다. axe-core 규칙, Lighthouse 감사, Google 구조화 데이터 문서, OWASP 권장 헤더, WCAG 2.2 성공 기준, Open Graph 속성, Web App Manifest 멤버, WHATWG HTML 폐기 속성, schema.org 타입, MDN 폐기·비표준 헤더가 대상입니다. Observatory 테스트, webhint hint, HTMLHint 규칙도 대상입니다. KWCAG 2.2, Google 검색 센터 문서, X Cards, 네이버 서치어드바이저, Bing, Yandex, Daum, Apple, EN 301 549, IBM Equal Access, HTML_CodeSniffer, ARIA in HTML, W3C i18n checker, WAVE, Nu HTML Checker, AI·GEO 프로토콜 명세는 사람이 대조했습니다 (규칙 수는 각 절에 적었습니다). - [KWCAG 2.2 (33개 검사항목)](#kwcag-22) - [WCAG 2.2 (성공 기준 87개)](#wcag-22) @@ -20,6 +20,11 @@ - [MDN 폐기 헤더](#mdn-폐기-헤더) - [네이버 서치어드바이저](#네이버-서치어드바이저) - [Bing 웹마스터 가이드라인](#bing-웹마스터-가이드라인) +- [검색엔진 문서 (2차)](#검색엔진-문서-2차) +- [AI·GEO 프로토콜](#aigeo-프로토콜) +- [보안 스캐너](#보안-스캐너) +- [접근성 검사기](#접근성-검사기) +- [HTML 검사기·성능](#html-검사기성능) - [생성형 검색(GEO)](#생성형-검색geo) - [확인할 수 없는 것 요약](#확인할-수-없는-것-요약) @@ -598,6 +603,171 @@ MDN browser-compat-data 가 폐기(deprecated) 또는 비표준으로 표시한 | IndexNow | 키 파일 | `crawling.indexnow_key_file` (키를 지정했을 때만) | | 확인 불가 | URL 제출·IndexNow 전송, 콘텐츠 제거 도구, 크롤 속도, Bingbot IP 검증, 콘텐츠 품질·어뷰징 판단, DNS 인증, mRSS 제출, Bingbot TLS 암호군 | 콘솔·외부 호출·의미 판단·TLS 핸드셰이크 열거가 필요 | +## 검색엔진 문서 (2차) + +| 출처 | 대조 수 | 새로 넣은 항목 | +|---|---|---| +| Google 검색 센터 문서 전체 | 살아 있는 문서 187쪽 (구조화 데이터 40쪽은 위 표) | `crawling.robots_rule_errors` `crawling.robots_unsupported_directives` `crawling.robots_allows.googlebot_image` `crawling.robots_blocks_favicon_googlebot` `crawling.sitemap_invalid_xml` `crawling.sitemap_future_lastmod` `crawling.sitemap_extensions` `crawling.sitemap_extension_errors` `crawling.sitemap_news_stale` `crawling.sitemap_blocked_by_robots` `meta.canonical_header` `meta.canonical_conflict` `meta.canonical_fragment` `meta.paginated_canonical_to_first` `structured_data.hreflang_invalid` `structured_data.hreflang_other_sources` `structured_data.hreflang_canonical_conflict` `crawling.over_googlebot_size_limit` `crawling.conditional_request_304` `transport.ua_redirect_mismatch` `indexing.robots_unknown_directives` `indexing.unavailable_after_passed` `indexing.robots_conflicting_directives` `indexing.data_nosnippet_invalid_element` `indexing.google_meta` `meta.rating` `meta.favicon_google_eligible` `meta.title_half_empty` `meta.title_script_mismatch` `content.img_missing_src` `content.img_unsupported_format` `open_graph.image_under_1200` `geo.future_dates` `structured_data.website_duplicate` `structured_data.site_name_mismatch` `structured_data.is_accessible_for_free` `content.hidden_text_styles` `content.unencoded_link_urls` `content.outbound_link_qualifiers` `content.underscore_url_paths` `crawling.rel_next_prev` | +| Yandex 웹마스터 도움말 | 176쪽 중 robots·meta·sitemap·canonical·favicon 등 약 25절 | `crawling.robots_allows.yandex` `crawling.robots_clean_param` `indexing.yandex_meta` `indexing.yandex_noindex_tag` `meta.yandex_site_verification` | +| Daum 웹문서 검색 고객센터 | FAQ 10쪽 | `crawling.ua_access.daum`, robots 토큰을 `Daum` 으로 수정한 `crawling.robots_allows.daum` | +| Apple (Applebot·앱 연결 문서) | 5쪽 | `crawling.robots_allows.applebot` `crawling.ua_access.applebot` `indexing.applebot_meta` `meta.apple_app_site_association_valid` `meta.apple_itunes_app_valid` | +| sitemaps.org·Common Crawl | 3쪽 | `crawling.sitemap_namespace` `crawling.sitemap_invalid_priority` `crawling.sitemap_invalid_changefreq` `crawling.sitemap_invalid_lastmod` `crawling.sitemap_unescaped_entities` `crawling.sitemap_invalid_loc` `crawling.sitemap_out_of_scope` `crawling.sitemap_encoding` `geo.ua_access.ccbot` | + +robots.txt 해석은 Google 규칙에 맞췄습니다: 토큰 뒤 텍스트 무시(`Googlebot/2.1`), 가장 구체적인 그룹 대체(googlebot-image → googlebot), Crawl-delay 같은 비규칙 필드가 그룹을 끊지 않음, 429 를 5xx 처럼 취급. 별도 모바일 URL 의 메타 일치와 UA 별 동적 제공 비교는 모바일 UA 로 한 번 더 받아야 해 아직 넣지 않았습니다. 콘솔 기능, 스팸 의도 판단, 렌더링 후 상태는 확인할 수 없습니다. + +## AI·GEO 프로토콜 + +| 출처 | 대조 수 | 새로 넣은 항목 | +|---|---|---| +| AI 크롤러 공식 문서 (OpenAI·Google·Meta·Amazon·Mistral·DuckDuckGo·Ai2·Webz.io) | 토큰 13개 | `geo.robots_allows.google_cloudvertexbot` `geo.robots_allows.googleother` `geo.robots_allows.meta_webindexer` `geo.robots_allows.oai_adsbot` `geo.robots_allows.amzn_searchbot` `geo.robots_allows.amzn_user` `geo.robots_allows.mistralai_user` `geo.robots_allows.mistralai_index` `geo.robots_allows.mistralai_training` `geo.robots_allows.duckassistbot` `geo.robots_allows.ai2bot` `geo.robots_allows.webzio_extended` (Applebot 은 검색 크롤러로 분류) | +| ai.robots.txt 공동체 목록 | 209개 | 공식 문서로 확인한 토큰만 넣음 (나머지 192개는 출처 미확인) | +| llmstxt.org | 형식 규칙 전체 | `geo.llms_txt_link_format` `geo.llms_txt_extra_headings` `geo.llms_txt_optional_section` `geo.llms_txt_describedby` `geo.llms_txt_subpath` | +| IETF aipref·Content Signals·RSL·TDMRep·A2A | 5개 명세 | `geo.content_usage` `geo.content_signals` `geo.rsl_license` `geo.tdm_policy` `geo.tdm_reservation_invalid` `geo.a2a_agent_card` | +| RFC 9309 | 규칙 전체 | `crawling.robots_content_type` `crawling.robots_orphan_rules` `crawling.robots_unreachable` `crawling.robots_redirect_hops` | +| GEO 논문 (Aggarwal 외, KDD 2024) | 방법 9개 | `geo.quotations` `geo.statistics` (출처 인용은 `content.external_links`) | + +MCP 서버 발견(`/.well-known/mcp.json`)은 표준이 확정되지 않았고, NLWeb 은 공식 발견 방법이 없으며, ChatGPT 플러그인 manifest 는 폐지되어 넣지 않았습니다. C2PA 는 이미지 파일을 받아 해석해야 합니다. + +## 보안 스캐너 + +[Mozilla HTTP Observatory](https://github.com/mdn/mdn-http-observatory) 의 테스트 12개(결과 코드 77개), [webhint](https://github.com/webhintio/hint) 의 hint 50개, RFC 9116 security.txt 필드 10개, IANA well-known URI 107개, hstspreload.org 제출 요건 6개를 대조했습니다. Observatory 와 webhint 목록은 `scripts/check_coverage.py` 가 저장소와 다시 대조합니다. securityheaders.com 은 비공개라 공개 글에 나온 경고 5개만 대조했습니다. + +| Observatory 테스트 | 항목 id | 비고 | +|---|---|---| +| cookies | `security.insecure_cookies` `security.cookie_samesite_invalid` `security.session_cookie_flags` `security.cookie_prefix_invalid` `security.cookie_syntax_invalid` | 리다이렉트 경유 응답의 쿠키는 보지 않음 | +| cors | `security.cors_wildcard` | Origin 을 반사하는 자격증명 허용은 별도 요청이 필요해 미구현 | +| cross-origin-embedder-policy | `security.cross_origin_embedder_policy` `security.cross_origin_policy_invalid` | — | +| cross-origin-opener-policy | `security.cross_origin_opener_policy` `security.cross_origin_policy_invalid` | — | +| cross-origin-resource-policy | `security.cross_origin_resource_policy` `security.cross_origin_policy_invalid` | — | +| csp | `security.csp` `security.csp_meta` `security.csp_unsafe_inline` `security.csp_unsafe_eval` `security.csp_broad_script_source` `security.csp_object_src_unrestricted` `security.csp_unsafe_inline_style` `security.csp_insecure_scheme` `security.csp_base_uri_unrestricted` `security.csp_form_action_unrestricted` `security.csp_default_src_missing` `security.csp_strict_dynamic_without_nonce` `security.csp_duplicate_directives` `security.csp_report_only_only` `security.trusted_types` | — | +| redirection | `transport.http_to_https_redirect` `transport.hsts_preload_ineligible` | http 요청의 첫 단계가 같은 호스트 https 인지는 preload 요건 안에서만 확인 | +| referrer-policy | `security.referrer_policy` `security.referrer_policy_unsafe` | — | +| strict-transport-security | `transport.hsts` `transport.hsts_invalid` `transport.hsts_max_age_short` `transport.hsts_preload_ineligible` | Chromium preload 목록 등재 여부 (외부 목록) | +| subresource-integrity | `security.sri_missing` `security.sri_invalid` | — | +| x-content-type-options | `security.x_content_type_options` `security.x_content_type_options_invalid` | — | +| x-frame-options | `security.x_frame_options` `security.x_frame_options_invalid` `security.clickjacking_unprotected` | — | + +| webhint hint | 항목 id | 비고 | +|---|---|---| +| apple-touch-icons | `meta.apple_touch_icon` `meta.apple_touch_icon_file` | PNG·180px 확인은 미구현 (이미지 디코드 필요) | +| axe | [axe-core 규칙](#axe-core-규칙) 표 | — | +| babel-config | — | 확인 불가: 빌드 설정 파일 | +| button-type | `content.button_type_missing` | — | +| compat-api | — | 확인 불가: 대상 브라우저 설정과 호환성 데이터 필요 | +| content-type | `transport.content_type_invalid` `transport.asset_content_type_mismatch` | — | +| create-element-svg | — | 확인 불가: JS 소스 린트 | +| css-prefix-order | `performance.css_prefix_order` | — | +| detect-css-reflows | `performance.layout_animations` | — | +| disown-opener | `security.target_blank_noopener` | — | +| doctype | `meta.doctype` | — | +| highest-available-document-mode | `meta.x_ua_compatible` | — | +| html-checker | `accessibility.markup_errors` | 외부 Nu 서비스 (정적 부분은 [HTML 검사기](#html-검사기성능) 표) | +| http-cache | `performance.cache_control` `performance.static_asset_cache` `performance.cache_control_conflict` `crawling.script_cache_busting` | — | +| http-compression | `performance.compression` `performance.asset_compression` `performance.vary_accept_encoding_missing` | — | +| https-only | `transport.https` `transport.mixed_content` `transport.https_to_http_redirect` | — | +| ie-flexbox-compat | — | 해당 없음: IE 전용 | +| image-optimization-cloudinary | — | 확인 불가: 외부 API | +| leading-dot-classlist | — | 확인 불가: JS 소스 린트 | +| manifest-app-name | `meta.manifest_name_length` | — | +| manifest-exists | `meta.manifest` `links.manifest` | — | +| manifest-file-extension | `meta.manifest_file_extension` | — | +| manifest-icons | `meta.manifest_icons_192_512` `meta.manifest_maskable_icon` | 아이콘 실제 크기 (이미지 디코드) | +| manifest-is-valid | `meta.manifest_content` `meta.manifest_display_valid` | — | +| manifest-scoped-urls | `meta.manifest_start_url_scope` | — | +| meta-charset-utf-8 | `meta.charset_not_utf8` `meta.charset_late` `meta.charset_duplicate` | — | +| meta-theme-color | `meta.theme_color` `meta.theme_color_invalid` | — | +| meta-viewport | `meta.viewport` `meta.viewport_invalid` `accessibility.zoom_disabled` | — | +| minified-js | `performance.unminified_js` | — | +| no-bom | `meta.bom` | — | +| no-broken-links | `content.broken_internal_links` `content.broken_resources` | — | +| no-disallowed-headers | `security.server_header` `security.x_powered_by` `security.info_disclosure_headers` `security.hpkp` `security.p3p` | Expires·Host·X-Frame-Options 금지 권고는 OWASP·Observatory 와 충돌해 따르지 않음 | +| no-friendly-error-pages | — | 해당 없음: IE 전용 (`not_found_page.custom` 참고) | +| no-html-only-headers | — | 미구현: 하위 리소스 응답 헤더 표본이 필요 | +| no-http-redirects | `transport.redirect` `performance.asset_redirects` | — | +| no-inline-styles | `performance.inline_style_attrs` `performance.inline_code_bytes` | — | +| no-p3p | `security.p3p` | /w3c/p3p.xml 파일은 요청하지 않음 | +| no-protocol-relative-urls | `security.protocol_relative_urls` | — | +| no-vulnerable-javascript-libraries | — | 보류: 취약점 DB(retire.js 등)를 내장하고 갱신하는 설계가 필요 | +| performance-budget | `performance.page_weight` `performance.html_bytes` | 네트워크 모델 기반 판정은 하지 않음 | +| scoped-svg-styles | — | 확인 불가: CSS 선택자 적용 범위 계산 | +| sri | `security.sri_missing` `security.sri_invalid` | 해시 일치 확인은 하지 않음 | +| ssllabs | — | 확인 불가: 외부 API | +| strict-transport-security | `transport.hsts` `transport.hsts_invalid` `transport.hsts_max_age_short` | — | +| stylesheet-limits | — | 해당 없음: IE 전용 | +| summary-display | `accessibility.summary_display_changed` | — | +| typescript-config | — | 확인 불가: 빌드 설정 파일 | +| validate-set-cookie-header | `security.cookie_syntax_invalid` `security.cookie_prefix_invalid` `security.cookie_samesite_invalid` | — | +| webpack-config | — | 확인 불가: 빌드 설정 파일 | +| x-content-type-options | `security.x_content_type_options` `security.x_content_type_options_invalid` | — | + +RFC 9116·IANA: `transport.security_txt` `transport.security_txt_fields`(10개 필드 값) `transport.security_txt_expired` `transport.security_txt_invalid` `transport.security_txt_signed` `transport.security_txt_canonical_mismatch` `security.change_password_url` `trust.gpc`. 서명 검증과 키 신뢰는 확인 불가입니다. IANA 목록의 나머지(openid-configuration·webfinger·mta-sts 등)는 일반 웹사이트의 존재 신호가 아니라서 넣지 않았습니다. + +## 접근성 검사기 + +사람이 대조한 출처와 규칙 수입니다. 새로 넣은 항목은 아래와 같고, 나머지는 기존 항목으로 다루거나 렌더링·실행·의미 판단이 필요합니다. + +| 출처 | 대조 수 | 새로 넣은 항목 | +|---|---|---| +| IBM Equal Access | 규칙 170개 | `accessibility.aria_role_redundant` `accessibility.aria_role_not_allowed` `accessibility.aria_attr_not_allowed_for_role` `accessibility.aria_html_attr_conflict` `accessibility.aria_html_attr_redundant` `accessibility.aria_deprecated_attr` `accessibility.presentational_children_roles` `accessibility.duplicate_landmark_names` `accessibility.landmark_role_unnamed` `accessibility.activedescendant_unfocusable` `accessibility.combobox_pattern_invalid` `accessibility.tabbable_non_interactive` `accessibility.iframe_tabindex_negative` `accessibility.empty_labels` `accessibility.placeholder_only_label` `accessibility.form_submit_missing` `accessibility.decorative_img_conflict` `accessibility.figure_unlabeled` `accessibility.canvas_fallback_missing` `accessibility.mouse_only_handlers` `accessibility.css_blink` | +| HTML_CodeSniffer (pa11y) | 메시지 179개 | `accessibility.presentation_semantic_children` `accessibility.label_for_not_control` `accessibility.alt_redundant_with_text` `accessibility.adjacent_duplicate_links` `accessibility.broken_fragment_links` `accessibility.xml_lang_without_lang` `accessibility.ruby_without_rt` | +| ARIA in HTML | 요소 139개·속성 11개 | `accessibility.aria_attr_on_prohibited_element` 및 위 역할·속성 항목 | +| W3C i18n checker | 보고 51종 | `meta.bom_in_content` `meta.xml_declaration` `meta.content_language_meta` `accessibility.dir_invalid` `accessibility.rtl_dir_missing` `accessibility.css_direction` `accessibility.bdo_without_dir` `content.bidi_control_chars` `accessibility.translate_invalid` `meta.charset_not_utf8` `meta.charset_late` | +| WAVE | 항목 110개 | `accessibility.redundant_title_attr` `content.linked_documents` (나머지는 기존 항목) | +| EN 301 549 V3.2.1 | 9장 외 조항 71개 | `accessibility.statement_link` `accessibility.media_controls_missing` `structured_data.accessibility_metadata` (9장은 WCAG 2.2 표) | + +EU 웹 접근성 지침 제7조의 피드백 수단(접근성 성명 페이지 안의 연락 수단)은 성명 페이지를 한 번 더 받아야 해 아직 넣지 않았습니다. + +## HTML 검사기·성능 + +[HTMLHint](https://github.com/htmlhint/HTMLHint) 규칙 44개 전체입니다 (`scripts/check_coverage.py` 가 저장소와 다시 대조). Nu HTML Checker 는 `Assertions.java` 의 메시지 251개와 금지 조상 규칙을 사람이 대조했고, 정적으로 값싸게 확인할 수 있는 것을 `meta.http_equiv_invalid` `meta.base_after_resources` `accessibility.invalid_nesting` `accessibility.phrasing_content_violation` `accessibility.form_conformance_errors` `content.invalid_urls` `content.invalid_enum_attrs` `content.time_datetime_invalid` `content.unknown_elements` `content.text_not_nfc` `structured_data.microdata_invalid` `content.section_without_heading` `performance.empty_src` `performance.srcset_sizes_invalid` `performance.preload_invalid` `performance.script_attr_ineffective` `performance.script_json_invalid` 로 넣었습니다. RNC 내용 모델 전체 검증, XHTML 전용 규칙, 암묵 역할 경고(axe 와 같은 이유로 미적용)는 넣지 않았습니다. Chrome DevTools 인사이트와 Lighthouse 에서 빠진 감사는 `performance.excess_preconnect` `performance.preconnect_unused` `performance.preconnect_crossorigin_missing` `performance.third_party_embeds` `performance.legacy_javascript` `performance.unminified_js` `performance.asset_compression` `performance.speculation_rules` `performance.link_header_preload` `performance.server_timing` 로 다룹니다. + +| HTMLHint 규칙 | 항목 id | 비고 | +|---|---|---| +| alt-require | `content.img_alt_missing` `accessibility.area_alt_missing` | — | +| attr-no-duplication | `accessibility.markup_errors` | — | +| doctype-first | `meta.doctype` | — | +| doctype-html5 | `meta.doctype` | — | +| frame-title-require | `accessibility.iframe_title_missing` | — | +| h1-require | `content.h1` | — | +| head-script-disabled | `performance.render_blocking_scripts` | — | +| html-lang-require | `meta.html_lang` | — | +| id-unique | `accessibility.duplicate_ids` | — | +| input-requires-label | `accessibility.unlabeled_form_controls` | — | +| link-rel-canonical-require | `meta.canonical` | — | +| main-require | `accessibility.landmark_main` | — | +| meta-charset-require | `meta.charset` | — | +| meta-description-require | `meta.description` | — | +| meta-viewport-require | `meta.viewport` | — | +| tag-no-obsolete | `accessibility.obsolete_elements` | — | +| tag-pair | `accessibility.markup_errors` | — | +| title-require | `meta.title` | — | +| button-type-require | `content.button_type_missing` `content.invalid_enum_attrs` | — | +| form-method-require | `content.form_method_missing` | — | +| src-not-empty | `performance.empty_src` | — | +| inline-style-disabled | `performance.inline_style_attrs` | — | +| inline-script-disabled | `security.inline_event_handlers` `content.pseudo_js_links` | — | +| id-class-ad-disabled | `content.ad_blocker_class_names` | — | +| attr-unsafe-chars | `content.attr_unsafe_chars` | — | +| tagname-specialchars | `content.unknown_elements` | — | +| script-disabled | `performance.inline_code_bytes` | 정책 토글이라 존재만 보고 | +| style-disabled | `performance.inline_code_bytes` | 정책 토글이라 존재만 보고 | +| tags-check | — | 기본 설정이 a·img 에 title 을 요구해 접근성 지침과 충돌 | +| attr-lowercase | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-sorted | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-value-double-quotes | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-value-single-quotes | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-whitespace | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-no-unnecessary-whitespace | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-value-not-empty | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| attr-value-no-duplication | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| empty-tag-not-self-closed | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| tag-self-close | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| tagname-lowercase | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| space-tab-mixed-disabled | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| spec-char-escape | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| href-abs-or-rel | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | +| id-class-value | — | 해당 없음: 렌더링에 영향 없는 소스 서식 규칙 | + ## 생성형 검색(GEO) | 신호 | 항목 id | diff --git a/scripts/check_coverage.py b/scripts/check_coverage.py index 4703992..6a34d07 100644 --- a/scripts/check_coverage.py +++ b/scripts/check_coverage.py @@ -4,6 +4,7 @@ - axe-core 규칙, Lighthouse 감사, Google 구조화 데이터 갤러리, OWASP 권장 헤더 - WCAG 2.2 성공 기준, Open Graph 속성, Web App Manifest 멤버, MDN 폐기·비표준 헤더 (대조표) - WHATWG HTML 폐기 속성 (spec.rs 의 OBSOLETE_ATTRS), schema.org 타입 (schema_types.rs) +- Mozilla HTTP Observatory 테스트, webhint hint, HTMLHint 규칙 (대조표) python scripts/check_coverage.py @@ -120,6 +121,25 @@ def mentions(text: str, token: str) -> bool: mdn_doc = section(doc, "## MDN 폐기 헤더", "## 네이버") results.append(("MDN 폐기·비표준 헤더", len(flagged), [h for h in flagged if f"| {h} |" not in mdn_doc])) +def github_dir(repo: str, path: str) -> list[str]: + return [e["name"] for e in json.loads(fetch(f"https://api.github.com/repos/{repo}/contents/{path}"))] + + +obs_tests = sorted(n.removesuffix(".js") for n in github_dir("mdn/mdn-http-observatory", "src/analyzer/tests") if n.endswith(".js")) +sec_doc = section(doc, "## 보안 스캐너", "## 접근성 검사기") +results.append(("Observatory 테스트", len(obs_tests), [t for t in obs_tests if f"| {t} |" not in sec_doc])) + +hints = sorted(n.removeprefix("hint-") for n in github_dir("webhintio/hint", "packages") if n.startswith("hint-")) +results.append(("webhint hint", len(hints), [h for h in hints if f"| {h} |" not in sec_doc])) + +rules = sorted( + n.removesuffix(".ts") + for n in github_dir("htmlhint/HTMLHint", "src/core/rules") + if n.endswith(".ts") and n != "index.ts" +) +hh_doc = section(doc, "## HTML 검사기·성능", "## 생성형") +results.append(("HTMLHint 규칙", len(rules), [r for r in rules if f"| {r} |" not in hh_doc])) + failed = False for name, total, missing in results: print(f"{name} {total}개, 빠진 것: {missing}") From b573fefb4006c89a8fff05bff3144fe5ae992b95 Mon Sep 17 00:00:00 2001 From: owjs3901 Date: Fri, 20 Nov 2026 17:06:15 +0900 Subject: [PATCH 21/21] =?UTF-8?q?feat:=20=EB=82=A8=EA=B2=A8=20=EB=91=94=20?= =?UTF-8?q?=ED=95=AD=EB=AA=A9=2013=EA=B0=9C=20=EA=B5=AC=ED=98=84=20(689?= =?UTF-8?q?=EA=B0=9C)=20=E2=80=94=20=EC=B7=A8=EC=95=BD=20JS=20=EB=9D=BC?= =?UTF-8?q?=EC=9D=B4=EB=B8=8C=EB=9F=AC=EB=A6=AC=C2=B7CORS=C2=B7http=20?= =?UTF-8?q?=EC=B2=AB=20=EC=9D=91=EB=8B=B5=C2=B7=EB=AA=A8=EB=B0=94=EC=9D=BC?= =?UTF-8?q?=C2=B7=EC=95=84=EC=9D=B4=EC=BD=98=20=ED=81=AC=EA=B8=B0=20?= =?UTF-8?q?=EB=93=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - retire.js 저장소를 내장해 알려진 취약 버전 JS 라이브러리 확인 (scripts/update_retire.py 로 갱신) - 접근성 성명 피드백 수단, Googlebot 스마트폰 UA·동적 제공 Vary, 별도 모바일 URL 메타 일치 - CORS Origin 반사+자격증명, http 첫 리다이렉트 대상·HSTS, apple-touch-icon·manifest 아이콘 실제 크기 - 비HTML 응답의 HTML 전용 헤더, dl 안 dt 중복 Co-Authored-By: Claude Opus 5.5 --- .../changepack_log_initial-release.json | 2 +- README.md | 13 + crates/devup-access-checker/data/retire.json | 1 + crates/devup-access-checker/src/catalog.rs | 65 +++ crates/devup-access-checker/src/checks.rs | 429 ++++++++++++++++++ crates/devup-access-checker/src/fetch.rs | 84 ++++ crates/devup-access-checker/src/google.rs | 14 +- crates/devup-access-checker/src/lib.rs | 103 +++++ crates/devup-access-checker/src/quality.rs | 24 +- crates/devup-access-checker/src/vulnjs.rs | 208 +++++++++ .../devup-access-checker/tests/end_to_end.rs | 101 +++++ docs/coverage.md | 18 +- scripts/update_retire.py | 42 ++ 13 files changed, 1092 insertions(+), 12 deletions(-) create mode 100644 crates/devup-access-checker/data/retire.json create mode 100644 crates/devup-access-checker/src/vulnjs.rs create mode 100644 scripts/update_retire.py diff --git a/.changepacks/changepack_log_initial-release.json b/.changepacks/changepack_log_initial-release.json index c294455..ef28ae8 100644 --- a/.changepacks/changepack_log_initial-release.json +++ b/.changepacks/changepack_log_initial-release.json @@ -1 +1 @@ -{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 676개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} +{"changes":{"crates/devup-access-checker/Cargo.toml":"Minor","crates/devup-access-checker-cli/Cargo.toml":"Minor"},"note":"첫 배포: SEO·GEO·웹 접근성 689개 항목의 존재 여부를 점검하는 라이브러리와 CLI","date":"2026-11-19T00:00:00.0000000Z"} diff --git a/README.md b/README.md index 59ef28b..1f95ba5 100644 --- a/README.md +++ b/README.md @@ -506,6 +506,8 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `accessibility.phrasing_content_violation` | 구문 전용 요소 안의 블록 요소 | | `accessibility.form_conformance_errors` | 폼 요소 적합성 오류 | | `accessibility.summary_display_changed` | summary 의 display 변경 | +| `accessibility.statement_feedback` | 접근성 성명 피드백 수단 (메일·전화·양식) | +| `accessibility.definition_list_duplicate_terms` | 같은 dl 안에서 반복된 dt | | `trust.privacy_policy` | 개인정보처리방침 링크 | | `trust.terms` | 이용약관 링크 | | `trust.phone` | 전화번호 링크 (tel:) | @@ -569,6 +571,8 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `security.protocol_relative_urls` | 프로토콜 상대 URL (//) | | `security.change_password_url` | 비밀번호 변경 URL (/.well-known/change-password) | | `security.inline_event_handlers` | 인라인 이벤트 핸들러 (onclick 등) | +| `security.cors_reflects_origin_credentials` | CORS Origin 반사 + 자격증명 허용 | +| `security.vulnerable_js_libraries` | 알려진 취약 버전 JS 라이브러리 | | `performance.static_asset_cache` | 정적 리소스 Cache-Control | | `performance.dom_size` | DOM 크기 | | `performance.third_party_scripts` | 서드파티 스크립트 호스트 | @@ -586,6 +590,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `crawling.ua_access.bingbot` | 검색 크롤러 UA 응답 (bingbot) | | `crawling.ua_access.applebot` | 검색 크롤러 UA 응답 (applebot) | | `crawling.ua_access.daum` | 검색 크롤러 UA 응답 (daum) | +| `crawling.ua_access.googlebot_smartphone` | 검색 크롤러 UA 응답 (googlebot_smartphone) | | `crawling.feed_valid` | 피드 형식 유효 (RSS·Atom) | | `crawling.feed_items` | 피드 item 수 | | `crawling.feed_foreign_host` | 피드 안 다른 호스트·상대 경로 URL | @@ -619,6 +624,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `crawling.over_googlebot_size_limit` | Googlebot 2MB 초과 (HTML·JS) | | `crawling.conditional_request_304` | 조건부 요청 304 지원 | | `crawling.rel_next_prev` | rel=next·prev | +| `crawling.dynamic_serving_without_vary` | UA 별 다른 HTML 인데 Vary: User-Agent 없음 | | `geo.question_headings` | 질문형 헤딩 (h2~h4) | | `geo.lists` | 목록 (항목 2개 이상 ul/ol, dl) | | `geo.tables` | 표 | @@ -690,6 +696,9 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `meta.content_language_meta` | 폐기된 Content-Language meta | | `meta.http_equiv_invalid` | 브라우저가 무시하는 http-equiv | | `meta.base_after_resources` | link·script 뒤에 온 base (또는 base 여러 개) | +| `meta.mobile_alternate_mismatch` | 별도 모바일 URL 과 메타 불일치 | +| `meta.apple_touch_icon_spec` | apple-touch-icon PNG 180×180 | +| `meta.manifest_icon_size_mismatch` | manifest 아이콘의 선언 크기와 실제 크기 불일치 | | `structured_data.hreflang_reciprocal` | hreflang 상호 참조 | | `structured_data.unknown_types` | schema.org 에 없는 @type | | `structured_data.rdfa` | RDFa | @@ -755,6 +764,7 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `performance.asset_redirects` | 리다이렉트되는 JS | | `performance.unminified_js` | 압축(minify)되지 않은 JS | | `performance.legacy_javascript` | 레거시 JS (Babel 변환·폴리필 흔적) | +| `performance.html_only_headers` | HTML 이 아닌 응답의 HTML 전용 헤더 | | `site.pages_sampled` | 표본 페이지 수집 | | `site.failed_pages` | 표본 중 2xx 아닌 페이지 | | `site.duplicate_titles` | 페이지 간 중복 title | @@ -788,3 +798,6 @@ KWCAG 2.2 의 33개 검사항목, axe-core 규칙, Lighthouse(SEO·모범 사례 | `transport.security_txt_canonical_mismatch` | security.txt Canonical 에 실제 URL 없음 | | `transport.ua_redirect_mismatch` | UA 별 다른 최종 호스트 (교묘한 리다이렉트 의심) | | `transport.asset_content_type_mismatch` | JavaScript 가 아닌 Content-Type 의 JS | +| `transport.http_redirect_not_https_first` | http 가 https 가 아닌 곳으로 먼저 리다이렉트 | +| `transport.http_redirect_off_host` | http 가 다른 호스트로 먼저 리다이렉트 | +| `transport.hsts_over_http` | http 응답의 HSTS 헤더 (브라우저가 무시) | diff --git a/crates/devup-access-checker/data/retire.json b/crates/devup-access-checker/data/retire.json new file mode 100644 index 0000000..44dfc4e --- /dev/null +++ b/crates/devup-access-checker/data/retire.json @@ -0,0 +1 @@ +{"@angular/core":{"uri":["@angular/core@(§§version§§)/"],"filename":[],"filecontent":["/\\*\\*[\\s*]+@license Angular v(§§version§§)","\\[['\"]ng-version['\"],['\"](§§version§§)['\"]\\]"],"vulnerabilities":[{"atOrAbove":"0","below":"10.2.5","severity":"medium","ids":["CVE-2021-4231","GHSA-c75v-2vq8-878f"]},{"atOrAbove":"11.0.0","below":"11.0.5","severity":"medium","ids":["CVE-2021-4231","GHSA-c75v-2vq8-878f"]},{"atOrAbove":"11.1.0-next.0","below":"11.1.0-next.3","severity":"medium","ids":["CVE-2021-4231","GHSA-c75v-2vq8-878f"]},{"atOrAbove":"0","below":"18.2.15","severity":"medium","ids":["CVE-2026-52725","GHSA-692r-grfm-v8x7"]},{"atOrAbove":"0","below":"18.2.15","severity":"medium","ids":["CVE-2026-50557","GHSA-f3m7-gqxr-g87x"]},{"atOrAbove":"0","below":"18.2.15","severity":"high","ids":["CVE-2026-27970","GHSA-prjf-86w9-mfqv"]},{"atOrAbove":"17.0.0-next.0","below":"18.2.15","severity":"high","ids":["CVE-2026-32635","GHSA-g93w-mfhg-p222"]},{"atOrAbove":"19.0.0-next.0","below":"19.2.19","severity":"high","ids":["CVE-2026-27970","GHSA-prjf-86w9-mfqv"]},{"atOrAbove":"19.0.0-next.0","below":"19.2.20","severity":"high","ids":["CVE-2026-32635","GHSA-g93w-mfhg-p222"]},{"atOrAbove":"19.0.0-next.0","below":"19.2.22","severity":"medium","ids":["CVE-2026-50557","GHSA-f3m7-gqxr-g87x"]},{"atOrAbove":"19.0.0-next.0","below":"19.2.23","severity":"medium","ids":["CVE-2026-52725","GHSA-692r-grfm-v8x7"]},{"atOrAbove":"0","below":"19.2.26","severity":"medium","ids":["CVE-2026-88057","GHSA-hh8m-fm6v-7cvg"]},{"atOrAbove":"0","below":"19.2.26","severity":"high","ids":["CVE-2026-54267","GHSA-rgjc-h3x7-9mwg"]},{"atOrAbove":"20.0.0-next.0","below":"20.3.17","severity":"high","ids":["CVE-2026-27970","GHSA-prjf-86w9-mfqv"]},{"atOrAbove":"20.0.0-next.0.0.0","below":"20.3.18","severity":"high","ids":["CVE-2026-32635","GHSA-g93w-mfhg-p222"]},{"atOrAbove":"20.0.0-next.0","below":"20.3.22","severity":"medium","ids":["CVE-2026-52725","GHSA-692r-grfm-v8x7"]},{"atOrAbove":"20.0.0-next.0","below":"20.3.22","severity":"medium","ids":["CVE-2026-50557","GHSA-f3m7-gqxr-g87x"]},{"atOrAbove":"20.0.0-next.0","below":"20.3.25","severity":"high","ids":["CVE-2026-54267","GHSA-rgjc-h3x7-9mwg"]},{"atOrAbove":"20.0.0","below":"20.3.28","severity":"medium","ids":["CVE-2026-88057","GHSA-hh8m-fm6v-7cvg"]},{"atOrAbove":"21.0.0-next.0","below":"21.1.6","severity":"high","ids":["CVE-2026-27970","GHSA-prjf-86w9-mfqv"]},{"atOrAbove":"21.2.0-next.0","below":"21.2.0","severity":"high","ids":["CVE-2026-27970","GHSA-prjf-86w9-mfqv"]},{"atOrAbove":"21.0.0-next.0","below":"21.2.4","severity":"high","ids":["CVE-2026-32635","GHSA-g93w-mfhg-p222"]},{"atOrAbove":"21.0.0-next.0","below":"21.2.15","severity":"medium","ids":["CVE-2026-52725","GHSA-692r-grfm-v8x7"]},{"atOrAbove":"21.0.0-next.0","below":"21.2.15","severity":"medium","ids":["CVE-2026-50557","GHSA-f3m7-gqxr-g87x"]},{"atOrAbove":"21.0.0-next.0","below":"21.2.17","severity":"high","ids":["CVE-2026-54267","GHSA-rgjc-h3x7-9mwg"]},{"atOrAbove":"21.0.0","below":"21.2.20","severity":"medium","ids":["CVE-2026-88057","GHSA-hh8m-fm6v-7cvg"]},{"atOrAbove":"22.0.0-next.0","below":"22.0.0-rc.2","severity":"medium","ids":["CVE-2026-52725","GHSA-692r-grfm-v8x7"]},{"atOrAbove":"22.0.0-next.0","below":"22.0.0-rc.2","severity":"medium","ids":["CVE-2026-50557","GHSA-f3m7-gqxr-g87x"]},{"atOrAbove":"22.0.0-next.0","below":"22.0.0-next.3","severity":"high","ids":["CVE-2026-32635","GHSA-g93w-mfhg-p222"]},{"atOrAbove":"22.0.0-next.0","below":"22.0.1","severity":"high","ids":["CVE-2026-54267","GHSA-rgjc-h3x7-9mwg"]},{"atOrAbove":"22.0.0","below":"22.1.0","severity":"medium","ids":["CVE-2026-88057","GHSA-hh8m-fm6v-7cvg"]}]},"AlaSQL":{"uri":["/alasql[/@](§§version§§)/.*\\.js"],"filename":["alasql-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*!?[ \n]*AlaSQL v(§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"0.7.0","severity":"high","ids":["An arbitrary code execution exists as AlaSQL doesn't sanitize input when charact"]}]},"DOMPurify":{"uri":[],"filename":[],"filecontent":["DOMPurify.version = '(§§version§§)';","DOMPurify.version=\"(§§version§§)\"","DOMPurify=.[^\\r\\n]{10,850}?\\.version=\"(§§version§§)\"","/\\*! @license DOMPurify (§§version§§)","var .=\"dompurify\"+.{10,550}?\\.version=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"0.6.1","severity":"medium","ids":[""]},{"atOrAbove":null,"below":"0.8.6","severity":"medium","ids":[""]},{"atOrAbove":null,"below":"0.8.9","severity":"low","ids":["safari UXSS"]},{"atOrAbove":null,"below":"0.9.0","severity":"low","ids":["safari UXSS"]},{"atOrAbove":"0","below":"1.0.11","severity":"medium","ids":["CVE-2019-25155","GHSA-8hgg-xxm5-3873"]},{"atOrAbove":null,"below":"2.0.3","severity":"medium","ids":["CVE-2019-16728","GHSA-chqj-j4fh-rw7m"]},{"atOrAbove":null,"below":"2.0.7","severity":"high","ids":["GHSA-mjjq-c88q-qhr6"]},{"atOrAbove":null,"below":"2.0.16","severity":"low","ids":["Fixed an mXSS-based bypass caused by nested forms inside MathML"]},{"atOrAbove":null,"below":"2.0.17","severity":"medium","ids":["CVE-2020-26870","GHSA-63q7-h895-m982"]},{"atOrAbove":null,"below":"2.1.1","severity":"low","ids":["Fixed several possible mXSS patterns, thanks @hackvertor"]},{"atOrAbove":null,"below":"2.2.0","severity":"low","ids":["Fix a possible XSS in Chrome that is hidden behind #enable-experimental-web-plat"]},{"atOrAbove":null,"below":"2.2.2","severity":"low","ids":["Fixed an mXSS bypass dropped on us publicly via"]},{"atOrAbove":null,"below":"2.2.3","severity":"low","ids":["Fixed an mXSS issue reported"]},{"atOrAbove":null,"below":"2.2.4","severity":"low","ids":["Fixed a new MathML-based bypass submitted by PewGrand. Fixed a new SVG-related b"]},{"atOrAbove":"0","below":"2.4.2","severity":"high","ids":["CVE-2024-48910","GHSA-p3vf-v8qc-cwcr"]},{"atOrAbove":"0","below":"2.5.0","severity":"high","ids":["CVE-2024-47875","GHSA-gx9m-whjm-85jf"]},{"atOrAbove":"0","below":"2.5.4","severity":"high","ids":["CVE-2024-45801","GHSA-mmhx-hmjr-r674"]},{"atOrAbove":"2.5.3","below":"2.5.9","severity":"medium","ids":["CVE-2026-0540","GHSA-v2wj-7wpq-c8vv"]},{"atOrAbove":"2.5.3","below":"2.5.9","severity":"medium","ids":["CVE-2025-15599","GHSA-v8jm-5vwx-cfxm"]},{"atOrAbove":"3.0.0","below":"3.1.3","severity":"high","ids":["CVE-2024-47875","GHSA-gx9m-whjm-85jf"]},{"atOrAbove":"3.0.0","below":"3.1.3","severity":"high","ids":["CVE-2024-45801","GHSA-mmhx-hmjr-r674"]},{"atOrAbove":"0","below":"3.2.4","severity":"medium","ids":["CVE-2025-26791","GHSA-vhxf-7vqr-mrjg"]},{"atOrAbove":"3.1.3","below":"3.2.7","severity":"medium","ids":["CVE-2025-15599","GHSA-v8jm-5vwx-cfxm"]},{"atOrAbove":"0","below":"3.3.2","severity":"medium","ids":["CVE-2026-65913","GHSA-cj63-jhhr-wcxv"]},{"atOrAbove":"0","below":"3.3.2","severity":"medium","ids":["CVE-2026-65912","GHSA-cjmm-f4jc-qw8r"]},{"atOrAbove":"0","below":"3.3.2","severity":"medium","ids":["CVE-2026-65914","GHSA-h8r8-wccr-v5f2"]},{"atOrAbove":"3.1.3","below":"3.3.2","severity":"medium","ids":["CVE-2026-0540","GHSA-v2wj-7wpq-c8vv"]},{"atOrAbove":"0","below":"3.4.0","severity":"medium","ids":["CVE-2026-65903","GHSA-39q2-94rc-95cp"]},{"atOrAbove":"0","below":"3.4.0","severity":"medium","ids":["CVE-2026-41240","GHSA-h7mw-gpvr-xq4m"]},{"atOrAbove":"1.0.10","below":"3.4.0","severity":"medium","ids":["CVE-2026-41239","GHSA-crv5-9vww-q3g8"]},{"atOrAbove":"3.0.1","below":"3.4.0","severity":"medium","ids":["CVE-2026-41238","GHSA-v9jr-rg53-9pgp"]},{"atOrAbove":"3.4.4","below":"3.4.5","severity":"high","ids":["CVE-2026-47423","GHSA-87xg-pxx2-7hvx"]},{"atOrAbove":"0","below":"3.4.6","severity":"medium","ids":["CVE-2026-49458","GHSA-hpcv-96wg-7vj8"]},{"atOrAbove":"0","below":"3.4.6","severity":"medium","ids":["CVE-2026-49459","GHSA-r47g-fvhr-h676"]},{"atOrAbove":"0","below":"3.4.7","severity":"medium","ids":["CVE-2026-65902","GHSA-76mc-f452-cxcm"]},{"atOrAbove":"0","below":"3.4.7","severity":"medium","ids":["CVE-2026-49978","GHSA-rp9w-3fw7-7cwq"]},{"atOrAbove":"0","below":"3.4.7","severity":"low","ids":["CVE-2026-65901","GHSA-x4vx-rjvf-j5p4"]},{"atOrAbove":"3.0.0","below":"3.4.8","severity":"low","ids":["CVE-2026-65900","GHSA-gvmj-g25r-r7wr"]},{"atOrAbove":"0","below":"3.4.9","severity":"low","ids":["CVE-2026-65899","GHSA-vxr8-fq34-vvx9"]},{"atOrAbove":"0","below":"3.4.11","severity":"medium","ids":["CVE-2026-65898","GHSA-cmwh-pvxp-8882"]},{"atOrAbove":"0","below":"3.4.12","severity":"low","ids":["CVE-2026-66010","GHSA-c2j3-45gr-mqc4"]},{"atOrAbove":"0","below":"3.4.13","severity":"medium","ids":["CVE-2026-75838","GHSA-55q2-fjhq-7xh7"]},{"atOrAbove":"0","below":"3.4.16","severity":"low","ids":["CVE-2026-109345","GHSA-6688-9rhm-gjv2"]},{"atOrAbove":"3.4.13","below":"3.4.16","severity":"low","ids":["CVE-2026-109344","GHSA-p98j-92pf-mc4p"]},{"atOrAbove":"0","below":"3.4.17","severity":"low","ids":["CVE-2026-116802","GHSA-c6gr-qvv4-5v3f"]},{"atOrAbove":"0","below":"3.4.17","severity":"high","ids":["CVE-2026-116803","GHSA-mrv2-3pqr-j5jr"]},{"atOrAbove":"3.4.4","below":"3.4.17","severity":"critical","ids":["CVE-2026-116804","GHSA-cg2g-xh64-v4q7"]}]},"DWR":{"uri":[],"filename":[],"filecontent":[" dwr-(§§version§§).jar"],"vulnerabilities":[{"atOrAbove":null,"below":"1.1.4","severity":"high","ids":["CVE-2007-01-09"]},{"atOrAbove":null,"below":"2.0.11","severity":"medium","ids":["CVE-2014-5326","CVE-2014-5325"]},{"atOrAbove":"3","below":"3.0.RC3","severity":"medium","ids":["CVE-2014-5326","CVE-2014-5325"]}]},"ExtJS":{"uri":["/extjs/(§§version§§)/.*\\.js"],"filename":["/ext-all-(§§version§§)(\\.min)?\\.js","/ext-all-debug-(§§version§§)(\\.min)?\\.js","/ext-base-(§§version§§)(\\.min)?\\.js"],"filecontent":["/*!\n * Ext JS Library (§§version§§)","Ext = \\{[\\s]*/\\*[^/]+/[\\s]*version *: *['\"](§§version§§)['\"]","var version *= *['\"](§§version§§)['\"], *Version;[\\s]*Ext.Version *= *Version *= *Ext.extend"],"vulnerabilities":[{"atOrAbove":"3.0.0","below":"4.0.0","severity":"medium","ids":["CVE-2010-4207","CVE-2012-5881"]},{"atOrAbove":null,"below":"6.0.0","severity":"high","ids":["CVE-2007-2285"]},{"atOrAbove":"4.0.0","below":"6.6.0","severity":"medium","ids":["CVE-2018-8046"]}]},"YUI":{"uri":[],"filename":["yui-(§§version§§)(.min)?\\.js"],"filecontent":["/*\nYUI (§§version§§)","/yui/license.(?:html|txt)\nversion: (§§version§§)"],"vulnerabilities":[{"atOrAbove":"2.4.0","below":"2.8.2","severity":"medium","ids":["CVE-2010-4207"]},{"atOrAbove":"2.5.0","below":"2.8.2","severity":"medium","ids":["CVE-2010-4208"]},{"atOrAbove":"2.8.0","below":"2.8.2","severity":"medium","ids":["CVE-2010-4209"]},{"atOrAbove":null,"below":"2.9.0","severity":"medium","ids":["CVE-2010-4710"]},{"atOrAbove":"2.4.0","below":"2.9.1","severity":"medium","ids":["CVE-2012-5881"]},{"atOrAbove":"2.5.0","below":"2.9.1","severity":"medium","ids":["CVE-2012-5882"]},{"atOrAbove":"2.8.0","below":"2.9.1","severity":"medium","ids":["CVE-2012-5883"]},{"atOrAbove":"3.2.0","below":"3.9.2","severity":"medium","ids":["CVE-2013-4941","GHSA-64r3-582j-frqm"]},{"atOrAbove":"3.2.0","below":"3.9.2","severity":"medium","ids":["CVE-2013-4942","GHSA-9ww8-j8j2-3788"]},{"atOrAbove":"3.0.0","below":"3.10.3","severity":"medium","ids":["CVE-2013-4939","GHSA-mj87-8xf8-fp4w"]},{"atOrAbove":"3.0.0","below":"3.10.11","severity":"medium","ids":["CVE-2013-4940","GHSA-x5hj-47vv-53p8"]},{"atOrAbove":"3.10.12","below":"3.10.13","severity":"medium","ids":["CVE-2013-4940","GHSA-x5hj-47vv-53p8"]}]},"alpinejs":{"uri":["/alpinejs[@/](§§version§§)/"],"filename":["alpine(?:js)?[-.](§§version§§)(.min)?.js"],"filecontent":["version:['\"](§§version§§)['\"],flushAndStopDeferringMutations"],"vulnerabilities":[]},"angularjs":{"uri":["/(§§version§§)/angular(\\.min)?\\.js"],"filename":["angular(?:js)?-(§§version§§)(.min)?\\.js"],"filecontent":["/\\*[\\*\\s]+(?:@license )?AngularJS(?: NES)? v(§§version§§)","http://errors\\.angularjs\\.org/(§§version§§)/"],"vulnerabilities":[{"atOrAbove":"1.0.0","below":"1.2.30","severity":"medium","ids":["The attribute usemap can be used as a security exploit"]},{"atOrAbove":null,"below":"1.5.0-beta.1","severity":"medium","ids":["CVE-2019-14863","GHSA-r5fx-8r73-v86c"]},{"atOrAbove":"1.3.0","below":"1.5.0-rc2","severity":"medium","ids":["The attribute usemap can be used as a security exploit"]},{"atOrAbove":null,"below":"1.6.0","severity":"medium","ids":["GHSA-28hp-fgcr-2r4h"]},{"atOrAbove":null,"below":"1.6.3","severity":"medium","ids":["DOS in $sanitize"]},{"atOrAbove":null,"below":"1.6.3","severity":"medium","ids":["Universal CSP bypass via add-on in Firefox"]},{"atOrAbove":null,"below":"1.6.5","severity":"low","ids":["XSS in $sanitize in Safari/Firefox"]},{"atOrAbove":"1.5.0","below":"1.6.9","severity":"low","ids":["XSS through SVG if enableSvg is set"]},{"atOrAbove":null,"below":"1.7.9","severity":"high","ids":["CVE-2019-10768","GHSA-89mq-4x47-5v83"]},{"atOrAbove":null,"below":"1.8.0","severity":"medium","ids":["GHSA-5cp4-xmrw-59wf"]},{"atOrAbove":null,"below":"1.8.0","severity":"medium","ids":["CVE-2020-7676","GHSA-mhp6-pxh8-r675"]},{"atOrAbove":null,"below":"1.8.4","severity":"medium","ids":["CVE-2023-26117","GHSA-2qqx-w9hr-q5gx"]},{"atOrAbove":null,"below":"1.8.4","severity":"medium","ids":["CVE-2023-26116","GHSA-2vrf-hf26-jrp5"]},{"atOrAbove":null,"below":"1.8.4","severity":"medium","ids":["CVE-2022-25869","GHSA-prc3-vjfx-vhm9"]},{"atOrAbove":null,"below":"1.8.4","severity":"medium","ids":["CVE-2023-26118","GHSA-qwqh-hm9m-p5hr"]},{"atOrAbove":"0","below":"1.8.4","severity":"low","ids":["CVE-2025-0716","GHSA-j58c-ww9w-pwp5"]},{"atOrAbove":"0","below":"1.8.4","severity":"low","ids":["CVE-2024-8373","GHSA-mqm9-c95h-x2p6"]},{"atOrAbove":"1.2.0-rc.3","below":"1.8.4","severity":"high","ids":["CVE-2026-11998","GHSA-7x27-g8rg-x87w"]},{"atOrAbove":"1.3.0","below":"1.8.4","severity":"high","ids":["CVE-2024-21490","GHSA-4w4v-5hc9-xrr2"]},{"atOrAbove":"1.3.0-rc.4","below":"1.8.4","severity":"low","ids":["CVE-2024-8372","GHSA-m9gf-397r-hwpg"]},{"atOrAbove":"1.3.1","below":"1.8.4","severity":"medium","ids":["CVE-2025-2336","GHSA-4p4w-6hg8-63wx"]},{"atOrAbove":"0","below":"1.9.9","severity":"medium","ids":["CVE-2025-4690","GHSA-hfff-63hg-f47j"]},{"atOrAbove":null,"below":"1.999","severity":"low","ids":["End-of-Life: Long term support for AngularJS has been discontinued as of Decembe"]},{"atOrAbove":"1.7.0","below":"999.999.999","severity":"medium","ids":["CVE-2022-25844","GHSA-m2h2-264f-f486"]}]},"axios":{"uri":["/axios/(§§version§§)/.*\\.js"],"filename":["axios-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*!? *[Aa]xios v(§§version§§) ","// Axios v(§§version§§) C","return\"\\[Axios v(§§version§§)\\] Transitional","\\\"axios\\\",\\\"version\\\":\\\"(§§version§§)\\\""],"vulnerabilities":[{"atOrAbove":null,"below":"0.18.1","severity":"high","ids":["CVE-2019-10742","GHSA-42xw-2xvc-qx8m"]},{"atOrAbove":null,"below":"0.21.1","severity":"medium","ids":["CVE-2020-28168","GHSA-4w2v-q235-vp99"]},{"atOrAbove":null,"below":"0.21.2","severity":"high","ids":["CVE-2021-3749","GHSA-cph5-m8f7-6c5x"]},{"atOrAbove":"0.8.1","below":"0.28.0","severity":"medium","ids":["CVE-2023-45857","GHSA-wf5p-g6vw-rhxx"]},{"atOrAbove":"0","below":"0.30.0","severity":"high","ids":["CVE-2025-27152","GHSA-jr5f-v2jv-69x6"]},{"atOrAbove":"0.28.0","below":"0.30.2","severity":"high","ids":["CVE-2025-58754","GHSA-4hjh-wcwx-xvwj"]},{"atOrAbove":"0","below":"0.30.3","severity":"high","ids":["CVE-2026-25639","GHSA-43fc-jf86-j433"]},{"atOrAbove":"0","below":"0.31.0","severity":"critical","ids":["CVE-2025-62718","GHSA-3p68-rc4w-qgx5"]},{"atOrAbove":"0","below":"0.31.0","severity":"critical","ids":["CVE-2026-40175","GHSA-fvcv-3m26-pcqx"]},{"atOrAbove":"0.19.0","below":"0.31.1","severity":"high","ids":["CVE-2026-44495","GHSA-3g43-6gmg-66jw"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42034","GHSA-5c9x-8gcm-mpgx"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42039","GHSA-62hf-57xw-28j9"]},{"atOrAbove":"0","below":"0.31.1","severity":"high","ids":["CVE-2026-42035","GHSA-6chq-wfr3-2hj9"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42038","GHSA-m7pr-hjqh-92cm"]},{"atOrAbove":"0","below":"0.31.1","severity":"high","ids":["CVE-2026-42033","GHSA-pf86-5x62-jrwf"]},{"atOrAbove":"0","below":"0.31.1","severity":"high","ids":["CVE-2026-42043","GHSA-pmwg-cvhr-8vh7"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42036","GHSA-vf2m-468p-8v99"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42041","GHSA-w9j2-pvgh-6h63"]},{"atOrAbove":"0","below":"0.31.1","severity":"low","ids":["CVE-2026-42040","GHSA-xhjh-pmcv-23jw"]},{"atOrAbove":"0","below":"0.31.1","severity":"medium","ids":["CVE-2026-42042","GHSA-xx6v-rp6x-q39c"]},{"atOrAbove":"0","below":"0.32.0","severity":"medium","ids":["CVE-2026-44490","GHSA-898c-q2cr-xwhg"]},{"atOrAbove":"0","below":"0.32.0","severity":"high","ids":["CVE-2026-44496","GHSA-hfxv-24rg-xrqf"]},{"atOrAbove":"0","below":"0.32.0","severity":"high","ids":["CVE-2026-44486","GHSA-j5f8-grm9-p9fc"]},{"atOrAbove":"0","below":"0.32.0","severity":"high","ids":["CVE-2026-44487","GHSA-p92q-9vqr-4j8v"]},{"atOrAbove":"0","below":"0.32.0","severity":"high","ids":["CVE-2026-44492","GHSA-pjwm-pj3p-43mv"]},{"atOrAbove":"0.8.0","below":"0.33.0","severity":"medium","ids":["CVE-2026-67319","GHSA-7q8q-rj6j-mhjq"]},{"atOrAbove":"0.28.0","below":"0.33.0","severity":"medium","ids":["CVE-2026-67313","GHSA-42h9-826w-cgv3"]},{"atOrAbove":"0.31.0","below":"0.33.0","severity":"medium","ids":["CVE-2026-67315","GHSA-f4gw-2p7v-4548"]},{"atOrAbove":"0.31.1","below":"0.33.0","severity":"high","ids":["CVE-2026-67320","GHSA-gcfj-64vw-6mp9"]},{"atOrAbove":"0.31.1","below":"0.33.0","severity":"medium","ids":["CVE-2026-67321","GHSA-hcpx-6fm6-wx23"]},{"atOrAbove":"0","below":"0.33.0","severity":"medium","ids":["CVE-2026-67316","GHSA-mmx7-hfxf-jppx"]},{"atOrAbove":"0.28.0","below":"0.33.0","severity":"medium","ids":["CVE-2026-67312","GHSA-pmv8-rq9r-6j72"]},{"atOrAbove":"0.27.2","below":"0.34.0","severity":"medium","ids":["CVE-2026-101902","GHSA-9fr6-4gfg-395g"]},{"atOrAbove":"0.28.0","below":"0.34.0","severity":"high","ids":["CVE-2026-101909","GHSA-x97p-jq2g-jp4f"]},{"atOrAbove":"1.0.0","below":"1.6.0","severity":"medium","ids":["CVE-2023-45857","GHSA-wf5p-g6vw-rhxx"]},{"atOrAbove":null,"below":"1.6.8","severity":"medium","ids":["Versions before 1.6.8 depends on follow-redirects before 1.15.6 which could leak"]},{"atOrAbove":"1.3.2","below":"1.7.4","severity":"high","ids":["CVE-2024-39338","GHSA-8hc4-vh64-cxmj"]},{"atOrAbove":"1.0.0","below":"1.8.2","severity":"high","ids":["CVE-2025-27152","GHSA-jr5f-v2jv-69x6"]},{"atOrAbove":"1.0.0","below":"1.12.0","severity":"high","ids":["CVE-2025-58754","GHSA-4hjh-wcwx-xvwj"]},{"atOrAbove":"1.13.0","below":"1.13.2","severity":"medium","ids":["CVE-2026-39865","GHSA-qj83-cq47-w5f8"]},{"atOrAbove":"1.0.0","below":"1.13.5","severity":"high","ids":["CVE-2026-25639","GHSA-43fc-jf86-j433"]},{"atOrAbove":"1.0.0","below":"1.15.0","severity":"critical","ids":["CVE-2025-62718","GHSA-3p68-rc4w-qgx5"]},{"atOrAbove":"1.0.0","below":"1.15.0","severity":"critical","ids":["CVE-2026-40175","GHSA-fvcv-3m26-pcqx"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42037","GHSA-445q-vr5w-6q77"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42034","GHSA-5c9x-8gcm-mpgx"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42039","GHSA-62hf-57xw-28j9"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"high","ids":["CVE-2026-42035","GHSA-6chq-wfr3-2hj9"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42038","GHSA-m7pr-hjqh-92cm"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"high","ids":["CVE-2026-42033","GHSA-pf86-5x62-jrwf"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"high","ids":["CVE-2026-42043","GHSA-pmwg-cvhr-8vh7"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42036","GHSA-vf2m-468p-8v99"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42041","GHSA-w9j2-pvgh-6h63"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"low","ids":["CVE-2026-42040","GHSA-xhjh-pmcv-23jw"]},{"atOrAbove":"1.0.0","below":"1.15.1","severity":"medium","ids":["CVE-2026-42042","GHSA-xx6v-rp6x-q39c"]},{"atOrAbove":"1.0.0","below":"1.15.2","severity":"high","ids":["CVE-2026-44495","GHSA-3g43-6gmg-66jw"]},{"atOrAbove":"1.0.0","below":"1.15.2","severity":"medium","ids":["CVE-2026-42044","GHSA-3w6x-2g7m-8v23"]},{"atOrAbove":"1.0.0","below":"1.15.2","severity":"high","ids":["CVE-2026-42264","GHSA-q8qp-cvcw-x6jj"]},{"atOrAbove":"1.0.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44494","GHSA-35jp-ww65-95wh"]},{"atOrAbove":"1.0.0","below":"1.16.0","severity":"medium","ids":["CVE-2026-44490","GHSA-898c-q2cr-xwhg"]},{"atOrAbove":"1.0.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44496","GHSA-hfxv-24rg-xrqf"]},{"atOrAbove":"1.0.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44486","GHSA-j5f8-grm9-p9fc"]},{"atOrAbove":"1.0.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44487","GHSA-p92q-9vqr-4j8v"]},{"atOrAbove":"1.7.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44488","GHSA-777c-7fjr-54vf"]},{"atOrAbove":"1.15.0","below":"1.16.0","severity":"high","ids":["CVE-2026-44492","GHSA-pjwm-pj3p-43mv"]},{"atOrAbove":"1.15.2","below":"1.16.0","severity":"low","ids":["CVE-2026-44489","GHSA-654m-c8p4-x5fp"]},{"atOrAbove":"1.0.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67313","GHSA-42h9-826w-cgv3"]},{"atOrAbove":"1.0.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67319","GHSA-7q8q-rj6j-mhjq"]},{"atOrAbove":"1.0.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67316","GHSA-mmx7-hfxf-jppx"]},{"atOrAbove":"1.0.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67312","GHSA-pmv8-rq9r-6j72"]},{"atOrAbove":"1.7.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67317","GHSA-jqh4-m9w3-8hp9"]},{"atOrAbove":"1.13.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67318","GHSA-mwf2-3pr3-8698"]},{"atOrAbove":"1.15.0","below":"1.18.0","severity":"medium","ids":["CVE-2026-67315","GHSA-f4gw-2p7v-4548"]},{"atOrAbove":"1.15.1","below":"1.18.0","severity":"medium","ids":["CVE-2026-67321","GHSA-hcpx-6fm6-wx23"]},{"atOrAbove":"1.15.2","below":"1.18.0","severity":"high","ids":["CVE-2026-67320","GHSA-gcfj-64vw-6mp9"]},{"atOrAbove":"1.15.2","below":"1.18.0","severity":"medium","ids":["CVE-2026-67314","GHSA-xj6q-8x83-jv6g"]},{"atOrAbove":"1.0.0","below":"1.20.0","severity":"medium","ids":["CVE-2026-101902","GHSA-9fr6-4gfg-395g"]},{"atOrAbove":"1.0.0","below":"1.20.0","severity":"medium","ids":["CVE-2026-101904","GHSA-j8rh-479h-cp32"]},{"atOrAbove":"1.7.0","below":"1.20.0","severity":"medium","ids":["CVE-2026-101908","GHSA-vh66-26gq-q6x8"]},{"atOrAbove":"1.12.0","below":"1.20.0","severity":"medium","ids":["CVE-2026-101900","GHSA-4hqw-qxg8-jxx2"]},{"atOrAbove":"1.13.0","below":"1.20.0","severity":"high","ids":["CVE-2026-101898","GHSA-3pq3-5fj3-cg6v"]},{"atOrAbove":"1.13.0","below":"1.20.0","severity":"high","ids":["CVE-2026-101901","GHSA-542g-h47m-68v8"]},{"atOrAbove":"1.15.0","below":"1.20.0","severity":"medium","ids":["CVE-2026-101899","GHSA-44g4-m2mj-wpvx"]},{"atOrAbove":"1.15.0","below":"1.20.0","severity":"high","ids":["CVE-2026-101906","GHSA-mghh-pgcx-3jjj"]},{"atOrAbove":"1.15.1","below":"1.20.0","severity":"high","ids":["CVE-2026-101909","GHSA-x97p-jq2g-jp4f"]},{"atOrAbove":"1.15.2","below":"1.20.0","severity":"high","ids":["CVE-2026-101905","GHSA-m8m8-qj5v-23w3"]},{"atOrAbove":"1.16.1","below":"1.20.0","severity":"high","ids":["CVE-2026-101903","GHSA-c29m-xwm3-cm6r"]},{"atOrAbove":"1.17.0","below":"1.20.0","severity":"high","ids":["CVE-2026-101907","GHSA-r4gj-5m52-g5wh"]}]},"backbone.js":{"uri":["/(§§version§§)/backbone(\\.min)?\\.js"],"filename":["backbone(?:js)?-(§§version§§)(.min)?\\.js"],"filecontent":["//[ ]+Backbone.js (§§version§§)","a=t.Backbone=\\{\\}\\}a.VERSION=\"(§§version§§)\"","Backbone\\.VERSION *= *[\"'](§§version§§)[\"']"],"vulnerabilities":[{"atOrAbove":"0.3.3","below":"0.5.0","severity":"medium","ids":["CVE-2016-10537","GHSA-j6p2-cx3w-6jcp"]}]},"blueimp-file-upload":{"uri":["/blueimp-file-upload/(§§version§§)/jquery.fileupload(-ui)?(\\.min)?\\.js"],"filename":[],"filecontent":["/\\*[\\s*]+jQuery File Upload User Interface Plugin (§§version§§)[\\s*]+https://github.com/blueimp"],"vulnerabilities":[{"atOrAbove":null,"below":"9.22.1","severity":"high","ids":["CVE-2018-9206","GHSA-4cj8-g9cp-v5wr"]}]},"bootstrap":{"uri":["/(§§version§§)/bootstrap(\\.min)?\\.js","/(§§version§§)/js/bootstrap(\\.min)?\\.js"],"filename":["bootstrap-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*!? Bootstrap v(§§version§§)","\\* Bootstrap v(§§version§§)","/\\*! Bootstrap v(§§version§§)","this\\.close\\)\\};.\\.VERSION=\"(§§version§§)\"(?:,.\\.TRANSITION_DURATION=150)?,.\\.prototype\\.close"],"vulnerabilities":[{"atOrAbove":null,"below":"2.1.0","severity":"medium","ids":["cross-site scripting vulnerability"]},{"atOrAbove":null,"below":"3.4.0","severity":"medium","ids":["CVE-2018-20676","GHSA-3mgp-fx93-9xv5"]},{"atOrAbove":null,"below":"3.4.0","severity":"medium","ids":["CVE-2018-20677","GHSA-ph58-4vrj-w6hr"]},{"atOrAbove":"2.3.0","below":"3.4.0","severity":"medium","ids":["CVE-2018-14040","GHSA-3wqf-4x89-9g79"]},{"atOrAbove":"2.3.0","below":"3.4.0","severity":"medium","ids":["CVE-2018-14042","GHSA-7mvr-5x2g-wfc8"]},{"atOrAbove":"3.0.0","below":"3.4.0","severity":"medium","ids":["CVE-2016-10735","GHSA-4p24-vmcr-4gqj"]},{"atOrAbove":"3.0.0","below":"3.4.1","severity":"medium","ids":["CVE-2019-8331","GHSA-9v3m-8fp8-mj99"]},{"atOrAbove":"1.4.0","below":"3.4.2","severity":"medium","ids":["CVE-2024-6485","GHSA-vxmc-5x29-h64v"]},{"atOrAbove":"3.4.1","below":"3.4.2","severity":"medium","ids":["CVE-2025-1647","GHSA-q58r-hwc8-rm9j"]},{"atOrAbove":null,"below":"3.999.999","severity":"low","ids":["Bootstrap before 4.0.0 is end-of-life and no longer maintained."]},{"atOrAbove":"4.0.0-beta","below":"4.0.0-beta.2","severity":"medium","ids":["CVE-2016-10735","GHSA-4p24-vmcr-4gqj"]},{"atOrAbove":"4.0.0","below":"4.1.2","severity":"medium","ids":["CVE-2018-14040","GHSA-3wqf-4x89-9g79"]},{"atOrAbove":"4.0.0","below":"4.1.2","severity":"medium","ids":["CVE-2018-14042","GHSA-7mvr-5x2g-wfc8"]},{"atOrAbove":"4.0.0","below":"4.1.2","severity":"medium","ids":["CVE-2018-14041","GHSA-pj7m-g53m-7638"]},{"atOrAbove":"4.0.0","below":"4.3.1","severity":"medium","ids":["CVE-2019-8331","GHSA-9v3m-8fp8-mj99"]}]},"bootstrap-select":{"uri":["/bootstrap-select/(§§version§§)/"],"filename":[],"filecontent":["/\\*![\\s]+\\*[\\s]+Bootstrap-select[\\s]+v(§§version§§)",".\\.data\\(\"selectpicker\",.=new .\\(this,.\\)\\)\\}\"string\"==typeof .&&\\(.=.\\[.\\]instanceof Function\\?.\\[.\\]\\.apply\\(.,.\\):.\\.options\\[.\\]\\)\\}\\}\\);return void 0!==.\\?.:.\\}.\\.VERSION=\"(§§version§§)\","],"vulnerabilities":[{"atOrAbove":null,"below":"1.13.6","severity":"medium","ids":["CVE-2019-20921","GHSA-7c82-mp33-r854"]},{"atOrAbove":null,"below":"1.13.6","severity":"high","ids":["CVE-2019-20921","GHSA-9r7h-6639-v5mw"]}]},"c3":{"uri":["/(§§version§§)/c3(\\.min)?\\.js"],"filename":[],"filecontent":["[\\s]+var c3 ?= ?\\{ ?version: ?['\"](§§version§§)['\"] ?\\};[\\s]+var c3_chart_fn,"],"vulnerabilities":[{"atOrAbove":null,"below":"0.4.11","severity":"medium","ids":["CVE-2016-1000240","GHSA-gvg7-pp82-cff3"]}]},"chart.js":{"uri":["/Chart.js/(§§version§§)/chart(\\.min)?\\.js","/Chart.js/(§§version§§)/Chart.bundle(\\.min)?\\.js"],"filename":[],"filecontent":["var version=\"(§§version§§)\";const KNOWN_POSITIONS=\\[\"top\",\"bottom\",\"left\",\"right\",\"chartArea\"\\]","/\\*![\\s]+\\* Chart.js v(§§version§§)","/\\*![\\s]+\\* Chart.js[\\s]+\\* http://chartjs.org/[\\s]+\\* Version: (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"2.9.4","severity":"high","ids":["CVE-2020-7746","GHSA-h68q-55jf-x68w"]}]},"ckeditor":{"uri":["/(§§version§§)/ckeditor(\\.min)?\\.js"],"filename":["ckeditor-(§§version§§)(\\.min)?\\.js"],"filecontent":["ckeditor..js.{4,30}=\\{timestamp:\"[^\"]+\",version:\"(§§version§§)","window\\.CKEDITOR=function\\(\\)\\{var [a-z]=\\{timestamp:\"[^\"]+\",version:\"(§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"4.4.3","severity":"medium","ids":["XSS"]},{"atOrAbove":null,"below":"4.4.6","severity":"medium","ids":["XSS"]},{"atOrAbove":null,"below":"4.4.8","severity":"medium","ids":["XSS"]},{"atOrAbove":null,"below":"4.5.11","severity":"medium","ids":["XSS"]},{"atOrAbove":"4.5.11","below":"4.9.2","severity":"medium","ids":["XSS if the enhanced image plugin is installed"]},{"atOrAbove":"4.0.0","below":"4.11.0","severity":"medium","ids":["CVE-2018-17960","GHSA-g68x-vvqq-pvw3"]},{"atOrAbove":null,"below":"4.14.0","severity":"low","ids":["XSS"]},{"atOrAbove":null,"below":"4.15.1","severity":"medium","ids":["XSS-type attack inside CKEditor 4 by persuading a victim to paste a specially cr"]},{"atOrAbove":null,"below":"4.16.0","severity":"low","ids":["ReDoS vulnerability in Autolink plugin and Advanced Tab for Dialogs plugin"]},{"atOrAbove":null,"below":"4.16.2","severity":"low","ids":["CVE-2021-32808"]},{"atOrAbove":null,"below":"4.16.2","severity":"low","ids":["CVE-2021-32809"]},{"atOrAbove":null,"below":"4.16.2","severity":"medium","ids":["CVE-2021-37695"]},{"atOrAbove":null,"below":"4.17.0","severity":"medium","ids":["CVE-2021-41164","CVE-2021-41165"]},{"atOrAbove":null,"below":"4.18.0","severity":"low","ids":["CVE-2022-24728"]},{"atOrAbove":null,"below":"4.21.0","severity":"medium","ids":["CVE-2023-28439"]}]},"ckeditor5":{"uri":["/(§§version§§)/ckeditor5(\\.min)?\\.js"],"filename":["ckeditor5-(§§version§§)(\\.min)?\\.js"],"filecontent":["const .=\"(§§version§§)\"[,;].{0,140}?\\.CKEDITOR_VERSION=.;","CKEDITOR_VERSION=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"10.0.1","severity":"low","ids":["CVE-2018-11093"]},{"atOrAbove":null,"below":"25.0.0","severity":"low","ids":["CVE-2021-21254"]},{"atOrAbove":null,"below":"27.0.0","severity":"low","ids":["CVE-2021-21391"]},{"atOrAbove":null,"below":"35.0.0","severity":"low","ids":["CVE-2022-31175"]},{"atOrAbove":"40.0.0","below":"43.1.1","severity":"medium","ids":["CVE-2024-45613","GHSA-rgg8-g5x8-wr9v"]},{"atOrAbove":"44.2.0","below":"45.2.2","severity":"low","ids":["CVE-2025-58064","GHSA-x9gp-vjh6-3wv6"]},{"atOrAbove":"46.0.0","below":"46.0.3","severity":"low","ids":["CVE-2025-58064","GHSA-x9gp-vjh6-3wv6"]},{"atOrAbove":"29.0.0","below":"47.7.4","severity":"low","ids":["CVE-2026-116687","GHSA-v6mg-96c6-gmpq"]},{"atOrAbove":"45.0.0","below":"47.7.4","severity":"high","ids":["CVE-2026-116688","GHSA-rh54-vffm-5fvp"]},{"atOrAbove":"48.0.0","below":"48.5.1","severity":"high","ids":["CVE-2026-116688","GHSA-rh54-vffm-5fvp"]},{"atOrAbove":"48.0.0","below":"48.5.1","severity":"low","ids":["CVE-2026-116687","GHSA-v6mg-96c6-gmpq"]}]},"d3":{"uri":["/d3[@/](§§version§§)/d3.(min.)?js"],"filename":["d3[-.](§§version§§)(.min)?.js"],"filecontent":["\\/\\/ https:\\/\\/d3js\\.org (?:v|Version )(§§version§§) "],"vulnerabilities":[]},"dojo":{"uri":["/(?:dojo-)?(§§version§§)(?:/dojo)?/dojo(\\.min)?\\.js"],"filename":["dojo-(§§version§§)(\\.min)?\\.js"],"filecontent":[],"vulnerabilities":[{"atOrAbove":null,"below":"1.1.0","severity":"medium","ids":["CVE-2008-6681","GHSA-39cx-xcwj-3rc4"]},{"atOrAbove":null,"below":"1.2.0","severity":"medium","ids":["CVE-2015-5654","GHSA-p82g-2xpp-m5r3"]},{"atOrAbove":null,"below":"1.4.2","severity":"medium","ids":["CVE-2010-2275"]},{"atOrAbove":"1.10.0","below":"1.10.10","severity":"medium","ids":["CVE-2010-2273","GHSA-536q-8gxx-m782"]},{"atOrAbove":"1.11.0","below":"1.11.6","severity":"medium","ids":["CVE-2010-2273","GHSA-536q-8gxx-m782"]},{"atOrAbove":null,"below":"1.11.10","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"1.12.0","below":"1.12.4","severity":"medium","ids":["CVE-2010-2273","GHSA-536q-8gxx-m782"]},{"atOrAbove":"1.12.0","below":"1.12.8","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"1.13.0","below":"1.13.1","severity":"medium","ids":["CVE-2010-2273","GHSA-536q-8gxx-m782"]},{"atOrAbove":"1.13.0","below":"1.13.7","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"1.14.0","below":"1.14.6","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"1.15.0","below":"1.15.3","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"1.16.0","below":"1.16.2","severity":"high","ids":["CVE-2020-5258","GHSA-jxfh-8wgv-vfr2"]},{"atOrAbove":"0","below":"1.16.5","severity":"high","ids":["CVE-2021-23450","GHSA-m8gw-hjpr-rjv7"]}]},"dojox":{"uri":["/(?:dojo-release-)?(§§version§§)(?:-src)?/dojox/.+\\.js","/dojox@(§§version§§)/.+\\.js"],"filename":[],"filecontent":[],"vulnerabilities":[{"atOrAbove":"0","below":"1.11.9","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"0","below":"1.11.10","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]},{"atOrAbove":"1.12.0","below":"1.12.7","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"1.12.0","below":"1.12.8","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]},{"atOrAbove":"1.13.0","below":"1.13.6","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"1.13.0","below":"1.13.7","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]},{"atOrAbove":null,"below":"1.14.0","severity":"critical","ids":["CVE-2018-15494","GHSA-84cm-x2q5-8225"]},{"atOrAbove":"1.14.0","below":"1.14.5","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"1.14.0","below":"1.14.6","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]},{"atOrAbove":"1.15.0","below":"1.15.2","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"1.15.0","below":"1.15.3","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]},{"atOrAbove":"1.16.0","below":"1.16.1","severity":"medium","ids":["CVE-2019-10785","GHSA-pg97-ww7h-5mjr"]},{"atOrAbove":"1.16.0","below":"1.16.2","severity":"low","ids":["CVE-2020-5259","GHSA-3hw5-q855-g6cw"]}]},"dont check":{"uri":["^http[s]?://(ssl|www).google-analytics.com/ga.js","^http[s]?://apis.google.com/js/plusone.js","^http[s]?://cdn.cxense.com/cx.js"],"filename":[],"filecontent":[],"vulnerabilities":[]},"easyXDM":{"uri":["/(?:easyXDM-)?(§§version§§)/easyXDM(\\.min)?\\.js"],"filename":["easyXDM-(§§version§§)(.min)?\\.js"],"filecontent":[" \\* easyXDM\n \\* http://easyxdm.net/(?:\r|\n|.)+version:\"(§§version§§)\"","@class easyXDM(?:.|\r|\n)+@version (§§version§§)(\r|\n)"],"vulnerabilities":[{"atOrAbove":null,"below":"2.4.18","severity":"medium","ids":["CVE-2013-5212"]},{"atOrAbove":null,"below":"2.4.19","severity":"medium","ids":["CVE-2014-1403"]},{"atOrAbove":null,"below":"2.4.20","severity":"medium","ids":["This release fixes a potential XSS for IE running in compatibility mode."]},{"atOrAbove":null,"below":"2.5.0","severity":"medium","ids":["This tightens down the default origin whitelist in the CORS example."]}]},"echarts":{"uri":["/echarts[@/](§§version§§)/"],"filename":["echarts[-.](§§version§§)(.min)?.js"],"filecontent":["'(§§version§§)';[\\s]+var dependencies = \\{[\\s]+zrender: '[0-9.]+'[\\s]+\\};[\\s]+var TEST_FRAME_REMAIN_TIME = 1;","setPlatformAPI=[a-zA-Z_]+,.\\.throttle=[a-zA-Z_]+,.\\.time=[a-zA-Z_]+,.\\.use=[a-zA-Z_]+,.\\.util=[a-zA-Z_]+,.\\.vector=[a-zA-Z_]+,.\\.version=['\"](§§version§§)['\"],.\\.zrUtil",".\\.throttle=[a-zA-Z_]+,.\\.time=[a-zA-Z_]+,.\\.util=[a-zA-Z_]+,.\\.vector=[a-zA-Z_]+,.\\.version=['\"](§§version§§)['\"],.\\.zrender"],"vulnerabilities":[{"atOrAbove":"0","below":"6.1.0","severity":"medium","ids":["CVE-2026-45249","GHSA-fgmj-fm8m-jvvx"]}]},"ember":{"uri":["/(?:v)?(§§version§§)/ember(\\.min)?\\.js","/ember\\.?js/(§§version§§)/ember((\\.|-)[a-z\\-.]+)?\\.js"],"filename":["ember-(§§version§§)(\\.min)?\\.js"],"filecontent":["Project: Ember -(?:.*\n){9,11}// Version: v(§§version§§)","// Version: v(§§version§§)(.*\n){10,15}(Ember Debug|@module ember|@class ember)","Ember.VERSION[ ]?=[ ]?(?:'|\")(§§version§§)(?:'|\")","meta\\.revision=\"Ember@(§§version§§)\"","e\\(\"ember/version\",\\[\"exports\"\\],function\\(e\\)\\{\"use strict\";?[\\s]*e(?:\\.|\\[\")default(?:\"\\])?=\"(§§version§§)\"","\\(\"ember/version\",\\[\"exports\"\\],function\\(e\\)\\{\"use strict\";.{1,70}\\.default=\"(§§version§§)\"","/\\*![\\s]+\\* @overview Ember - JavaScript Application Framework[\\s\\S]{0,400}\\* @version (§§version§§)","// Version: (§§version§§)[\\s]+\\(function\\(\\) *\\{[\\s]*/\\*\\*[\\s]+@module ember[\\s]","Object\\.defineProperty\\(\\{__proto__:null,CI:!1,DEBUG:!1\\},Symbol\\.toStringTag,\\{value:\"Module\"\\}\\),\\w+=\"(§§version§§)\"","isLowLevelRegister:function\\(e\\)\\{return e<=3\\}\\},Symbol\\.toStringTag,\\{value:\"Module\"\\}\\),\\w+=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"0.9.7","severity":"high","ids":["Bound attributes aren't escaped properly"]},{"atOrAbove":null,"below":"0.9.7.1","severity":"low","ids":["More rigorous XSS escaping from bindAttr"]},{"atOrAbove":"1.0.0-rc.1","below":"1.0.0-rc.1.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0-rc.2","below":"1.0.0-rc.2.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0-rc.3","below":"1.0.0-rc.3.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0-rc.4","below":"1.0.0-rc.4.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0-rc.5","below":"1.0.0-rc.5.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0-rc.6","below":"1.0.0-rc.6.1","severity":"medium","ids":["CVE-2013-4170"]},{"atOrAbove":"1.0.0","below":"1.0.1","severity":"low","ids":["CVE-2014-0013","CVE-2014-0014"]},{"atOrAbove":"1.1.0","below":"1.1.3","severity":"low","ids":["CVE-2014-0013","CVE-2014-0014"]},{"atOrAbove":"1.2.0","below":"1.2.1","severity":"low","ids":["CVE-2014-0013","CVE-2014-0014"]},{"atOrAbove":"1.2.0","below":"1.2.2","severity":"low","ids":["CVE-2014-0046"]},{"atOrAbove":"1.3.0","below":"1.3.1","severity":"low","ids":["CVE-2014-0013","CVE-2014-0014"]},{"atOrAbove":"1.3.0","below":"1.3.2","severity":"low","ids":["CVE-2014-0046"]},{"atOrAbove":"1.4.0","below":"1.4.0-beta.2","severity":"low","ids":["CVE-2014-0013","CVE-2014-0014"]},{"atOrAbove":null,"below":"1.5.0","severity":"low","ids":["CVE-2014-0046"]},{"atOrAbove":"1.8.0","below":"1.11.4","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":"1.12.0","below":"1.12.2","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":"1.13.0","below":"1.13.12","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":"2.0.0","below":"2.0.3","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":"2.1.0","below":"2.1.2","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":"2.2.0","below":"2.2.1","severity":"medium","ids":["CVE-2015-7565"]},{"atOrAbove":null,"below":"3.24.7","severity":"high","ids":["Prototype pollution"]},{"atOrAbove":"3.25.0","below":"3.28.10","severity":"high","ids":["Prototype pollution"]},{"atOrAbove":"4.0.0","below":"4.4.4","severity":"high","ids":["Prototype pollution"]},{"atOrAbove":"4.5.0","below":"4.8.1","severity":"high","ids":["Prototype pollution"]},{"atOrAbove":"4.9.0-alpha.1","below":"4.9.0-beta.3","severity":"high","ids":["Prototype pollution"]}]},"flowplayer":{"uri":["flowplayer-(§§version§§)(\\.min)?\\.js"],"filename":["flowplayer-(§§version§§)(\\.min)?\\.js"],"filecontent":[],"vulnerabilities":[{"atOrAbove":null,"below":"5.4.3","severity":"medium","ids":["XSS vulnerability in Flash fallback"]}]},"froala":{"uri":["/froala-editor/(§§version§§)/","/froala-editor@(§§version§§)/"],"filename":[],"filecontent":["/\\*![\\s]+\\* froala_editor v(§§version§§)","VERSION:\"(§§version§§)\",INSTANCES:\\[\\],OPTS_MAPPING:\\{\\}"],"vulnerabilities":[{"atOrAbove":null,"below":"3.2.2","severity":"medium","ids":["Security issue: XSS via pasted content"]},{"atOrAbove":null,"below":"3.2.2","severity":"medium","ids":["XSS Issue In Link Insertion"]},{"atOrAbove":null,"below":"3.2.3","severity":"medium","ids":["CVE-2019-19935","GHSA-h236-g5gh-vq6c"]},{"atOrAbove":null,"below":"3.2.7","severity":"high","ids":["CVE-2021-28114"]},{"atOrAbove":null,"below":"3.2.7","severity":"medium","ids":["CVE-2021-30109","GHSA-cq6w-w5rj-p9x8"]},{"atOrAbove":null,"below":"4.0.11","severity":"medium","ids":["CVE-2020-22864","GHSA-97x5-cc53-cv4v"]},{"atOrAbove":"4.0.1","below":"4.1.4","severity":"medium","ids":["CVE-2023-41592","GHSA-hvpq-7vcc-5hj5"]},{"atOrAbove":"0","below":"4.3.1","severity":"medium","ids":["CVE-2024-51434","GHSA-549p-5c7f-c5p4"]}]},"handlebars":{"uri":["/(§§version§§)/handlebars(\\.min)?\\.js"],"filename":["handlebars(?:js)?-(§§version§§)(.min)?\\.js"],"filecontent":["Handlebars.VERSION = \"(§§version§§)\";","Handlebars=\\{VERSION:(?:'|\")(§§version§§)(?:'|\")","this.Handlebars=\\{\\};[\n\r \t]+\\(function\\([a-z]\\)\\{[a-z].VERSION=(?:'|\")(§§version§§)(?:'|\")","exports.HandlebarsEnvironment=[\\s\\S]{70,120}exports.VERSION=(?:'|\")(§§version§§)(?:'|\")","/\\*+![\\s]+(?:@license)?[\\s]+handlebars v+(§§version§§)","window\\.Handlebars=.,.\\.VERSION=\"(§§version§§)\"",".\\.HandlebarsEnvironment=.;var .=.\\(.\\),.=.\\(.\\),.=\"(§§version§§)\";.\\.VERSION="],"vulnerabilities":[{"atOrAbove":null,"below":"1.0.0.beta.3","severity":"medium","ids":["poorly sanitized input passed to eval()"]},{"atOrAbove":null,"below":"3.0.7","severity":"high","ids":["GHSA-q42p-pg8m-cqh6"]},{"atOrAbove":null,"below":"3.0.8","severity":"high","ids":["GHSA-2cf5-4w76-r9qv"]},{"atOrAbove":null,"below":"3.0.8","severity":"high","ids":["CVE-2019-20920","GHSA-3cqr-58rm-57f8"]},{"atOrAbove":null,"below":"3.0.8","severity":"high","ids":["GHSA-g9r4-xpmj-mj65"]},{"atOrAbove":null,"below":"3.0.8","severity":"high","ids":["GHSA-q2c6-c6pm-g3gh"]},{"atOrAbove":null,"below":"3.0.8","severity":"high","ids":["CVE-2019-19919","GHSA-w457-6q6x-cgp9"]},{"atOrAbove":null,"below":"4.0.0","severity":"medium","ids":["CVE-2015-8861","GHSA-9prh-257w-9277"]},{"atOrAbove":"4.0.0","below":"4.0.13","severity":"high","ids":["A prototype pollution vulnerability in handlebars is exploitable if an attacker "]},{"atOrAbove":"4.0.0","below":"4.0.14","severity":"high","ids":["GHSA-q42p-pg8m-cqh6"]},{"atOrAbove":"4.1.0","below":"4.1.2","severity":"high","ids":["GHSA-q42p-pg8m-cqh6"]},{"atOrAbove":"4.0.0","below":"4.3.0","severity":"high","ids":["CVE-2019-19919","GHSA-w457-6q6x-cgp9"]},{"atOrAbove":"4.0.0","below":"4.4.5","severity":"high","ids":["CVE-2019-20922","GHSA-62gr-4qp9-h98f"]},{"atOrAbove":"4.0.0","below":"4.4.5","severity":"medium","ids":["GHSA-f52g-6jhx-586p"]},{"atOrAbove":"4.0.0","below":"4.5.2","severity":"high","ids":["GHSA-2cf5-4w76-r9qv"]},{"atOrAbove":"4.0.0","below":"4.5.3","severity":"high","ids":["CVE-2019-20920","GHSA-3cqr-58rm-57f8"]},{"atOrAbove":"4.0.0","below":"4.5.3","severity":"high","ids":["GHSA-g9r4-xpmj-mj65"]},{"atOrAbove":"4.0.0","below":"4.5.3","severity":"high","ids":["GHSA-q2c6-c6pm-g3gh"]},{"atOrAbove":null,"below":"4.6.0","severity":"medium","ids":["Denial of service"]},{"atOrAbove":null,"below":"4.7.7","severity":"high","ids":["CVE-2021-23383","GHSA-765h-qjxv-5f44"]},{"atOrAbove":null,"below":"4.7.7","severity":"high","ids":["CVE-2021-23369","GHSA-f2jv-r9rf-7988"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"medium","ids":["CVE-2026-33916","GHSA-2qvq-rjwj-gvw9"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"critical","ids":["CVE-2026-33937","GHSA-2w6w-674q-4c4q"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"high","ids":["CVE-2026-33938","GHSA-3mfm-83xf-c92r"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"low","ids":["GHSA-442j-39wm-28r2"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"high","ids":["CVE-2026-33939","GHSA-9cx6-37pm-9jff"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"high","ids":["CVE-2026-33940","GHSA-xhpv-hc6g-r9c6"]},{"atOrAbove":"4.0.0","below":"4.7.9","severity":"high","ids":["CVE-2026-33941","GHSA-xjpj-3mr7-gcpf"]},{"atOrAbove":"4.6.0","below":"4.7.9","severity":"medium","ids":["GHSA-7rx3-28cr-v5wh"]},{"atOrAbove":"3.0.0","below":"4.7.10","severity":"critical","ids":["CVE-2026-106445","GHSA-p8wg-vrv2-v86f"]},{"atOrAbove":"4.0.0","below":"4.7.10","severity":"critical","ids":["CVE-2026-106446","GHSA-8r5x-fm3f-whwj"]},{"atOrAbove":"4.0.0","below":"4.7.10","severity":"medium","ids":["CVE-2026-106444","GHSA-xw65-4hp5-5hc7"]}]},"highcharts":{"uri":["highcharts/(§§version§§)/highcharts(\\.min)?\\.js"],"filename":[],"filecontent":["product:\"Highcharts\",version:\"(§§version§§)\"","product=\"Highcharts\"[,;].\\.version=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"6.1.0","severity":"high","ids":["CVE-2018-20801","GHSA-xmc8-cjfr-phx3"]},{"atOrAbove":null,"below":"7.2.2","severity":"high","ids":["GHSA-gr4j-r575-g665"]},{"atOrAbove":"8.0.0","below":"8.1.1","severity":"high","ids":["GHSA-gr4j-r575-g665"]},{"atOrAbove":null,"below":"9.0.0","severity":"high","ids":["CVE-2021-29489","GHSA-8j65-4pcq-xq95"]},{"atOrAbove":"0","below":"11.4.9","severity":"high","ids":["CVE-2026-118251","GHSA-5793-x2q3-c3q7"]},{"atOrAbove":"6.1.0","below":"11.4.9","severity":"high","ids":["CVE-2026-118250","GHSA-rmqc-xvr3-v46c"]},{"atOrAbove":"10.0.0","below":"11.4.9","severity":"high","ids":["CVE-2026-118246","GHSA-35rr-xwfh-x789"]},{"atOrAbove":"10.3.2","below":"11.4.9","severity":"high","ids":["CVE-2026-116796","GHSA-mw4f-gj5x-6xr4"]},{"atOrAbove":"12.0.0","below":"12.6.1","severity":"high","ids":["CVE-2026-118246","GHSA-35rr-xwfh-x789"]},{"atOrAbove":"12.0.0","below":"12.6.1","severity":"high","ids":["CVE-2026-118251","GHSA-5793-x2q3-c3q7"]},{"atOrAbove":"12.0.0","below":"12.6.1","severity":"high","ids":["CVE-2026-118244","GHSA-65hg-cf3f-5m39"]},{"atOrAbove":"12.0.0","below":"12.6.1","severity":"high","ids":["CVE-2026-118250","GHSA-rmqc-xvr3-v46c"]},{"atOrAbove":"12.0.0","below":"12.6.2","severity":"high","ids":["CVE-2026-116796","GHSA-mw4f-gj5x-6xr4"]},{"atOrAbove":"13.0.0","below":"13.1.0","severity":"high","ids":["CVE-2026-118246","GHSA-35rr-xwfh-x789"]},{"atOrAbove":"13.0.0","below":"13.1.0","severity":"high","ids":["CVE-2026-118251","GHSA-5793-x2q3-c3q7"]},{"atOrAbove":"13.0.0","below":"13.1.0","severity":"high","ids":["CVE-2026-118244","GHSA-65hg-cf3f-5m39"]},{"atOrAbove":"13.0.0","below":"13.1.0","severity":"high","ids":["CVE-2026-118249","GHSA-gfvx-2c2g-38wq"]},{"atOrAbove":"13.0.0","below":"13.1.0","severity":"high","ids":["CVE-2026-118250","GHSA-rmqc-xvr3-v46c"]},{"atOrAbove":"13.0.0","below":"13.1.1","severity":"high","ids":["CVE-2026-116796","GHSA-mw4f-gj5x-6xr4"]}]},"highlightjs":{"uri":["/highlight.js[@/](§§version§§)/"],"filename":["highlight[-.](§§version§§)(.min)?.js"],"filecontent":["/\\*!\\s*[Hh]ighlight.js v(§§version§§)","\"after:highlightBlock\"[\\s\\S]{0,170}versionString=['\"](§§version§§)['\"]"],"vulnerabilities":[{"atOrAbove":"0","below":"9.18.2","severity":"medium","ids":["CVE-2020-26237","GHSA-vfrc-7r7c-w9mx"]},{"atOrAbove":"10.0.0","below":"10.1.2","severity":"medium","ids":["CVE-2020-26237","GHSA-vfrc-7r7c-w9mx"]},{"atOrAbove":"9.0.0","below":"10.4.1","severity":"medium","ids":["GHSA-7wwv-vh3v-89cq"]}]},"jPlayer":{"uri":[],"filename":[],"filecontent":["/\\*!?[\n *]+jPlayer Plugin for jQuery (?:.*\n){1,10}[ *]+Version: (§§version§§)","/\\*!? jPlayer (§§version§§) for jQuery"],"vulnerabilities":[{"atOrAbove":null,"below":"2.2.20","severity":"medium","ids":["CVE-2013-1942"]},{"atOrAbove":null,"below":"2.3.0","severity":"medium","ids":["CVE-2013-2022","GHSA-3jcq-cwr7-6332"]},{"atOrAbove":null,"below":"2.3.1","severity":"medium","ids":["CVE-2013-2023"]}]},"jquery":{"uri":["/(§§version§§)/jquery(\\.min)?\\.js"],"filename":["jquery-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*!? jQuery v(§§version§§)","\\* jQuery JavaScript Library v(§§version§§)","\\* jQuery (§§version§§) - New Wave Javascript","/\\*![\\s]+\\* jQuery JavaScript Library v(§§version§§)","// \\$Id: jquery.js,v (§§version§§)","/\\*! jQuery v(§§version§§)","[^a-z]f=\"(§§version§§)\",.*[^a-z]jquery:f,","[^a-z]m=\"(§§version§§)\",.*[^a-z]jquery:m,","[^a-z.]jquery:[ ]?\"(§§version§§)\"","\\$\\.documentElement,Q=e.jQuery,Z=e\\.\\$,ee=\\{\\},te=\\[\\],ne=\"(§§version§§)\"","=\"(§§version§§)\",.{50,300}(.)\\.fn=(\\2)\\.prototype=\\{jquery:"],"vulnerabilities":[{"atOrAbove":null,"below":"1.6.3","severity":"medium","ids":["CVE-2011-4969","GHSA-579v-mp3v-rrw5"]},{"atOrAbove":null,"below":"1.9.0b1","severity":"medium","ids":["CVE-2012-6708","GHSA-2pqj-h3vj-pqgw"]},{"atOrAbove":"1.2.1","below":"1.9.0","severity":"medium","ids":["CVE-2020-7656","GHSA-q4m3-2j7h-f7xw"]},{"atOrAbove":"1.4.0","below":"1.12.0","severity":"medium","ids":["CVE-2015-9251","GHSA-rmxg-73gg-4p98"]},{"atOrAbove":"1.8.0","below":"2.2.0","severity":"medium","ids":["parseHTML() executes scripts in event handlers"]},{"atOrAbove":null,"below":"2.999.999","severity":"low","ids":["jQuery 1.x and 2.x are End-of-Life and no longer receiving security updates"]},{"atOrAbove":"1.12.3","below":"3.0.0-beta1","severity":"medium","ids":["CVE-2015-9251","GHSA-rmxg-73gg-4p98"]},{"atOrAbove":"2.2.2","below":"3.0.0","severity":"medium","ids":["parseHTML() executes scripts in event handlers"]},{"atOrAbove":"3.0.0-rc.1","below":"3.0.0","severity":"high","ids":["CVE-2016-10707","GHSA-mhpp-875w-9cpv"]},{"atOrAbove":"1.1.4","below":"3.4.0","severity":"medium","ids":["CVE-2019-11358","GHSA-6c3j-c64m-qhgq"]},{"atOrAbove":"1.0.3","below":"3.5.0","severity":"medium","ids":["CVE-2020-11023","GHSA-jpcq-cgw6-v4j6"]},{"atOrAbove":"1.12.0","below":"3.5.0","severity":"medium","ids":["CVE-2020-11022","GHSA-gxr4-xjj5-5px2"]}]},"jquery-deparam":{"uri":[],"filename":[],"filecontent":[],"vulnerabilities":[{"atOrAbove":null,"below":"0.5.4","severity":"high","ids":["CVE-2021-20087","GHSA-xg68-chx2-253g"]}]},"jquery-migrate":{"uri":[],"filename":["jquery-migrate-(§§version§§)(.min)?\\.js"],"filecontent":["/\\*!?(?:\n \\*)? jQuery Migrate(?: -)? v(§§version§§)","\\.migrateVersion ?= ?\"(§§version§§)\"[\\s\\S]{10,150}(migrateDisablePatches|migrateWarnings|JQMIGRATE)","jQuery\\.migrateVersion ?= ?\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"1.2.0","severity":"medium","ids":["cross-site-scripting"]},{"atOrAbove":null,"below":"1.2.2","severity":"medium","ids":["Selector interpreted as HTML"]}]},"jquery-mobile":{"uri":["/(§§version§§)/jquery.mobile(\\.min)?\\.js"],"filename":["jquery.mobile-(§§version§§)(.min)?\\.js"],"filecontent":["/\\*!?[\\s*]*jQuery Mobile(?: -)? v?(§§version§§)","// Version of the jQuery Mobile Framework[\\s]+version: *[\"'](§§version§§)[\"'],"],"vulnerabilities":[{"atOrAbove":null,"below":"1.0.1","severity":"high","ids":[""]},{"atOrAbove":null,"below":"1.0RC2","severity":"high","ids":[""]},{"atOrAbove":null,"below":"1.1.2","severity":"medium","ids":["location.href cross-site scripting"]},{"atOrAbove":null,"below":"1.2.0","severity":"medium","ids":["location.href cross-site scripting"]},{"atOrAbove":null,"below":"1.3.0","severity":"high","ids":["Endpoint that reflect user input leads to cross site scripting"]},{"atOrAbove":"0","below":"999.999.999","severity":"high","ids":["GHSA-fj93-7wm4-8x2g"]}]},"jquery-ui":{"uri":["/(§§version§§)/jquery-ui(\\.min)?\\.js"],"filename":[],"filecontent":["/\\*!? jQuery UI - v(§§version§§)","/\\*!?[\n *]+jQuery UI (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"1.13.0","severity":"medium","ids":["CVE-2021-41182","GHSA-9gj3-hwp5-pmwc"]},{"atOrAbove":null,"below":"1.13.0","severity":"medium","ids":["CVE-2021-41184","GHSA-gpqq-952q-5327"]},{"atOrAbove":null,"below":"1.13.0","severity":"medium","ids":["CVE-2021-41183","GHSA-j7qv-pgf6-hvh4"]},{"atOrAbove":null,"below":"1.13.2","severity":"medium","ids":["CVE-2022-31160","GHSA-h6gj-6jjq-h8g9"]}]},"jquery-ui-autocomplete":{"uri":[],"filename":[],"filecontent":["/\\*!? jQuery UI - v(§§version§§)(.*\n){1,3}.*jquery\\.ui\\.autocomplete\\.js","/\\*!?[\n *]+jQuery UI (§§version§§)(.*\n)*.*\\.ui\\.autocomplete","/\\*!?[\n *]+jQuery UI Autocomplete (§§version§§)","/\\*!? jQuery UI - v(§§version§§)(.*\n){1,3}\\* Includes: .* autocomplete\\.js"],"vulnerabilities":[]},"jquery-ui-dialog":{"uri":[],"filename":[],"filecontent":["/\\*!? jQuery UI - v(§§version§§)(.*\n){1,3}.*jquery\\.ui\\.dialog\\.js","/\\*!?[\n *]+jQuery UI (§§version§§)(.*\n)*.*\\.ui\\.dialog","/\\*!?[\n *]+jQuery UI Dialog (§§version§§)","/\\*!? jQuery UI - v(§§version§§)(.*\n){1,3}\\* Includes: .* dialog\\.js"],"vulnerabilities":[{"atOrAbove":"1.7.0","below":"1.10.0","severity":"medium","ids":["CVE-2010-5312","GHSA-wcm2-9c89-wmfm"]},{"atOrAbove":null,"below":"1.12.0","severity":"medium","ids":["CVE-2016-7103","GHSA-hpcf-8vf9-q4gj"]}]},"jquery-ui-tooltip":{"uri":[],"filename":[],"filecontent":["/\\*!? jQuery UI - v(§§version§§)(.*\n){1,3}.*jquery\\.ui\\.tooltip\\.js","/\\*!?[\n *]+jQuery UI (§§version§§)(.*\n)*.*\\.ui\\.tooltip","/\\*!?[\n *]+jQuery UI Tooltip (§§version§§)"],"vulnerabilities":[{"atOrAbove":"1.9.2","below":"1.10.0","severity":"medium","ids":["CVE-2012-6662","GHSA-qqxp-xp9v-vvx6"]}]},"jquery-validation":{"uri":["/(§§version§§)/jquery.validat(ion|e)(\\.min)?\\.js","/jquery-validation@(§§version§§)/dist/.*\\.js"],"filename":["jquery.validat(?:ion|e)-(§§version§§)(.min)?\\.js"],"filecontent":["/\\*!?(?:\n \\*)?[\\s]*jQuery Validation Plugin -? ?v(§§version§§)","Original file: /npm/jquery-validation@(§§version§§)/dist/jquery.validate.js"],"vulnerabilities":[{"atOrAbove":null,"below":"1.19.3","severity":"high","ids":["CVE-2021-21252","GHSA-jxwx-85vp-gvwm"]},{"atOrAbove":null,"below":"1.19.4","severity":"low","ids":["CVE-2021-43306","GHSA-j9m2-h2pv-wvph"]},{"atOrAbove":null,"below":"1.19.5","severity":"high","ids":["CVE-2022-31147","GHSA-ffmh-x56j-9rc3"]},{"atOrAbove":null,"below":"1.20.0","severity":"medium","ids":["Potential XSS via showLabel"]},{"atOrAbove":"0","below":"1.20.0","severity":"medium","ids":["CVE-2025-3573","GHSA-rrj2-ph5q-jxw2"]}]},"jquery.datatables":{"uri":["/(§§version§§)/(js/)?(jquery.)?dataTables(.min)?.js"],"filename":["jquery.dataTables-(§§version§§)(\\.min)?\\.js"],"filecontent":["http://www.datatables.net\n +DataTables (§§version§§)","/\\*! DataTables (§§version§§)",".\\.version=\"(§§version§§)\";[\\s]*.\\.settings=\\[\\];[\\s]*.\\.models=\\{[\\s]*\\};[\\s]*.\\.models.oSearch"],"vulnerabilities":[{"atOrAbove":null,"below":"1.10.10","severity":"high","ids":["CVE-2015-6584"]},{"atOrAbove":null,"below":"1.10.22","severity":"high","ids":["CVE-2020-28458","GHSA-m7j4-fhg6-xf5v"]},{"atOrAbove":null,"below":"1.10.22","severity":"medium","ids":["prototype pollution"]},{"atOrAbove":null,"below":"1.10.23","severity":"high","ids":["prototype pollution"]},{"atOrAbove":null,"below":"1.11.3","severity":"low","ids":["possible XSS"]},{"atOrAbove":null,"below":"1.11.3","severity":"medium","ids":["CVE-2021-23445","GHSA-h73q-5wmj-q8pj"]}]},"jquery.prettyPhoto":{"uri":["/prettyPhoto/(§§version§§)/js/jquery\\.prettyPhoto(\\.min?)\\.js","/prettyphoto@(§§version§§)/js/jquery\\.prettyPhoto\\.js"],"filename":[],"filecontent":["/\\*[\r\n -]+Class: prettyPhoto(?:.*\n){1,3}[ ]*Version: (§§version§§)","\\.prettyPhoto[ ]?=[ ]?\\{version:[ ]?(?:'|\")(§§version§§)(?:'|\")\\}"],"vulnerabilities":[{"atOrAbove":null,"below":"3.1.5","severity":"medium","ids":["CVE-2013-6837"]},{"atOrAbove":null,"below":"3.1.6","severity":"high","ids":[""]}]},"jquery.terminal":{"uri":["/jquery.terminal[@/](§§version§§)/"],"filename":[],"filecontent":["version (§§version§§)[\\s]+\\*[\\s]+\\* This file is part of jQuery Terminal.","\\$\\.terminal=\\{version:\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":null,"below":"1.21.0","severity":"medium","ids":["GHSA-2hwp-g4g7-mwwj"]},{"atOrAbove":null,"below":"2.31.1","severity":"low","ids":["CVE-2021-43862","GHSA-x9r5-jxvq-4387"]}]},"jszip":{"uri":["/jszip[/@](§§version§§)/.*\\.js"],"filename":["jszip-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*![\\s]+JSZip v(§§version§§) "],"vulnerabilities":[{"atOrAbove":null,"below":"2.7.0","severity":"medium","ids":["CVE-2021-23413","GHSA-jg8v-48h5-wgxg"]},{"atOrAbove":"3.0.0","below":"3.7.0","severity":"medium","ids":["CVE-2021-23413","GHSA-jg8v-48h5-wgxg"]},{"atOrAbove":null,"below":"3.8.0","severity":"medium","ids":["CVE-2022-48285","GHSA-36fh-84j7-cv5h"]}]},"knockout":{"uri":["/knockout/(§§version§§)/knockout(-[a-z.]+)?\\.js"],"filename":["knockout-(§§version§§)(.min)?\\.js"],"filecontent":["(?:\\*|//) Knockout JavaScript library v(§§version§§)",".version=\"(§§version§§)\",_.b\\(.version.,_.version\\),_.options=\\{deferUpdates:!1,useOnlyNativeEvents:!1,foreachHidesDestroyed:!1\\}"],"vulnerabilities":[{"atOrAbove":null,"below":"3.5.0","severity":"medium","ids":["CVE-2019-14862","GHSA-vcjj-xf2r-mwvc"]}]},"lodash":{"uri":["/(§§version§§)/lodash(\\.min)?\\.js"],"filename":[],"filecontent":["/\\*[\\s*!]+(?:@license)?[\\s*]+(?:Lo-Dash|lodash|Lodash) v?(§§version§§)[\\s\\S]{1,200}Build: `lodash modern -o","/\\*[\\s*!]+(?:@license)?[\\s*]+(?:Lo-Dash|lodash|Lodash) v?(§§version§§) <","/\\*[\\s*!]+(?:@license)?[\\s*]+(?:Lo-Dash|lodash|Lodash) v?(§§version§§) lodash.com/license","=\"(§§version§§)(?<=[0-9]{1,2}\\.[0-9]{1,2}\\.[0-9]{1,2})\"[\\s\\S]{1,300}__lodash_hash_undefined__","/\\*[\\s*]+@license[\\s*]+(?:Lo-Dash|lodhash|Lodash)[\\s\\S]{1,500}var VERSION *= *['\"](§§version§§)['\"]","var VERSION=\"(§§version§§)\";var BIND_FLAG=1,BIND_KEY_FLAG=2,CURRY_BOUND_FLAG=4,CURRY_FLAG=8"],"vulnerabilities":[{"atOrAbove":null,"below":"4.17.5","severity":"medium","ids":["CVE-2018-3721","GHSA-fvqr-27wr-82fm"]},{"atOrAbove":null,"below":"4.17.11","severity":"high","ids":["CVE-2018-16487","GHSA-4xc9-xhrj-v574"]},{"atOrAbove":"4.7.0","below":"4.17.11","severity":"medium","ids":["CVE-2019-1010266","GHSA-x5rq-j2xg-h7qm"]},{"atOrAbove":null,"below":"4.17.12","severity":"high","ids":["CVE-2019-10744","GHSA-jf85-cpcp-j695"]},{"atOrAbove":"3.7.0","below":"4.17.19","severity":"high","ids":["CVE-2020-8203","GHSA-p6mc-m468-83gw"]},{"atOrAbove":null,"below":"4.17.21","severity":"high","ids":["CVE-2021-23337","GHSA-35jh-r3h4-6jhm"]},{"atOrAbove":"4.0.0","below":"4.17.21","severity":"medium","ids":["CVE-2020-28500","GHSA-29mw-wpgm-hmr9"]},{"atOrAbove":"4.0.0","below":"4.17.23","severity":"medium","ids":["CVE-2025-13465","GHSA-xxjr-mmjv-4gpg"]},{"atOrAbove":"4.0.0","below":"4.18.0","severity":"high","ids":["CVE-2026-4800","GHSA-r5fr-rjxr-66jc"]},{"atOrAbove":"4.17.23","below":"4.18.1","severity":"medium","ids":["CVE-2026-2950","GHSA-f23m-r3pf-42rh"]}]},"markdown-it":{"uri":["/markdown-it[/@](§§version§§)/?.*\\.js"],"filename":["markdown-it-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*! markdown-it(?:-ins)? (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"3.0.0","severity":"high","ids":["CVE-2015-10005","GHSA-j5p7-jf4q-742q"]},{"atOrAbove":null,"below":"4.1.0","severity":"medium","ids":["CVE-2015-3295"]},{"atOrAbove":"4.0.0","below":"4.3.1","severity":"medium","ids":["Cross-site Scripting (XSS)"]},{"atOrAbove":null,"below":"10.0.0","severity":"medium","ids":["Regular Expression Denial of Service (ReDoS)"]},{"atOrAbove":null,"below":"12.3.2","severity":"medium","ids":["CVE-2022-21670","GHSA-6vfc-qv3f-vr6c"]},{"atOrAbove":null,"below":"13.0.2","severity":"medium","ids":["Fixed crash/infinite loop caused by linkify inline rule"]},{"atOrAbove":"13.0.0","below":"14.1.1","severity":"medium","ids":["CVE-2026-2327","GHSA-38c4-r59v-3vqw"]},{"atOrAbove":"0","below":"14.2.0","severity":"medium","ids":["CVE-2026-48988","GHSA-6v5v-wf23-fmfq"]},{"atOrAbove":"0","below":"14.3.1","severity":"medium","ids":["GHSA-253c-mchw-3w2r"]},{"atOrAbove":"0","below":"14.3.2","severity":"high","ids":["CVE-2026-111759","GHSA-r7fv-28h4-cvq7"]},{"atOrAbove":"0","below":"14.3.3","severity":"low","ids":["CVE-2026-111766","GHSA-vfgh-jcmw-g37q"]},{"atOrAbove":"14.1.0","below":"14.3.3","severity":"high","ids":["CVE-2026-111758","GHSA-gfr2-rv44-r23c"]},{"atOrAbove":"15.0.0","below":"15.0.1","severity":"medium","ids":["GHSA-253c-mchw-3w2r"]},{"atOrAbove":"15.0.0","below":"15.0.2","severity":"high","ids":["CVE-2026-111759","GHSA-r7fv-28h4-cvq7"]},{"atOrAbove":"15.0.0","below":"15.0.3","severity":"high","ids":["CVE-2026-111758","GHSA-gfr2-rv44-r23c"]},{"atOrAbove":"15.0.0","below":"15.0.3","severity":"low","ids":["CVE-2026-111766","GHSA-vfgh-jcmw-g37q"]}]},"marked":{"uri":["/marked[@/](§§version§§)/"],"filename":["marked[-.](§§version§§)(.min)?.js"],"filecontent":["/[!*\\s/]+[\\s]marked v(§§version§§)"],"vulnerabilities":[{"atOrAbove":"0","below":"0.3.1","severity":"medium","ids":["CVE-2014-3743","GHSA-9cw2-jqp5-7x39"]},{"atOrAbove":"0","below":"0.3.3","severity":"medium","ids":["CVE-2015-1370","GHSA-cfjh-p3g4-3q2f"]},{"atOrAbove":"0","below":"0.3.4","severity":"high","ids":["CVE-2015-8854","GHSA-hjcp-j389-59ff"]},{"atOrAbove":"0","below":"0.3.6","severity":"medium","ids":["CVE-2016-10531","GHSA-vfvf-mqq8-rwqc"]},{"atOrAbove":"0","below":"0.3.7","severity":"medium","ids":["CVE-2017-1000427","GHSA-7px7-7xjx-hxm8"]},{"atOrAbove":"0","below":"0.3.9","severity":"high","ids":["CVE-2017-16114","GHSA-x5pg-88wf-qq4p"]},{"atOrAbove":"0","below":"0.3.17","severity":"medium","ids":["CVE-2018-25110","GHSA-p9wx-2529-fp83"]},{"atOrAbove":"0.3.14","below":"0.6.2","severity":"medium","ids":["GHSA-xf5p-87ch-gxw2"]},{"atOrAbove":"0.4.0","below":"0.7.0","severity":"low","ids":["GHSA-ch52-vgq2-943f"]},{"atOrAbove":"1.1.1","below":"2.0.0","severity":"medium","ids":["CVE-2021-21306","GHSA-4r62-v4vq-hr96"]},{"atOrAbove":"0","below":"4.0.10","severity":"high","ids":["CVE-2022-21681","GHSA-5v2h-r2cx-5xgj"]},{"atOrAbove":"0","below":"4.0.10","severity":"high","ids":["CVE-2022-21680","GHSA-rrrm-qjm4-v8hf"]},{"atOrAbove":"18.0.0","below":"18.0.2","severity":"high","ids":["CVE-2026-41680","GHSA-6v9c-7cg6-27q7"]}]},"mathjax":{"uri":["/mathjax@(§§version§§)/","/mathjax/(§§version§§)/"],"filename":[],"filecontent":["\\.MathJax\\.config\\.startup;{10,100}.\\.VERSION=\"(§§version§§)\"","\\.MathJax=\\{version:\"(§§version§§)\"","MathJax.{0,100}.\\.VERSION=void 0,.\\.VERSION=\"(§§version§§)\"","MathJax\\.version=\"(§§version§§)\";","\\.mathjaxVersion=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":"0","below":"2.7.4","severity":"medium","ids":["CVE-2018-1999024","GHSA-3c48-6pcv-88rm"]},{"atOrAbove":"0","below":"2.7.10","severity":"high","ids":["CVE-2023-39663","GHSA-v638-q856-grg8"]}]},"moment.js":{"uri":["/moment\\.js/(§§version§§)/moment(.min)?\\.js"],"filename":["moment(?:-|\\.)(§§version§§)(?:-min)?\\.js"],"filecontent":["//!? moment.js(?:[\n\r]+)//!? version : (§§version§§)","/\\* Moment.js +\\| +version : (§§version§§) \\|","\\.version=\"(§§version§§)\".{20,60}\"isBefore\".{20,60}\"isAfter\".{200,500}\\.isMoment=","\\.version=\"(§§version§§)\".{20,300}duration.{2,100}\\.isMoment=","\\.isMoment\\(.{50,400}_isUTC.{50,400}=\"(§§version§§)\"","=\"(§§version§§)\".{300,1000}Years:31536e6.{60,80}\\.isMoment","// Moment.js is freely distributable under the terms of the MIT license.[\\s]+//[\\s]+// Version (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"2.11.2","severity":"medium","ids":["CVE-2016-4055","GHSA-87vv-r9j6-g5qv"]},{"atOrAbove":null,"below":"2.15.2","severity":"medium","ids":["Regular Expression Denial of Service (ReDoS)"]},{"atOrAbove":null,"below":"2.19.3","severity":"high","ids":["CVE-2017-18214","GHSA-446m-mv8f-q348"]},{"atOrAbove":null,"below":"2.29.2","severity":"high","ids":["CVE-2022-24785","GHSA-8hfj-j24r-96c4"]},{"atOrAbove":"2.18.0","below":"2.29.4","severity":"high","ids":["CVE-2022-31129","GHSA-wc69-rhjr-hc9g"]},{"atOrAbove":"2.29.2","below":"2.31.0","severity":"medium","ids":["CVE-2026-17495","GHSA-4p3w-j4w9-5jqw"]}]},"mootools":{"uri":["/mootools/(§§version§§)/mootools"],"filename":["mootools-(§§version§§)(?:\\.min)?\\.js"],"filecontent":["this\\.MooTools\\s*=\\s*\\{[\\s\\S]{0,30}version:\\s*['\"](§§version§§)['\"]"],"vulnerabilities":[{"atOrAbove":"0","below":"1.5.3","severity":"high","ids":["CVE-2021-32821","GHSA-v63q-hgqc-qvpg"]},{"atOrAbove":"0","below":"1.5.3","severity":"medium","ids":["CVE-2021-23432","GHSA-x6hx-7gh3-3q98"]}]},"mustache.js":{"uri":["/(§§version§§)/mustache(\\.min)?\\.js"],"filename":["mustache(?:js)?-(§§version§§)(.min)?\\.js"],"filecontent":["name:\\s*['\"]mustache.js['\"],\\s*version:\\s*['\"](§§version§§)['\"]","name=\"mustache.js\"[;,].\\.version=\"(§§version§§)\"","[^a-z]mustache.version[ ]?=[ ]?(?:'|\")(§§version§§)(?:'|\")","exports.name[ ]?=[ ]?\"mustache.js\";[\n ]*exports.version[ ]?=[ ]?(?:'|\")(§§version§§)(?:'|\");"],"vulnerabilities":[{"atOrAbove":null,"below":"0.3.1","severity":"high","ids":["execution of arbitrary javascript"]},{"atOrAbove":null,"below":"2.2.1","severity":"high","ids":["CVE-2015-8862","GHSA-w3w8-37jv-2c58"]}]},"nextjs":{"uri":[],"filename":[],"filecontent":["version=\"(§§version§§)\".{1,1500}document\\.getElementById\\(\"__NEXT_DATA__\"\\)\\.textContent","document\\.getElementById\\(\"__NEXT_DATA__\"\\)\\.textContent\\);window\\.__NEXT_DATA__=.;.\\.version=\"(§§version§§)\"","=\"(§§version§§)\"[\\s\\S]{10,100}Component[\\s\\S]{1,10}componentDidCatch[\\s\\S]{10,30}componentDidMount"],"vulnerabilities":[{"atOrAbove":"1.0.0","below":"2.4.1","severity":"high","ids":["CVE-2017-16877","GHSA-3f5c-4qxj-vmpf"]},{"atOrAbove":"1.0.0","below":"4.2.3","severity":"high","ids":["CVE-2018-6184","GHSA-m34x-wgrh-g897"]},{"atOrAbove":"0.9.9","below":"5.1.0","severity":"high","ids":["GHSA-5vj8-3v2h-h38v"]},{"atOrAbove":"7.0.0","below":"7.0.2","severity":"medium","ids":["CVE-2018-18282","GHSA-qw96-mm2g-c8m7"]},{"atOrAbove":"0.9.9","below":"9.3.2","severity":"medium","ids":["CVE-2020-5284","GHSA-fq77-7p7r-83rj"]},{"atOrAbove":"9.5.0","below":"9.5.4","severity":"medium","ids":["CVE-2020-15242","GHSA-x56p-c8cg-q435"]},{"atOrAbove":"0.9.9","below":"11.1.0","severity":"medium","ids":["CVE-2021-37699","GHSA-vxf5-wxwp-m7g9"]},{"atOrAbove":"10.0.0","below":"11.1.1","severity":"high","ids":["CVE-2021-39178","GHSA-9gr3-7897-pp7m"]},{"atOrAbove":"0.9.9","below":"11.1.3","severity":"high","ids":["CVE-2021-43803","GHSA-25mp-g6fv-mqxx"]},{"atOrAbove":"12.0.0","below":"12.0.5","severity":"high","ids":["CVE-2021-43803","GHSA-25mp-g6fv-mqxx"]},{"atOrAbove":"12.0.0","below":"12.0.9","severity":"medium","ids":["CVE-2022-21721","GHSA-wr66-vrwm-5g5x"]},{"atOrAbove":"10.0.0","below":"12.1.0","severity":"medium","ids":["CVE-2022-23646","GHSA-fmvm-x8mv-47mj"]},{"atOrAbove":"12.2.3","below":"12.2.4","severity":"medium","ids":["CVE-2022-36046","GHSA-wff4-fpwg-qqv3"]},{"atOrAbove":"12.0.0","below":"12.3.5","severity":"high","ids":["CVE-2025-29927","GHSA-f82v-jwr5-mffw"]},{"atOrAbove":"12.3.5","below":"12.3.6","severity":"low","ids":["CVE-2025-30218","GHSA-223j-4rm8-mrmf"]},{"atOrAbove":"0.9.9","below":"13.4.20-canary.13","severity":"low","ids":["CVE-2023-46298","GHSA-c59h-r6p8-q9wc"]},{"atOrAbove":"13.3.1","below":"13.5.0","severity":"high","ids":["CVE-2024-39693","GHSA-fq54-2j52-jc42"]},{"atOrAbove":"13.4.0","below":"13.5.1","severity":"high","ids":["CVE-2024-34350","GHSA-77r5-gw3j-2mpf"]},{"atOrAbove":"13.5.1","below":"13.5.7","severity":"high","ids":["CVE-2024-46982","GHSA-gp8f-8m3g-qvj9"]},{"atOrAbove":"13.0.0","below":"13.5.8","severity":"medium","ids":["CVE-2024-56332","GHSA-7m27-7ghc-44w9"]},{"atOrAbove":"13.0.0","below":"13.5.9","severity":"high","ids":["CVE-2025-29927","GHSA-f82v-jwr5-mffw"]},{"atOrAbove":"13.5.9","below":"13.5.10","severity":"low","ids":["CVE-2025-30218","GHSA-223j-4rm8-mrmf"]},{"atOrAbove":"13.4.0","below":"14.1.1","severity":"high","ids":["CVE-2024-34351","GHSA-fr5h-rqp8-mj6g"]},{"atOrAbove":"10.0.0","below":"14.2.7","severity":"medium","ids":["CVE-2024-47831","GHSA-g77x-44xx-532m"]},{"atOrAbove":"14.0.0","below":"14.2.10","severity":"high","ids":["CVE-2024-46982","GHSA-gp8f-8m3g-qvj9"]},{"atOrAbove":"9.5.5","below":"14.2.15","severity":"high","ids":["CVE-2024-51479","GHSA-7gfc-8cq8-jh5f"]},{"atOrAbove":"14.0.0","below":"14.2.21","severity":"medium","ids":["CVE-2024-56332","GHSA-7m27-7ghc-44w9"]},{"atOrAbove":"0.9.9","below":"14.2.24","severity":"low","ids":["CVE-2025-32421","GHSA-qpjv-v59x-3qc4"]},{"atOrAbove":"14.0.0","below":"14.2.25","severity":"high","ids":["CVE-2025-29927","GHSA-f82v-jwr5-mffw"]},{"atOrAbove":"14.2.25","below":"14.2.26","severity":"low","ids":["CVE-2025-30218","GHSA-223j-4rm8-mrmf"]},{"atOrAbove":"13.0","below":"14.2.30","severity":"low","ids":["CVE-2025-48068","GHSA-3h52-269p-cp9r"]},{"atOrAbove":"0.9.9","below":"14.2.31","severity":"medium","ids":["CVE-2025-57752","GHSA-g5qg-72qw-gw5v"]},{"atOrAbove":"0.9.9","below":"14.2.31","severity":"medium","ids":["CVE-2025-55173","GHSA-xv57-4mr9-wg8v"]},{"atOrAbove":"0.9.9","below":"14.2.32","severity":"medium","ids":["CVE-2025-57822","GHSA-4342-x723-ch2f"]},{"atOrAbove":"13.3.0","below":"14.2.34","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"13.3.1-canary.0","below":"14.2.35","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.0.0-canary.0","below":"15.0.0-canary.206","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.1-canary.0","below":"15.0.1-canary.4","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.2-canary.0","below":"15.0.2-canary.12","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.3-canary.0","below":"15.0.3-canary.10","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.4-canary.0","below":"15.0.4-canary.53","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"14.3.0-canary.77","below":"15.0.5","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.0.0-canary.0","below":"15.0.6","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.0.0-canary.0","below":"15.0.6","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.0.6","below":"15.0.7","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"13.0.0","below":"15.0.8","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"15.1.1-canary.0","below":"15.1.1-canary.28","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.0","below":"15.1.2","severity":"medium","ids":["CVE-2024-56332","GHSA-7m27-7ghc-44w9"]},{"atOrAbove":"15.0.0","below":"15.1.6","severity":"low","ids":["CVE-2025-32421","GHSA-qpjv-v59x-3qc4"]},{"atOrAbove":"15.0.4-canary.51","below":"15.1.8","severity":"high","ids":["CVE-2025-49826","GHSA-67rr-84xm-4c7r"]},{"atOrAbove":"15.1.0-canary.0","below":"15.1.9","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.1.1-canary.0","below":"15.1.10","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.1.1-canary.0","below":"15.1.10","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.1.10","below":"15.1.11","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.1.1-canary.0","below":"15.1.12","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"15.2.0-canary.0","below":"15.2.0-canary.78","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.2.1-canary.0","below":"15.2.1-canary.7","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.0","below":"15.2.2","severity":"low","ids":["CVE-2025-48068","GHSA-3h52-269p-cp9r"]},{"atOrAbove":"15.2.2-canary.0","below":"15.2.2-canary.8","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.0","below":"15.2.3","severity":"high","ids":["CVE-2025-29927","GHSA-f82v-jwr5-mffw"]},{"atOrAbove":"15.2.3","below":"15.2.4","severity":"low","ids":["CVE-2025-30218","GHSA-223j-4rm8-mrmf"]},{"atOrAbove":"15.2.0-canary.0","below":"15.2.6","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.2.0-canary.0","below":"15.2.7","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.2.0-canary.0","below":"15.2.7","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.2.7","below":"15.2.8","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.2.0-canary.0","below":"15.2.9","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"15.3.0-canary.0","below":"15.3.0-canary.47","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.3.1-canary.0","below":"15.3.1-canary.16","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.3.0","below":"15.3.3","severity":"low","ids":["CVE-2025-49005","GHSA-r2fc-ccr8-96c4"]},{"atOrAbove":"15.3.0-canary.0","below":"15.3.6","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.3.0-canary.0","below":"15.3.7","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.3.0-canary.0","below":"15.3.7","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.3.7","below":"15.3.8","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.3.0-canary.0","below":"15.3.9","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"15.4.0-canary.0","below":"15.4.0-canary.131","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.4.2-canary.0","below":"15.4.2-canary.57","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.0.0","below":"15.4.5","severity":"medium","ids":["CVE-2025-57752","GHSA-g5qg-72qw-gw5v"]},{"atOrAbove":"15.0.0","below":"15.4.5","severity":"medium","ids":["CVE-2025-55173","GHSA-xv57-4mr9-wg8v"]},{"atOrAbove":"15.0.0-canary.0","below":"15.4.7","severity":"medium","ids":["CVE-2025-57822","GHSA-4342-x723-ch2f"]},{"atOrAbove":"15.4.0-canary.0","below":"15.4.8","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.4.0-canary.0","below":"15.4.9","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.4.0-canary.0","below":"15.4.9","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.4.9","below":"15.4.10","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.4.0-canary.0","below":"15.4.11","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"15.5.1-canary.0","below":"15.5.1-canary.40","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.5.0-canary.0","below":"15.5.7","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"15.5.1-canary.0","below":"15.5.8","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.5.1-canary.0","below":"15.5.8","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.5.8","below":"15.5.9","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"10.0.0","below":"15.5.10","severity":"medium","ids":["CVE-2025-59471","GHSA-9g9p-9gw9-jx7f"]},{"atOrAbove":"15.5.1-canary.0","below":"15.5.10","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"9.5.0","below":"15.5.13","severity":"medium","ids":["CVE-2026-29057","GHSA-ggv3-7p47-pfv8"]},{"atOrAbove":"10.0.0","below":"15.5.14","severity":"medium","ids":["CVE-2026-27980","GHSA-3x4c-7xq6-9pq8"]},{"atOrAbove":"13.0.0","below":"15.5.15","severity":"high","ids":["GHSA-q4gf-8mx6-v5v3"]},{"atOrAbove":"10.0.0","below":"15.5.16","severity":"medium","ids":["CVE-2026-44577","GHSA-h64f-5h5j-jqjh"]},{"atOrAbove":"12.2.0","below":"15.5.16","severity":"high","ids":["CVE-2026-44573","GHSA-36qx-fr4f-26g5"]},{"atOrAbove":"12.2.0","below":"15.5.16","severity":"low","ids":["CVE-2026-44572","GHSA-3g8h-86w9-wvmq"]},{"atOrAbove":"13.0.0","below":"15.5.16","severity":"high","ids":["GHSA-8h8q-6873-q5fj"]},{"atOrAbove":"13.0.0","below":"15.5.16","severity":"medium","ids":["CVE-2026-44580","GHSA-gx5p-jg67-6x7h"]},{"atOrAbove":"13.4.0","below":"15.5.16","severity":"medium","ids":["CVE-2026-44581","GHSA-ffhc-5mcf-pf4q"]},{"atOrAbove":"13.4.6","below":"15.5.16","severity":"low","ids":["CVE-2026-44582","GHSA-vfv6-92ff-j949"]},{"atOrAbove":"13.4.13","below":"15.5.16","severity":"high","ids":["CVE-2026-44578","GHSA-c4j6-fc7j-m34r"]},{"atOrAbove":"14.2.0","below":"15.5.16","severity":"medium","ids":["CVE-2026-44576","GHSA-wfc6-r584-vfw7"]},{"atOrAbove":"15.0.0","below":"15.5.16","severity":"high","ids":["CVE-2026-44579","GHSA-mg66-mrh9-m8jx"]},{"atOrAbove":"15.2.0","below":"15.5.16","severity":"high","ids":["CVE-2026-44575","GHSA-267c-6grr-h53f"]},{"atOrAbove":"15.4.0","below":"15.5.16","severity":"high","ids":["CVE-2026-44574","GHSA-492v-c6pp-mqqv"]},{"atOrAbove":"15.2.0","below":"15.5.18","severity":"high","ids":["CVE-2026-45109","GHSA-26hh-7cqf-hhc6"]},{"atOrAbove":"12.0.0","below":"15.5.21","severity":"high","ids":["CVE-2026-64645","GHSA-p9j2-gv94-2wf4"]},{"atOrAbove":"13.0.0","below":"15.5.21","severity":"medium","ids":["CVE-2026-64647","GHSA-4633-3j49-mh5q"]},{"atOrAbove":"13.0.0","below":"15.5.21","severity":"medium","ids":["CVE-2026-64646","GHSA-4c39-4ccg-62r3"]},{"atOrAbove":"13.0.0","below":"15.5.21","severity":"medium","ids":["CVE-2026-64648","GHSA-68g3-v927-f742"]},{"atOrAbove":"13.0.0","below":"15.5.21","severity":"medium","ids":["CVE-2026-64643","GHSA-955p-x3mx-jcvp"]},{"atOrAbove":"13.0.0","below":"15.5.21","severity":"high","ids":["CVE-2026-64641","GHSA-m99w-x7hq-7vfj"]},{"atOrAbove":"14.1.1","below":"15.5.21","severity":"high","ids":["CVE-2026-64649","GHSA-89xv-2m56-2m9x"]},{"atOrAbove":"15.5.0","below":"15.5.21","severity":"medium","ids":["CVE-2026-64644","GHSA-q8wf-6r8g-63ch"]},{"atOrAbove":"10.0.0","below":"15.5.24","severity":"critical","ids":["GHSA-2xp9-vwfh-vxw4"]},{"atOrAbove":"13.4.0","below":"15.5.24","severity":"critical","ids":["CVE-2026-75604","GHSA-p293-qw3h-jr36"]},{"atOrAbove":"15.0.0","below":"15.5.27","severity":"medium","ids":["CVE-2026-94543","GHSA-4jqv-mc3x-m676"]},{"atOrAbove":"15.0.0","below":"15.5.27","severity":"medium","ids":["CVE-2026-94484","GHSA-mcj8-r9mp-w47p"]},{"atOrAbove":"10.0.0","below":"15.5.28","severity":"critical","ids":["GHSA-2464-fhr4-w9xw"]},{"atOrAbove":"13.0.0","below":"15.5.28","severity":"high","ids":["CVE-2026-94482","GHSA-p3m5-59mp-jv5r"]},{"atOrAbove":"15.6.0-canary.0","below":"15.6.0-canary.59","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"15.6.0-canary.0","below":"15.6.0-canary.59","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"15.6.0-canary.59","below":"15.6.0-canary.60","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.6.0-canary.0","below":"15.6.0-canary.61","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"15.6.0-canary.0","below":"15.6.0-canary.61","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"16.0.0-canary.0","below":"16.0.7","severity":"critical","ids":["GHSA-9qr9-h5gf-34mp"]},{"atOrAbove":"16.0.0-beta.0","below":"16.0.9","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"16.0.0-beta.0","below":"16.0.9","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"16.0.9","below":"16.0.10","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"16.0.0-beta.0","below":"16.0.11","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"16.1.0-canary.0","below":"16.1.0-canary.17","severity":"high","ids":["GHSA-mwv6-3258-q52c"]},{"atOrAbove":"16.1.0-canary.0","below":"16.1.0-canary.17","severity":"medium","ids":["GHSA-w37m-7fhw-fmv9"]},{"atOrAbove":"16.1.0-canary.17","below":"16.1.0-canary.19","severity":"high","ids":["GHSA-5j59-xgg2-r9c4"]},{"atOrAbove":"15.6.0-canary.0","below":"16.1.5","severity":"medium","ids":["CVE-2025-59471","GHSA-9g9p-9gw9-jx7f"]},{"atOrAbove":"16.0.0-beta.0","below":"16.1.5","severity":"medium","ids":["CVE-2025-59472","GHSA-5f7q-jpqc-wp7h"]},{"atOrAbove":"16.1.0-canary.0","below":"16.1.5","severity":"high","ids":["GHSA-h25m-26qc-wcjf"]},{"atOrAbove":"16.0.0-beta.0","below":"16.1.7","severity":"medium","ids":["CVE-2026-27980","GHSA-3x4c-7xq6-9pq8"]},{"atOrAbove":"16.0.0-beta.0","below":"16.1.7","severity":"medium","ids":["CVE-2026-29057","GHSA-ggv3-7p47-pfv8"]},{"atOrAbove":"16.0.1","below":"16.1.7","severity":"medium","ids":["CVE-2026-27979","GHSA-h27x-g6w4-24gq"]},{"atOrAbove":"16.0.1","below":"16.1.7","severity":"low","ids":["CVE-2026-27977","GHSA-jcc7-9wpm-mj36"]},{"atOrAbove":"16.0.1","below":"16.1.7","severity":"medium","ids":["CVE-2026-27978","GHSA-mq59-m269-xvcx"]},{"atOrAbove":"16.0.0-beta.0","below":"16.2.3","severity":"high","ids":["GHSA-q4gf-8mx6-v5v3"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["CVE-2026-44575","GHSA-267c-6grr-h53f"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["CVE-2026-44573","GHSA-36qx-fr4f-26g5"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"low","ids":["CVE-2026-44572","GHSA-3g8h-86w9-wvmq"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["CVE-2026-44574","GHSA-492v-c6pp-mqqv"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["GHSA-8h8q-6873-q5fj"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["CVE-2026-44578","GHSA-c4j6-fc7j-m34r"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"medium","ids":["CVE-2026-44581","GHSA-ffhc-5mcf-pf4q"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"medium","ids":["CVE-2026-44580","GHSA-gx5p-jg67-6x7h"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"medium","ids":["CVE-2026-44577","GHSA-h64f-5h5j-jqjh"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"high","ids":["CVE-2026-44579","GHSA-mg66-mrh9-m8jx"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"low","ids":["CVE-2026-44582","GHSA-vfv6-92ff-j949"]},{"atOrAbove":"16.0.0","below":"16.2.5","severity":"medium","ids":["CVE-2026-44576","GHSA-wfc6-r584-vfw7"]},{"atOrAbove":"16.0.0","below":"16.2.6","severity":"high","ids":["CVE-2026-45109","GHSA-26hh-7cqf-hhc6"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"medium","ids":["CVE-2026-64647","GHSA-4633-3j49-mh5q"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"medium","ids":["CVE-2026-64646","GHSA-4c39-4ccg-62r3"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"medium","ids":["CVE-2026-64648","GHSA-68g3-v927-f742"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"high","ids":["CVE-2026-64642","GHSA-6gpp-xcg3-4w24"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"high","ids":["CVE-2026-64649","GHSA-89xv-2m56-2m9x"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"medium","ids":["CVE-2026-64643","GHSA-955p-x3mx-jcvp"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"high","ids":["CVE-2026-64641","GHSA-m99w-x7hq-7vfj"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"high","ids":["CVE-2026-64645","GHSA-p9j2-gv94-2wf4"]},{"atOrAbove":"16.0.0","below":"16.2.11","severity":"medium","ids":["CVE-2026-64644","GHSA-q8wf-6r8g-63ch"]},{"atOrAbove":"16.0.0","below":"16.3.3","severity":"critical","ids":["GHSA-2xp9-vwfh-vxw4"]},{"atOrAbove":"16.0.0","below":"16.3.3","severity":"critical","ids":["CVE-2026-75604","GHSA-p293-qw3h-jr36"]},{"atOrAbove":"16.2.0","below":"16.3.6","severity":"critical","ids":["GHSA-vcvr-r3jv-pc5j"]},{"atOrAbove":"16.0.0","below":"16.3.8","severity":"low","ids":["CVE-2026-94486","GHSA-39w2-rjm5-chcv"]},{"atOrAbove":"16.0.0","below":"16.3.8","severity":"medium","ids":["CVE-2026-94543","GHSA-4jqv-mc3x-m676"]},{"atOrAbove":"16.0.0","below":"16.3.8","severity":"high","ids":["CVE-2026-94483","GHSA-cjq9-62q9-8jv4"]},{"atOrAbove":"16.0.0","below":"16.3.8","severity":"medium","ids":["CVE-2026-94485","GHSA-f87g-xv8r-7p7x"]},{"atOrAbove":"16.0.0","below":"16.3.8","severity":"medium","ids":["CVE-2026-94484","GHSA-mcj8-r9mp-w47p"]},{"atOrAbove":"16.3.0","below":"16.3.8","severity":"medium","ids":["CVE-2026-94544","GHSA-3w37-wq28-93x7"]},{"atOrAbove":"16.3.0","below":"16.3.8","severity":"medium","ids":["CVE-2026-103004","GHSA-h694-7cp9-m8p3"]},{"atOrAbove":"16.0.0","below":"16.4.1","severity":"critical","ids":["GHSA-2464-fhr4-w9xw"]},{"atOrAbove":"16.0.0","below":"16.4.1","severity":"critical","ids":["GHSA-673q-mjm6-r5xr"]},{"atOrAbove":"16.0.0","below":"16.4.1","severity":"high","ids":["CVE-2026-94482","GHSA-p3m5-59mp-jv5r"]}]},"pdf.js":{"uri":["/pdf\\.js/(§§version§§)/","/pdfjs-dist@(§§version§§)/"],"filename":[],"filecontent":["(?:const|var) pdfjsVersion = ['\"](§§version§§)['\"];","PDFJS.version ?= ?['\"](§§version§§)['\"]","apiVersion: ?['\"](§§version§§)['\"][\\s\\S]*,data(:[a-zA-Z.]{1,6})?,[\\s\\S]*password(:[a-zA-Z.]{1,10})?,[\\s\\S]*disableAutoFetch(:[a-zA-Z.]{1,22})?,[\\s\\S]*rangeChunkSize","messageHandler\\.sendWithPromise\\(\"GetDocRequest\",\\{docId:[a-zA-Z],apiVersion:\"(§§version§§)\"","const version = ['\"](§§version§§)['\"];\\s*const build ="],"vulnerabilities":[{"atOrAbove":"0","below":"1.10.100","severity":"high","ids":["CVE-2018-5158","GHSA-7jg2-jgv3-fmr4"]},{"atOrAbove":"2.0.0","below":"2.0.550","severity":"high","ids":["CVE-2018-5158","GHSA-7jg2-jgv3-fmr4"]},{"atOrAbove":"0","below":"4.2.67","severity":"high","ids":["CVE-2024-4367","GHSA-wgrm-67xf-hhpq"]},{"atOrAbove":"5.6.83","below":"6.2.108","severity":"high","ids":["CVE-2026-16633","GHSA-hq66-cqwq-w95j"]}]},"pdfobject":{"uri":["/pdfobject@(§§version§§)/","/pdfobject/(§§version§§)/pdfobject(\\.min)?\\.js"],"filename":[],"filecontent":["\\* +PDFObject v(§§version§§)","/*[\\s]+PDFObject v(§§version§§)","let pdfobjectversion = \"(§§version§§)\";","pdfobjectversion:\"(§§version§§)\""],"vulnerabilities":[]},"pendo":{"uri":[],"filename":[],"filecontent":["// Pendo Agent Wrapper\n//[\\s]+Environment:[\\s]+[^\n]+\n// Agent Version:[\\s]+(§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"2.15.18","severity":"medium","ids":["Patched XSS vulnerability around script loading"]}]},"plupload":{"uri":["/(§§version§§)/plupload(\\.min)?\\.js"],"filename":["plupload-(§§version§§)(.min)?\\.js"],"filecontent":["\\* Plupload - multi-runtime File Uploader(?:\r|\n)+ \\* v(§§version§§)","var g=\\{VERSION:\"(§§version§§)\",.*;window.plupload=g\\}"],"vulnerabilities":[{"atOrAbove":null,"below":"1.5.4","severity":"medium","ids":["CVE-2012-2401"]},{"atOrAbove":null,"below":"1.5.5","severity":"medium","ids":["CVE-2013-0237"]},{"atOrAbove":null,"below":"2.1.9","severity":"medium","ids":["CVE-2016-4566"]},{"atOrAbove":null,"below":"2.3.7","severity":"medium","ids":["Fixed security vulnerability by adding die calls to all php files to prevent the"]},{"atOrAbove":null,"below":"2.3.8","severity":"medium","ids":["Fixed a potential security issue with not entity encoding the file names in the "]},{"atOrAbove":null,"below":"2.3.9","severity":"medium","ids":["CVE-2021-23562","GHSA-rp2c-jrgp-cvr8"]},{"atOrAbove":"3.0.0","below":"3.1.3","severity":"medium","ids":["Fixed security vulnerability by adding die calls to all php files to prevent the"]},{"atOrAbove":"3.0.0","below":"3.1.4","severity":"medium","ids":["Fixed a potential security issue with not entity encoding the file names in the "]},{"atOrAbove":"3.0.0","below":"3.1.5","severity":"medium","ids":["Fixed another case of html entities not being encoded that could be exploded by "]}]},"protobufjs":{"uri":["/protobufjs/(§§version§§)/protobuf(?:\\.min)?\\.js"],"filename":["protobuf-(§§version§§)(?:\\.min)?\\.js"],"filecontent":["protobuf\\.js v(§§version§§)"],"vulnerabilities":[{"atOrAbove":"0","below":"5.0.3","severity":"medium","ids":["CVE-2018-3738","GHSA-762f-c2wg-m8c8"]},{"atOrAbove":"6.0.0","below":"6.8.6","severity":"medium","ids":["CVE-2018-3738","GHSA-762f-c2wg-m8c8"]},{"atOrAbove":"6.10.0","below":"6.10.3","severity":"high","ids":["CVE-2022-25878","GHSA-g954-5hwp-pp24"]},{"atOrAbove":"6.11.0","below":"6.11.3","severity":"high","ids":["CVE-2022-25878","GHSA-g954-5hwp-pp24"]},{"atOrAbove":"6.10.0","below":"6.11.4","severity":"critical","ids":["CVE-2023-36665","GHSA-h755-8qp9-cq85"]},{"atOrAbove":"0","below":"6.11.6","severity":"critical","ids":["CVE-2026-41242","GHSA-xq3m-2v4x-88gg"]},{"atOrAbove":"7.0.0","below":"7.2.5","severity":"critical","ids":["CVE-2023-36665","GHSA-h755-8qp9-cq85"]},{"atOrAbove":"7.0.0","below":"7.5.5","severity":"critical","ids":["CVE-2026-41242","GHSA-xq3m-2v4x-88gg"]},{"atOrAbove":"0","below":"7.5.6","severity":"medium","ids":["CVE-2026-44294","GHSA-2pr8-phx7-x9h3"]},{"atOrAbove":"0","below":"7.5.6","severity":"high","ids":["CVE-2026-44293","GHSA-66ff-xgx4-vchm"]},{"atOrAbove":"0","below":"7.5.6","severity":"high","ids":["CVE-2026-44289","GHSA-685m-2w69-288q"]},{"atOrAbove":"0","below":"7.5.6","severity":"high","ids":["CVE-2026-44291","GHSA-75px-5xx7-5xc7"]},{"atOrAbove":"0","below":"7.5.6","severity":"medium","ids":["CVE-2026-44292","GHSA-fx83-v9x8-x52w"]},{"atOrAbove":"0","below":"7.5.6","severity":"high","ids":["CVE-2026-44290","GHSA-jvwf-75h9-cwgg"]},{"atOrAbove":"0","below":"7.5.6","severity":"medium","ids":["CVE-2026-44288","GHSA-q6x5-8v7m-xcrf"]},{"atOrAbove":"0","below":"7.5.8","severity":"medium","ids":["CVE-2026-45740","GHSA-jggg-4jg4-v7c6"]},{"atOrAbove":"0","below":"7.6.1","severity":"high","ids":["CVE-2026-48712","GHSA-wcpc-wj8m-hjx6"]},{"atOrAbove":"0","below":"7.6.3","severity":"medium","ids":["CVE-2026-54269","GHSA-f38q-mgvj-vph7"]},{"atOrAbove":"7.5.0","below":"7.6.5","severity":"medium","ids":["CVE-2026-59877","GHSA-j3f2-48v5-ccww"]},{"atOrAbove":"8.0.0","below":"8.0.1","severity":"critical","ids":["CVE-2026-41242","GHSA-xq3m-2v4x-88gg"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"medium","ids":["CVE-2026-44294","GHSA-2pr8-phx7-x9h3"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"high","ids":["CVE-2026-44293","GHSA-66ff-xgx4-vchm"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"high","ids":["CVE-2026-44289","GHSA-685m-2w69-288q"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"high","ids":["CVE-2026-44291","GHSA-75px-5xx7-5xc7"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"medium","ids":["CVE-2026-44292","GHSA-fx83-v9x8-x52w"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"high","ids":["CVE-2026-44290","GHSA-jvwf-75h9-cwgg"]},{"atOrAbove":"8.0.0","below":"8.0.2","severity":"medium","ids":["CVE-2026-44288","GHSA-q6x5-8v7m-xcrf"]},{"atOrAbove":"8.0.0","below":"8.2.0","severity":"medium","ids":["CVE-2026-45740","GHSA-jggg-4jg4-v7c6"]},{"atOrAbove":"8.0.0","below":"8.4.1","severity":"high","ids":["CVE-2026-48712","GHSA-wcpc-wj8m-hjx6"]},{"atOrAbove":"8.2.0","below":"8.5.0","severity":"medium","ids":["CVE-2026-54270","GHSA-94rc-8x27-4472"]},{"atOrAbove":"8.0.0","below":"8.6.0","severity":"medium","ids":["CVE-2026-54269","GHSA-f38q-mgvj-vph7"]},{"atOrAbove":"8.2.0","below":"8.6.5","severity":"medium","ids":["CVE-2026-59876","GHSA-jfj6-75fj-8934"]},{"atOrAbove":"8.0.0","below":"8.6.6","severity":"medium","ids":["CVE-2026-59877","GHSA-j3f2-48v5-ccww"]}]},"prototypejs":{"uri":["/(§§version§§)/prototype(\\.min)?\\.js"],"filename":["prototype-(§§version§§)(.min)?\\.js"],"filecontent":["Prototype JavaScript framework, version (§§version§§)","Prototype[ ]?=[ ]?\\{[ \r\n\t]*Version:[ ]?(?:'|\")(§§version§§)(?:'|\")"],"vulnerabilities":[{"atOrAbove":null,"below":"1.5.1.2","severity":"high","ids":["CVE-2008-7220"]},{"atOrAbove":"1.6.0","below":"1.6.0.2","severity":"high","ids":["CVE-2008-7220"]},{"atOrAbove":null,"below":"1.7.4","severity":"high","ids":["CVE-2020-27511"]}]},"quill":{"uri":["/(§§version§§)/quill(?:\\.min)?\\.js"],"filename":["quill-(§§version§§)(?:\\.min)?\\.js"],"filecontent":["Quill Editor v(§§version§§)","static version=\"(§§version§§)\";static imports=\\{delta:[^,]{1,20},parchment:"],"vulnerabilities":[{"atOrAbove":"0","below":"1.3.7","severity":"medium","ids":["GHSA-588m-9qg5-35pq"]},{"atOrAbove":"0","below":"1.3.8","severity":"medium","ids":["CVE-2021-3163","GHSA-4943-9vgg-gr5r"]},{"atOrAbove":"2.0.3","below":"2.0.4","severity":"low","ids":["CVE-2025-15056","CVE-2026-120350","GHSA-v3m3-f69x-jf25"]}]},"react":{"uri":[],"filename":[],"filecontent":["/\\*\\*\n +\\* React \\(with addons\\) ?v(§§version§§)","/\\*\\*\n +\\* React v(§§version§§)","/\\*\\* @license React v(§§version§§)[\\s]*\\* react(-jsx-runtime)?\\.","\"\\./ReactReconciler\":[0-9]+,\"\\./Transaction\":[0-9]+,\"fbjs/lib/invariant\":[0-9]+\\}\\],[0-9]+:\\[function\\(require,module,exports\\)\\{\"use strict\";module\\.exports=\"(§§version§§)\"\\}","ReactVersion\\.js[\\*! \\\\/\n\r]{0,100}function\\(e,t\\)\\{\"use strict\";e\\.exports=\"(§§version§§)\"","expected a ReactNode.[\\s\\S]{0,1800}?function\\(e,t\\)\\{\"use strict\";e\\.exports=\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":"0.4.0","below":"0.4.2","severity":"medium","ids":["CVE-2013-7035","GHSA-g53w-52xc-2j85"]},{"atOrAbove":"0.5.0","below":"0.5.2","severity":"medium","ids":["CVE-2013-7035","GHSA-g53w-52xc-2j85"]},{"atOrAbove":"0.0.1","below":"0.14.0","severity":"high","ids":["GHSA-hg79-j56m-fxgv"]},{"atOrAbove":"16.0.0","below":"16.0.1","severity":"medium","ids":["CVE-2018-6341"]},{"atOrAbove":"16.1.0","below":"16.1.2","severity":"medium","ids":["CVE-2018-6341"]},{"atOrAbove":"16.2.0","below":"16.2.1","severity":"medium","ids":["CVE-2018-6341"]},{"atOrAbove":"16.3.0","below":"16.3.3","severity":"medium","ids":["CVE-2018-6341"]},{"atOrAbove":"16.4.0","below":"16.4.2","severity":"medium","ids":["CVE-2018-6341"]}]},"react-dom":{"uri":["/react-dom@(§§version§§)/","/react-dom/(§§version§§)/"],"filename":[],"filecontent":["version:\"(§§version§§)[a-z0-9\\-]*\"[\\s,]*rendererPackageName:\"react-dom\"","/\\*\\* @license React v(§§version§§)[\\s]*\\* react-dom\\.","return[\\s]+ReactSharedInternals.[a-zA-Z].useHostTransitionStatus\\(\\)[;]?[\\s]*\\}[;,][\\s]*exports.version[\\s]*=[\\s]*\"(§§version§§)\""],"vulnerabilities":[{"atOrAbove":"16.0.0","below":"16.0.1","severity":"medium","ids":["CVE-2018-6341","GHSA-mvjj-gqq2-p4hw"]},{"atOrAbove":"16.1.0","below":"16.1.2","severity":"medium","ids":["CVE-2018-6341","GHSA-mvjj-gqq2-p4hw"]},{"atOrAbove":"16.2.0","below":"16.2.1","severity":"medium","ids":["CVE-2018-6341","GHSA-mvjj-gqq2-p4hw"]},{"atOrAbove":"16.3.0","below":"16.3.3","severity":"medium","ids":["CVE-2018-6341","GHSA-mvjj-gqq2-p4hw"]},{"atOrAbove":"16.4.0","below":"16.4.2","severity":"medium","ids":["CVE-2018-6341","GHSA-mvjj-gqq2-p4hw"]}]},"react-is":{"uri":[],"filename":[],"filecontent":["/\\*\\* @license React v(§§version§§)[\\s]*\\* react-is\\."],"vulnerabilities":[]},"scheduler":{"uri":[],"filename":[],"filecontent":["/\\*\\* @license React v(§§version§§)[\\s]*\\* scheduler\\."],"vulnerabilities":[]},"select2":{"uri":["(§§version§§)/(js/)?select2(.min)?\\.js"],"filename":[],"filecontent":["/\\*!(?:[\\s]+\\*)? Select2 (§§version§§)","/\\*[\\s]+Copyright 20[0-9]{2} [I]gor V[a]ynberg[\\s]+Version: (§§version§§)[\\s\\S]{1,5000}(\\.attr\\(\"class\",\"select2-sizer\"|\\.data\\(document, *\"select2-lastpos\"|document\\)\\.data\\(\"select2-lastpos\"|SingleSelect2, *MultiSelect2|window.Select2 *!== *undefined)"],"vulnerabilities":[{"atOrAbove":"0","below":"4.0.6","severity":"medium","ids":["CVE-2016-10744","GHSA-rf66-hmqf-q3fc"]}]},"sessvars":{"uri":[],"filename":["sessvars-(§§version§§)(.min)?\\.js"],"filecontent":["sessvars ver (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"1.01","severity":"low","ids":["Unsanitized data passed to eval()"]}]},"svelte":{"uri":["/svelte@(§§version§§)/"],"filename":["svelte[@\\-](§§version§§)(.min)?\\.m?js"],"filecontent":["generated by Svelte v\\$\\{['\"](§§version§§)['\"]\\}","generated by Svelte v(§§version§§) \\*/","version: '(§§version§§)' [\\s\\S]{80,200}'SvelteDOMInsert'","VERSION = '(§§version§§)'[\\s\\S]{21,200}parse\\$[0-9][\\s\\S]{10,80}preprocess","var version\\$[0-9] = \"(§§version§§)\";[\\s\\S]{10,30}normalizeOptions\\(options\\)[\\s\\S]{80,200}'SvelteComponent.html'"],"vulnerabilities":[{"atOrAbove":null,"below":"2.9.8","severity":"medium","ids":["XSS"]},{"atOrAbove":null,"below":"3.46.5","severity":"medium","ids":["XSS"]},{"atOrAbove":null,"below":"3.49.0","severity":"medium","ids":["CVE-2022-25875","GHSA-wv8q-r932-8hc7"]},{"atOrAbove":"3.0.0","below":"3.59.2","severity":"high","ids":["GHSA-gw32-9rmw-qwww"]},{"atOrAbove":null,"below":"4.2.19","severity":"medium","ids":["CVE-2024-45047","GHSA-8266-84wp-wv5c"]},{"atOrAbove":"5.46.0","below":"5.46.4","severity":"medium","ids":["CVE-2025-15265","GHSA-6738-r8g5-qwp3"]},{"atOrAbove":"0","below":"5.51.5","severity":"medium","ids":["CVE-2026-27125","GHSA-crpf-4hrx-3jrp"]},{"atOrAbove":"0","below":"5.51.5","severity":"medium","ids":["CVE-2026-27121","GHSA-f7gr-6p89-r883"]},{"atOrAbove":"0","below":"5.51.5","severity":"medium","ids":["CVE-2026-27122","GHSA-m56q-vw4c-c2cp"]},{"atOrAbove":"5.39.3","below":"5.51.5","severity":"medium","ids":["CVE-2026-27119","GHSA-h7h7-mm68-gmrc"]},{"atOrAbove":"0","below":"5.53.5","severity":"medium","ids":["CVE-2026-27901","GHSA-phwv-c562-gvmh"]},{"atOrAbove":"5.53.0","below":"5.53.5","severity":"medium","ids":["CVE-2026-27902","GHSA-qgvg-pr8v-6rr3"]},{"atOrAbove":"0","below":"5.55.7","severity":"medium","ids":["CVE-2026-42599","GHSA-pr6f-5x2q-rwfp"]},{"atOrAbove":"0","below":"5.55.7","severity":"medium","ids":["CVE-2026-42573","GHSA-rcqx-6q8c-2c42"]},{"atOrAbove":"5.46.0","below":"5.55.7","severity":"medium","ids":["GHSA-f3cj-j4f6-wq85"]},{"atOrAbove":"5.51.5","below":"5.55.7","severity":"medium","ids":["CVE-2026-42567","GHSA-9rmh-mm8f-r9h6"]}]},"swfobject":{"uri":[],"filename":["swfobject_(§§version§§)(.min)?\\.js"],"filecontent":["SWFObject v(§§version§§) "],"vulnerabilities":[{"atOrAbove":null,"below":"2.1","severity":"medium","ids":["DOM-based XSS"]}]},"swiper":{"uri":["/[Ss]wiper[@/](§§version§§)/swiper"],"filename":["swiper[-.](§§version§§)(.min)?.js"],"filecontent":["\\* Swiper (§§version§§)"],"vulnerabilities":[{"atOrAbove":"0","below":"6.5.1","severity":"critical","ids":["CVE-2021-23370","GHSA-p3hc-fv2j-rp68"]},{"atOrAbove":"6.5.1","below":"12.1.2","severity":"critical","ids":["CVE-2026-27212","GHSA-hmx5-qpq5-p643"]}]},"tableexport.jquery.plugin":{"uri":["/tableexport.jquery.plugin@(§§version§§)/tableExport.min.js","/TableExport/(§§version§§)/js/tableexport.min.js"],"filename":[],"filecontent":["/\\*[\\s]+tableExport.jquery.plugin[\\s]+Version (§§version§§)","/\\*![\\s]+\\* TableExport.js v(§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"1.25.0","severity":"medium","ids":["CVE-2022-1291","GHSA-j636-crp3-m584"]}]},"threejs":{"uri":["/three.js/(§§version§§)/","/three.js@(§§version§§)/"],"filename":[],"filecontent":[],"vulnerabilities":[{"atOrAbove":"0","below":"0.125.0","severity":"high","ids":["CVE-2020-28496","GHSA-fq6p-x6j3-cmmq"]}]},"tinyMCE":{"uri":["/tinymce/(§§version§§)/tinymce(\\.min)?\\.js"],"filename":[],"filecontent":["// (§§version§§) \\([0-9\\-]+\\)[\n\r]+.{0,1200}l=.tinymce/geom/Rect.","/\\*\\*[\\s]*\\* TinyMCE version (§§version§§)"],"vulnerabilities":[{"atOrAbove":null,"below":"1.4.2","severity":"high","ids":["CVE-2011-4825"]},{"atOrAbove":null,"below":"4.2.0","severity":"medium","ids":["FIXED so script elements gets removed by default to prevent possible XSS issues "]},{"atOrAbove":null,"below":"4.2.4","severity":"medium","ids":["xss issues with media plugin not properly filtering out some script attributes."]},{"atOrAbove":null,"below":"4.7.12","severity":"medium","ids":["FIXED so links with xlink:href attributes are filtered correctly to prevent XSS."]},{"atOrAbove":null,"below":"4.9.7","severity":"high","ids":["CVE-2020-17480","GHSA-27gm-ghr9-4v95"]},{"atOrAbove":null,"below":"4.9.10","severity":"medium","ids":["CVE-2019-1010091","GHSA-c78w-2gw7-gjv3"]},{"atOrAbove":null,"below":"4.9.11","severity":"medium","ids":["CVE-2020-12648","GHSA-vrv8-v4w8-f95h"]},{"atOrAbove":"5.0.0","below":"5.1.4","severity":"high","ids":["CVE-2020-17480","GHSA-27gm-ghr9-4v95"]},{"atOrAbove":null,"below":"5.1.6","severity":"medium","ids":["CDATA parsing and sanitization has been improved to address a cross-site scripti"]},{"atOrAbove":null,"below":"5.2.2","severity":"low","ids":["media embed content not processing safely in some cases."]},{"atOrAbove":"5.0.0","below":"5.2.2","severity":"medium","ids":["CVE-2019-1010091","GHSA-c78w-2gw7-gjv3"]},{"atOrAbove":null,"below":"5.4.0","severity":"low","ids":["content in an iframe element parsing as DOM elements instead of text content."]},{"atOrAbove":"5.0.0","below":"5.4.1","severity":"medium","ids":["CVE-2020-12648","GHSA-vrv8-v4w8-f95h"]},{"atOrAbove":null,"below":"5.6.0","severity":"low","ids":["GHSA-h96f-fc7c-9r55"]},{"atOrAbove":null,"below":"5.6.0","severity":"medium","ids":["CVE-2024-21911","GHSA-w7jx-j77m-wp65"]},{"atOrAbove":null,"below":"5.7.1","severity":"medium","ids":["GHSA-5vm8-hhgr-jcjp"]},{"atOrAbove":null,"below":"5.9.0","severity":"medium","ids":["CVE-2024-21908","GHSA-5h9g-x5rv-25wg"]},{"atOrAbove":null,"below":"5.10.0","severity":"medium","ids":["CVE-2024-21910","GHSA-r8hm-w5f7-wj39"]},{"atOrAbove":null,"below":"5.10.7","severity":"medium","ids":["CVE-2022-23494","GHSA-gg8r-xjwq-4w92"]},{"atOrAbove":null,"below":"5.10.8","severity":"medium","ids":["CVE-2023-45819","GHSA-hgqx-r2hp-jr38"]},{"atOrAbove":null,"below":"5.10.8","severity":"medium","ids":["CVE-2023-45818","GHSA-v65r-p3vv-jjfv"]},{"atOrAbove":"0","below":"5.10.9","severity":"medium","ids":["CVE-2023-48219","GHSA-v626-r774-j7f8"]},{"atOrAbove":"0","below":"5.10.10","severity":"high","ids":["CVE-2026-47759","GHSA-q742-qvgc-gc2f"]},{"atOrAbove":"0","below":"5.10.10","severity":"high","ids":["CVE-2026-47762","GHSA-v98h-vmpc-fpqv"]},{"atOrAbove":"0","below":"5.10.10","severity":"high","ids":["CVE-2026-47761","GHSA-vg35-5wq7-3x7w"]},{"atOrAbove":"0","below":"5.11.0","severity":"medium","ids":["CVE-2024-38356","GHSA-9hcv-j9pv-qmph"]},{"atOrAbove":"0","below":"5.11.0","severity":"medium","ids":["CVE-2024-38357","GHSA-w9jx-4g6g-rp7x"]},{"atOrAbove":"6.0.0","below":"6.3.1","severity":"medium","ids":["CVE-2022-23494","GHSA-gg8r-xjwq-4w92"]},{"atOrAbove":"6.0.0","below":"6.7.1","severity":"medium","ids":["CVE-2023-45819","GHSA-hgqx-r2hp-jr38"]},{"atOrAbove":"6.0.0","below":"6.7.1","severity":"medium","ids":["CVE-2023-45818","GHSA-v65r-p3vv-jjfv"]},{"atOrAbove":"6.0.0","below":"6.7.3","severity":"medium","ids":["CVE-2023-48219","GHSA-v626-r774-j7f8"]},{"atOrAbove":"0","below":"6.8.1","severity":"medium","ids":["CVE-2024-29203","GHSA-438c-3975-5x3f"]},{"atOrAbove":"6.0.0","below":"6.8.4","severity":"medium","ids":["CVE-2024-38356","GHSA-9hcv-j9pv-qmph"]},{"atOrAbove":"6.0.0","below":"6.8.4","severity":"medium","ids":["CVE-2024-38357","GHSA-w9jx-4g6g-rp7x"]},{"atOrAbove":"0","below":"7.0.0","severity":"medium","ids":["CVE-2024-29881","GHSA-5359-pvf2-pw78"]},{"atOrAbove":"6.8.0","below":"7.1.0","severity":"high","ids":["CVE-2026-47760","GHSA-mh5m-5hw4-5c69"]},{"atOrAbove":"7.0.0","below":"7.2.0","severity":"medium","ids":["CVE-2024-38356","GHSA-9hcv-j9pv-qmph"]},{"atOrAbove":"7.0.0","below":"7.2.0","severity":"medium","ids":["CVE-2024-38357","GHSA-w9jx-4g6g-rp7x"]},{"atOrAbove":"6.0.0","below":"7.9.3","severity":"high","ids":["CVE-2026-47759","GHSA-q742-qvgc-gc2f"]},{"atOrAbove":"6.0.0","below":"7.9.3","severity":"high","ids":["CVE-2026-47762","GHSA-v98h-vmpc-fpqv"]},{"atOrAbove":"6.0.0","below":"7.9.3","severity":"high","ids":["CVE-2026-47761","GHSA-vg35-5wq7-3x7w"]},{"atOrAbove":"7.9.3","below":"7.9.4","severity":"high","ids":["CVE-2026-116675","GHSA-mf2p-h6hf-fcwm"]},{"atOrAbove":"8.0.0","below":"8.5.1","severity":"high","ids":["CVE-2026-47759","GHSA-q742-qvgc-gc2f"]},{"atOrAbove":"8.0.0","below":"8.5.1","severity":"high","ids":["CVE-2026-47762","GHSA-v98h-vmpc-fpqv"]},{"atOrAbove":"8.0.0","below":"8.5.1","severity":"high","ids":["CVE-2026-47761","GHSA-vg35-5wq7-3x7w"]},{"atOrAbove":"8.5.1","below":"8.9.3","severity":"high","ids":["CVE-2026-116675","GHSA-mf2p-h6hf-fcwm"]}]},"ua-parser-js":{"uri":["/(§§version§§)/ua-parser(.min)?.js","/ua-parser-js@(§§version§§)/"],"filename":[],"filecontent":["/\\* UAParser.js v(§§version§§)","/\\*[*!](?:@license)?[\\s]+\\* UAParser.js v(§§version§§)","// UAParser.js v(§§version§§)",".\\.VERSION=\"(§§version§§)\",.\\.BROWSER=\\{NAME:.,MAJOR:\"major\",VERSION:.\\},.\\.CPU=\\{ARCHITECTURE:",".\\.VERSION=\"(§§version§§)\",.\\.BROWSER=.\\(\\[[^\\]]{1,20}\\]\\),.\\.CPU=","LIBVERSION=\"(§§version§§)\",EMPTY=\"\",UNKNOWN=\"\\?\",FUNC_TYPE=\"function\",UNDEF_TYPE=\"undefined\"",".=\"(§§version§§)\",.=\"\",.=\"\\?\",.=\"function\",.=\"undefined\",.=\"object\",(.=\"string\",)?.=\"major\",.=\"model\",.=\"name\",.=\"type\",.=\"vendor\""],"vulnerabilities":[{"atOrAbove":"0","below":"0.7.22","severity":"high","ids":["CVE-2020-7733","GHSA-662x-fhqg-9p8v"]},{"atOrAbove":"0","below":"0.7.22","severity":"high","ids":["CVE-2020-7733","GHSA-662x-fhqg-9p8v"]},{"atOrAbove":"0","below":"0.7.23","severity":"high","ids":["CVE-2020-7793","GHSA-394c-5j6w-4xmx"]},{"atOrAbove":"0.7.14","below":"0.7.24","severity":"high","ids":["CVE-2021-27292","GHSA-78cj-fxph-m83p"]},{"atOrAbove":"0.7.29","below":"0.7.30","severity":"high","ids":["CVE-2021-4229","GHSA-pjwm-rvh2-c87w"]},{"atOrAbove":"0.7.30","below":"0.7.33","severity":"high","ids":["CVE-2022-25927","GHSA-fhg7-m89q-25r3"]},{"atOrAbove":"0.8.0","below":"0.8.1","severity":"high","ids":["CVE-2021-4229","GHSA-pjwm-rvh2-c87w"]},{"atOrAbove":"1.0.0","below":"1.0.1","severity":"high","ids":["CVE-2021-4229","GHSA-pjwm-rvh2-c87w"]},{"atOrAbove":"0.8.0","below":"1.0.33","severity":"high","ids":["CVE-2022-25927","GHSA-fhg7-m89q-25r3"]},{"atOrAbove":"2.0.1","below":"2.0.10","severity":"medium","ids":["CVE-2026-48125","GHSA-9h5v-pfqq-x599"]}]},"underscore.js":{"uri":["/underscore\\.js/(§§version§§)/underscore(-min)?\\.js"],"filename":[],"filecontent":["//[\\s]*Underscore.js (§§version§§)","// *Underscore\\.js[\\s\\S]{1,2500}_\\.VERSION *= *['\"](§§version§§)['\"]"],"vulnerabilities":[{"atOrAbove":"1.3.2","below":"1.12.1","severity":"high","ids":["CVE-2021-23358","GHSA-cf4h-3jhx-xvhq"]},{"atOrAbove":"0","below":"1.13.8","severity":"high","ids":["CVE-2026-27601","GHSA-qpx9-hpmf-5gmw"]}]},"video.js":{"uri":["/video\\.js[@/](§§version§§)/"],"filename":["video\\.js[-.](§§version§§)(\\.min)?\\.js"],"filecontent":["\\* Video\\.js (§§version§§)","\\.videojs=[a-zA-Z]\\(\\)\\}\\(this,function\\(\\)\\{var [a-zA-Z]=[\"'](§§version§§)[\"']","[\"']The element or ID supplied is not valid. \\(videojs\\)[\"']\\)[\\s\\S]{100,400}var (?:[a-zA-Z]{1,2},)?[a-zA-Z]{1,2}=[\"'](§§version§§)[\"']"],"vulnerabilities":[{"atOrAbove":"0","below":"7.14.3","severity":"medium","ids":["CVE-2021-23414","GHSA-pp7m-6j83-m7r6"]}]},"vue":{"uri":["/vue@(§§version§§)/dist/vue\\.js","/vue/(§§version§§)/vue\\..*\\.js","/npm/vue@(§§version§§)"],"filename":["vue-(§§version§§)(\\.min)?\\.js"],"filecontent":["/\\*!\\n \\* Vue.js v(§§version§§)","/\\*\\*?!?\\n ?\\* vue v(§§version§§)","Vue.version = '(§§version§§)';","'(§§version§§)'[^\\n]{0,8000}Vue compiler","\\* Original file: /npm/vue@(§§version§§)/dist/vue.(global|common).js","const version[ ]*=[ ]*\"(§§version§§)\";[\\s]*/\\*\\*[\\s]*\\* SSR utils for \\\\@vue/server-renderer","\\.__vue_app__=.{0,8000}?const [a-z]+=\"(§§version§§)\",","let [A-Za-z]+=\"(§§version§§)\",..=\"undefined\"!=typeof window&&window.trustedTypes;if\\(..\\)try\\{.=..\\.createPolicy\\(\"vue\",","isCustomElement.{1,5}?compilerOptions.{0,500}exposeProxy.{0,700}\"(§§version§§)\"","\"(§§version§§)\"[\\s\\S]{0,150}\\.createPolicy\\(\"vue\"","devtoolsFormatters[\\s\\S]{50,180}\"(§§version§§)\"[\\s\\S]{50,180}\\.createElement\\(\"template\"\\)"],"vulnerabilities":[{"atOrAbove":null,"below":"2.4.3","severity":"medium","ids":["possible xss vector"]},{"atOrAbove":null,"below":"2.5.17","severity":"medium","ids":["potential xss in ssr when using v-bind"]},{"atOrAbove":null,"below":"2.6.11","severity":"medium","ids":["Bump vue-server-renderer's dependency of serialize-javascript to 2.1.2"]},{"atOrAbove":"2.0.0-alpha.1","below":"3.0.0-alpha.0","severity":"low","ids":["CVE-2024-9506","GHSA-5j4c-8p2g-v4jx"]}]},"zrender":{"uri":["/zrender[@/](§§version§§)/"],"filename":["zrender[-.](§§version§§)(.min)?.js"],"filecontent":["ssrDataGetter = getter;[\\s]+\\}[\\s]+var version = '(§§version§§)';[\\s]+","painterCtors\\[name\\] = Ctor;[\\s]+\\}[\\s]+var version = '(§§version§§)';[\\s]+",".\\.util=[a-zA-Z_]+,.\\.vector=[a-zA-Z_]+,.\\.version=['\"](§§version§§)['\"],Object"],"vulnerabilities":[{"atOrAbove":"0","below":"4.3.3","severity":"medium","ids":["CVE-2021-39227","GHSA-fhv8-fx5f-7fxf"]},{"atOrAbove":"5.0.0","below":"5.2.1","severity":"medium","ids":["CVE-2021-39227","GHSA-fhv8-fx5f-7fxf"]}]}} diff --git a/crates/devup-access-checker/src/catalog.rs b/crates/devup-access-checker/src/catalog.rs index 9c498ca..7a1bbb1 100644 --- a/crates/devup-access-checker/src/catalog.rs +++ b/crates/devup-access-checker/src/catalog.rs @@ -1549,6 +1549,16 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Accessibility, "summary 의 display 변경", ), + ( + "accessibility.statement_feedback", + Accessibility, + "접근성 성명 피드백 수단 (메일·전화·양식)", + ), + ( + "accessibility.definition_list_duplicate_terms", + Accessibility, + "같은 dl 안에서 반복된 dt", + ), ("trust.privacy_policy", Trust, "개인정보처리방침 링크"), ("trust.terms", Trust, "이용약관 링크"), ("trust.phone", Trust, "전화번호 링크 (tel:)"), @@ -1776,6 +1786,16 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Security, "인라인 이벤트 핸들러 (onclick 등)", ), + ( + "security.cors_reflects_origin_credentials", + Security, + "CORS Origin 반사 + 자격증명 허용", + ), + ( + "security.vulnerable_js_libraries", + Security, + "알려진 취약 버전 JS 라이브러리", + ), ( "performance.static_asset_cache", Performance, @@ -1853,6 +1873,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Crawling, "검색 크롤러 UA 응답 (daum)", ), + ( + "crawling.ua_access.googlebot_smartphone", + Crawling, + "검색 크롤러 UA 응답 (googlebot_smartphone)", + ), ("crawling.feed_valid", Crawling, "피드 형식 유효 (RSS·Atom)"), ("crawling.feed_items", Crawling, "피드 item 수"), ( @@ -1994,6 +2019,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ "조건부 요청 304 지원", ), ("crawling.rel_next_prev", Crawling, "rel=next·prev"), + ( + "crawling.dynamic_serving_without_vary", + Crawling, + "UA 별 다른 HTML 인데 Vary: User-Agent 없음", + ), ("geo.question_headings", Geo, "질문형 헤딩 (h2~h4)"), ("geo.lists", Geo, "목록 (항목 2개 이상 ul/ol, dl)"), ("geo.tables", Geo, "표"), @@ -2209,6 +2239,21 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Meta, "link·script 뒤에 온 base (또는 base 여러 개)", ), + ( + "meta.mobile_alternate_mismatch", + Meta, + "별도 모바일 URL 과 메타 불일치", + ), + ( + "meta.apple_touch_icon_spec", + Meta, + "apple-touch-icon PNG 180×180", + ), + ( + "meta.manifest_icon_size_mismatch", + Meta, + "manifest 아이콘의 선언 크기와 실제 크기 불일치", + ), ( "structured_data.hreflang_reciprocal", StructuredData, @@ -2518,6 +2563,11 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Performance, "레거시 JS (Babel 변환·폴리필 흔적)", ), + ( + "performance.html_only_headers", + Performance, + "HTML 이 아닌 응답의 HTML 전용 헤더", + ), ("site.pages_sampled", Site, "표본 페이지 수집"), ("site.failed_pages", Site, "표본 중 2xx 아닌 페이지"), ("site.duplicate_titles", Site, "페이지 간 중복 title"), @@ -2643,6 +2693,21 @@ pub const CATALOG: &[(&str, Category, &str)] = &[ Transport, "JavaScript 가 아닌 Content-Type 의 JS", ), + ( + "transport.http_redirect_not_https_first", + Transport, + "http 가 https 가 아닌 곳으로 먼저 리다이렉트", + ), + ( + "transport.http_redirect_off_host", + Transport, + "http 가 다른 호스트로 먼저 리다이렉트", + ), + ( + "transport.hsts_over_http", + Transport, + "http 응답의 HSTS 헤더 (브라우저가 무시)", + ), ]; /// id 로 카탈로그 위치를 찾는다. diff --git a/crates/devup-access-checker/src/checks.rs b/crates/devup-access-checker/src/checks.rs index c1cc2d4..393b012 100644 --- a/crates/devup-access-checker/src/checks.rs +++ b/crates/devup-access-checker/src/checks.rs @@ -1,5 +1,6 @@ //! 수집한 사실(fact) → `Check` 목록 변환. 네트워크 접근 없음, 점수·판정 없음. +use regex::Regex; use reqwest::header::HeaderMap; use serde_json::{Value, json}; use url::Url; @@ -69,6 +70,10 @@ pub const AI_CRAWLERS: &[(&str, &str, &str)] = &[ /// 실제 User-Agent 로 페이지를 요청해 볼 검색엔진 크롤러 (가이드에 적힌 UA 문자열) pub const SEARCH_USER_AGENTS: &[(&str, &str)] = &[ + ( + "googlebot_smartphone", + "Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5X Build/MMB29P) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Mobile Safari/537.36 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)", + ), ( "yeti", "Mozilla/5.0 (compatible; Yeti/1.1; +https://naver.me/spd)", @@ -250,6 +255,12 @@ pub struct ImageInfo { pub height: Option, } +/// 접근성 성명 페이지 (URL, (상태, 본문 앞부분)) +pub type StatementProbe = (String, Result<(u16, String), String>); + +/// http 첫 응답 (상태, Location, HSTS 헤더 유무) +pub type FirstHop = (u16, Option, bool); + /// (CSS·JS URL, (상태, Content-Encoding)) pub type AssetEncoding = (String, Result<(u16, Option), String>); @@ -268,6 +279,18 @@ pub struct SearchProbes { pub gpc: Option, /// ETag·Last-Modified 조건부 요청 상태. None = 두 헤더가 없음 pub conditional: Option>, + /// 접근성 성명 페이지 (URL, (상태, 본문 앞부분)). None = 링크 없음 또는 수행 안 함 + pub statement: Option, + /// 별도 모바일 URL 페이지. None = 없음 또는 수행 안 함 + pub mobile_alternate: Option<(String, Result)>, + /// 임의 Origin 요청의 (ACAO, ACAC=true). None = 수행 안 함 + pub cors: Option, bool), String>>, + /// http:// 요청의 첫 응답 (상태, Location, HSTS 헤더). None = 수행 안 함 + pub http_first_hop: Option>, + /// apple-touch-icon 이미지. None = 수행 안 함 + pub apple_touch_image: Option>, + /// manifest 에서 가장 크게 선언된 아이콘 (선언 크기, 이미지). None = 해당 없음 + pub manifest_icon: Option<(String, Result)>, /// 압축을 풀지 않고 받은 CSS·JS 표본의 (URL, (상태, Content-Encoding)) pub asset_encodings: Vec, /// 첫 RSS/Atom 피드 본문. None = 피드 링크 없음 또는 수행 안 함 @@ -1567,6 +1590,7 @@ pub fn build(i: &Inputs) -> Vec { google_spec_checks(&mut o, i, &robots); aria_spec_checks(&mut o, i); quality_spec_checks(&mut o, i); + final_spec_checks(&mut o, i); if let Some(site) = i.site { site_checks(&mut o, i, site); } @@ -8375,6 +8399,308 @@ fn quality_spec_checks(o: &mut Out, i: &Inputs) { ); } +/// HTML 문서에만 의미가 있는 헤더 (webhint no-html-only-headers). +const HTML_ONLY_HEADERS: &[&str] = &[ + "content-security-policy", + "x-content-security-policy", + "x-webkit-csp", + "x-ua-compatible", + "x-xss-protection", +]; + +/// 1·2차 대조에서 추가 요청이 필요해 남겨 두었던 항목. +fn final_spec_checks(o: &mut Out, i: &Inputs) { + use Category::*; + let f = i.facts; + let sp = &i.extended.search; + let base = &i.page.final_url; + let list = |v: &[String]| (!v.is_empty()).then(|| json!(v)); + let flag = |b: bool, applicable: bool| { + if applicable { + Presence::from_bool(b) + } else { + Presence::NotApplicable + } + }; + + // ===== 접근성 성명 피드백 수단 (EU 웹 접근성 지침 제7조) ===== + let (p, v) = match &sp.statement { + None => (Presence::NotApplicable, None), + Some((u, Err(e))) => (Presence::Unknown, Some(json!({ "url": u, "error": e }))), + Some((u, Ok((status, body)))) => { + let lower = body.to_lowercase(); + let contact = + lower.contains("mailto:") || lower.contains("tel:") || lower.contains(" Presence::NotApplicable, + Some(Err(_)) => Presence::Unknown, + Some(Ok(probe)) => Presence::from_bool( + probe.3.as_deref().map(str::trim) != f.title.as_deref().map(str::trim) && !vary_ua, + ), + }, + smartphone.and_then(|r| r.as_ref().ok()).map(|p| json!({ "smartphoneTitle": p.3, "desktopTitle": f.title, "varyUserAgent": vary_ua })), + Some("Googlebot 스마트폰 UA 응답의 제목이 다를 때 Vary 헤더 확인".into()), + ); + let (p, v) = match &sp.mobile_alternate { + None => (Presence::NotApplicable, None), + Some((u, Err(e))) => (Presence::Unknown, Some(json!({ "url": u, "error": e }))), + Some((u, Ok(m))) => { + let mut bad: Vec<&str> = Vec::new(); + if m.noindex + != f.meta("robots") + .is_some_and(|r| r.to_ascii_lowercase().contains("noindex")) + { + bad.push("robots noindex 불일치"); + } + if m.title.is_none() != f.title.is_none() { + bad.push("title 유무 불일치"); + } + if m.description.is_none() != f.meta("description").is_none() { + bad.push("description 유무 불일치"); + } + if !m + .canonical + .as_deref() + .and_then(|c| Url::parse(c).ok()) + .is_some_and(|c| same_url(&c, base)) + { + bad.push("모바일 페이지의 canonical 이 이 페이지가 아님"); + } + ( + Presence::from_bool(!bad.is_empty()), + Some(json!({ "url": u, "problems": bad })), + ) + } + }; + o.push( + "meta.mobile_alternate_mismatch", + Meta, + "별도 모바일 URL 과 메타 불일치", + p, + v, + Some("Google 모바일 우선 색인: 같은 robots·메타, 모바일은 데스크톱을 canonical 로".into()), + ); + + // ===== CORS·http 첫 응답 ===== + let (p, v) = match &sp.cors { + None => (Presence::NotApplicable, None), + Some(Err(e)) => (Presence::Unknown, Some(json!(e))), + Some(Ok((acao, creds))) => ( + Presence::from_bool(acao.as_deref() == Some(CORS_PROBE_ORIGIN) && *creds), + Some(json!({ "allowOrigin": acao, "allowCredentials": creds })), + ), + }; + o.push( + "security.cors_reflects_origin_credentials", + Security, + "CORS Origin 반사 + 자격증명 허용", + p, + v, + Some("임의 Origin 요청에 그대로 허용하며 쿠키까지 허용 (Observatory)".into()), + ); + let hop = sp.http_first_hop.as_ref(); + let hop_ok = hop.and_then(|r| r.as_ref().ok()); + let location = hop_ok.and_then(|(_, l, _)| l.as_deref()).and_then(|l| { + Url::parse(&format!("http://{}", base.host_str().unwrap_or_default())) + .ok()? + .join(l) + .ok() + }); + let redirect = hop_ok.is_some_and(|(s, l, _)| (300..400).contains(s) && l.is_some()); + let first = |pred: &dyn Fn(&Url) -> bool| match hop { + None => Presence::NotApplicable, + Some(Err(_)) => Presence::Unknown, + Some(Ok(_)) if !redirect => Presence::NotApplicable, + Some(Ok(_)) => Presence::from_bool(location.as_ref().is_some_and(pred)), + }; + o.push( + "transport.http_redirect_not_https_first", + Transport, + "http 가 https 가 아닌 곳으로 먼저 리다이렉트", + first(&|u| u.scheme() != "https"), + location.as_ref().map(|u| json!(u.as_str())), + Some("Observatory·hstspreload: 첫 리다이렉트는 같은 호스트의 https".into()), + ); + o.push( + "transport.http_redirect_off_host", + Transport, + "http 가 다른 호스트로 먼저 리다이렉트", + first(&|u| u.host_str() != base.host_str()), + location.as_ref().map(|u| json!(u.as_str())), + None, + ); + o.push( + "transport.hsts_over_http", + Transport, + "http 응답의 HSTS 헤더 (브라우저가 무시)", + match hop { + None => Presence::NotApplicable, + Some(Err(_)) => Presence::Unknown, + Some(Ok((_, _, sts))) => Presence::from_bool(*sts), + }, + None, + Some("webhint strict-transport-security".into()), + ); + + // ===== 이미지 실제 크기 ===== + let (p, v) = match &sp.apple_touch_image { + None => (Presence::NotApplicable, None), + Some(Err(e)) => (Presence::Unknown, Some(json!(e))), + Some(Ok(img)) => { + let png = img + .content_type + .as_deref() + .is_some_and(|c| c.contains("png")); + let ok = png && img.width == Some(180) && img.height == Some(180); + ( + Presence::from_bool(ok), + Some( + json!({ "contentType": img.content_type, "width": img.width, "height": img.height }), + ), + ) + } + }; + o.push( + "meta.apple_touch_icon_spec", + Meta, + "apple-touch-icon PNG 180×180", + p, + v, + Some("webhint apple-touch-icons".into()), + ); + let (p, v) = match &sp.manifest_icon { + None => (Presence::NotApplicable, None), + Some((_, Err(e))) => (Presence::Unknown, Some(json!(e))), + Some((declared, Ok(img))) => { + let actual = img.width.zip(img.height).map(|(w, h)| format!("{w}x{h}")); + ( + Presence::from_bool(actual.as_deref() != Some(declared.as_str())), + Some(json!({ "url": img.url, "declared": declared, "actual": actual })), + ) + } + }; + o.push( + "meta.manifest_icon_size_mismatch", + Meta, + "manifest 아이콘의 선언 크기와 실제 크기 불일치", + p, + v, + Some("가장 크게 선언된 아이콘 하나를 받아 확인".into()), + ); + + // ===== HTML 전용 헤더·취약 라이브러리·정의 목록 ===== + let (p, v) = match &i.extended.static_asset { + None => (Presence::NotApplicable, None), + Some((_, Err(e))) => (Presence::Unknown, Some(json!(e))), + Some((u, Ok((_, h)))) => { + let found: Vec = HTML_ONLY_HEADERS + .iter() + .filter(|n| h.contains_key(**n)) + .map(|n| n.to_string()) + .collect(); + ( + Presence::from_bool(!found.is_empty()), + Some(json!({ "url": u, "headers": found })), + ) + } + }; + o.push( + "performance.html_only_headers", + Performance, + "HTML 이 아닌 응답의 HTML 전용 헤더", + p, + v, + Some( + "정적 리소스 표본 기준 (CSP·X-UA-Compatible·X-XSS-Protection 은 HTML 에서만 의미)" + .into(), + ), + ); + let bodies: std::collections::HashMap<&str, String> = i + .extended + .page_weight + .iter() + .flat_map(|w| w.scripts.iter()) + .filter_map(|(u, r)| { + r.as_ref() + .ok() + .map(|s| (u.as_str(), String::from_utf8_lossy(&s.body).into_owned())) + }) + .collect(); + let mut findings: Vec = Vec::new(); + let mut detected: Vec = Vec::new(); + for url in &f.extra.script_urls { + for hit in crate::vulnjs::scan(url, bodies.get(url.as_str()).map(String::as_str)) { + detected.push(format!("{} {}", hit.library, hit.version)); + if !hit.vulnerabilities.is_empty() { + findings.push(json!({ + "library": hit.library, "version": hit.version, "url": hit.url, + "vulnerabilities": hit.vulnerabilities.iter().map(|v| json!({ "severity": v.severity, "ids": v.ids })).collect::>(), + })); + } + } + } + o.push( + "security.vulnerable_js_libraries", + Security, + "알려진 취약 버전 JS 라이브러리", + flag(!findings.is_empty(), !f.extra.script_urls.is_empty()), + Some(json!({ "vulnerable": findings, "detected": detected })), + Some("retire.js 저장소(내장, scripts/update_retire.py 로 갱신)의 URL·파일명·본문 정규식 기준".into()), + ); + o.push( + "accessibility.definition_list_duplicate_terms", + Accessibility, + "같은 dl 안에서 반복된 dt", + Presence::from_bool(!f.quality.duplicate_dt.is_empty()), + list(&f.quality.duplicate_dt), + Some("Nu HTML Checker 경고".into()), + ); +} + +/// CORS 확인에 쓰는 임의 Origin (존재하지 않는 도메인). +pub const CORS_PROBE_ORIGIN: &str = "https://devup-access-checker-cors-probe.invalid"; + fn canonical_hreflang_weight_checks(o: &mut Out, i: &Inputs) { use Category::*; let ext = i.extended; @@ -9820,6 +10146,12 @@ mod tests { gpc: None, conditional: None, asset_encodings: Vec::new(), + statement: None, + mobile_alternate: None, + cors: None, + http_first_hop: None, + apple_touch_image: None, + manifest_icon: None, feed: Some(failed("https://a.com/feed")), bing_site_auth: Some(failed("https://a.com/BingSiteAuth.xml")), not_found_chain: Some(err()), @@ -9872,6 +10204,12 @@ mod tests { gpc: None, conditional: None, asset_encodings: Vec::new(), + statement: None, + mobile_alternate: None, + cors: None, + http_first_hop: None, + apple_touch_image: None, + manifest_icon: None, feed: Some(feed), bing_site_auth: Some(found("https://a.com/BingSiteAuth.xml", "")), not_found_chain: Some(Ok(vec![ @@ -10848,4 +11186,95 @@ mod tests { } assert_eq!(p(&c, "performance.link_header_preload"), Presence::Missing); } + + #[test] + fn final_items_branches() { + let mut fx = Fx::failing(); + let p = |c: &[Check], id: &str| get(c, id).presence; + let html = r#"데스크톱 +
    a
    a
    "#; + fx.page = page("https://a.com/", html); + fx.facts = crate::html::extract(html, &fx.page.final_url); + fx.ai_ua = vec![( + "googlebot_smartphone", + Ok((200, u("https://a.com/"), None, Some("모바일".into()))), + )]; + let s = &mut fx.extended.search; + s.statement = Some(("https://a.com/acc".into(), Err("boom".into()))); + let mut mobile = sample_page(200); + mobile.title = None; + s.mobile_alternate = Some(("https://m.a.com/".into(), Ok(mobile))); + s.cors = Some(Ok((Some(CORS_PROBE_ORIGIN.into()), true))); + s.http_first_hop = Some(Ok((301, Some("http://www.a.com/".into()), true))); + s.apple_touch_image = Some(Err("boom".into())); + s.manifest_icon = Some(("512x512".into(), Err("boom".into()))); + let mut hm = HeaderMap::new(); + hm.insert("x-ua-compatible", "IE=edge".parse().unwrap()); + fx.extended.static_asset = Some(("https://a.com/a.css".into(), Ok((200, hm)))); + let c = fx.run(); + for id in [ + "crawling.dynamic_serving_without_vary", + "meta.mobile_alternate_mismatch", + "security.cors_reflects_origin_credentials", + "transport.http_redirect_not_https_first", + "transport.http_redirect_off_host", + "transport.hsts_over_http", + "performance.html_only_headers", + "accessibility.definition_list_duplicate_terms", + ] { + assert_eq!(p(&c, id), Presence::Present, "{id}"); + } + for id in [ + "accessibility.statement_feedback", + "meta.apple_touch_icon_spec", + "meta.manifest_icon_size_mismatch", + ] { + assert_eq!(p(&c, id), Presence::Unknown, "{id}"); + } + assert_eq!(p(&c, "security.vulnerable_js_libraries"), Presence::Missing); + + let s = &mut fx.extended.search; + s.statement = None; + s.mobile_alternate = Some(("https://m.a.com/".into(), Err("boom".into()))); + s.cors = Some(Err("boom".into())); + s.http_first_hop = Some(Err("boom".into())); + s.apple_touch_image = None; + s.manifest_icon = None; + fx.extended.static_asset = Some(("https://a.com/a.css".into(), Err("boom".into()))); + fx.ai_ua = vec![("googlebot_smartphone", Err("boom".into()))]; + let c = fx.run(); + for id in [ + "meta.mobile_alternate_mismatch", + "security.cors_reflects_origin_credentials", + "transport.http_redirect_off_host", + "transport.hsts_over_http", + "performance.html_only_headers", + "crawling.dynamic_serving_without_vary", + ] { + assert_eq!(p(&c, id), Presence::Unknown, "{id}"); + } + fx.extended.search.mobile_alternate = None; + fx.extended.search.cors = None; + fx.extended.search.http_first_hop = Some(Ok((200, None, false))); + fx.extended.static_asset = None; + fx.ai_ua = Vec::new(); + let c = fx.run(); + for id in [ + "meta.mobile_alternate_mismatch", + "security.cors_reflects_origin_credentials", + "transport.http_redirect_not_https_first", + "performance.html_only_headers", + "crawling.dynamic_serving_without_vary", + "accessibility.statement_feedback", + ] { + assert_eq!(p(&c, id), Presence::NotApplicable, "{id}"); + } + assert_eq!(p(&c, "transport.hsts_over_http"), Presence::Missing); + fx.extended.search.http_first_hop = None; + let c = fx.run(); + assert_eq!( + p(&c, "transport.http_redirect_off_host"), + Presence::NotApplicable + ); + } } diff --git a/crates/devup-access-checker/src/fetch.rs b/crates/devup-access-checker/src/fetch.rs index c77713f..c41aa5e 100644 --- a/crates/devup-access-checker/src/fetch.rs +++ b/crates/devup-access-checker/src/fetch.rs @@ -658,6 +658,54 @@ pub async fn sample_resource( Ok(s) } +/// 리다이렉트를 따라가지 않고 첫 응답의 (상태, Location, HSTS 헤더 유무) 를 본다. +pub async fn first_hop( + ua: &str, + timeout: Duration, + url: &Url, +) -> Result<(u16, Option, bool), String> { + let client = Client::builder() + .user_agent(ua) + .timeout(timeout) + .redirect(Policy::none()) + .build() + .expect("http client"); + let res = send_get(&client, url.as_str()) + .await + .map_err(describe_owned)?; + let h = res.headers(); + Ok(( + res.status().as_u16(), + h.get(reqwest::header::LOCATION) + .and_then(|v| v.to_str().ok()) + .map(str::to_string), + h.contains_key(reqwest::header::STRICT_TRANSPORT_SECURITY), + )) +} + +/// 임의의 Origin 으로 요청해 (Access-Control-Allow-Origin, Allow-Credentials 가 true 인지) 를 본다. +pub async fn cors_probe( + client: &Client, + url: &Url, + origin: &str, +) -> Result<(Option, bool), String> { + let res = client + .get(url.as_str()) + .header(reqwest::header::ORIGIN, origin) + .send() + .await + .map_err(describe_owned)?; + let h = res.headers(); + Ok(( + h.get(reqwest::header::ACCESS_CONTROL_ALLOW_ORIGIN) + .and_then(|v| v.to_str().ok()) + .map(str::to_string), + h.get(reqwest::header::ACCESS_CONTROL_ALLOW_CREDENTIALS) + .and_then(|v| v.to_str().ok()) + .is_some_and(|v| v.trim().eq_ignore_ascii_case("true")), + )) +} + /// 압축을 풀지 않는 클라이언트로 요청해 (상태, Content-Encoding) 을 본다. pub async fn raw_encoding( ua: &str, @@ -1055,6 +1103,42 @@ mod tests { .unwrap(), (200, None) ); + let (_s3, moved) = serve( + "/moved", + ResponseTemplate::new(301) + .insert_header("location", "https://b.com/") + .insert_header("strict-transport-security", "max-age=1") + .insert_header("access-control-allow-origin", "https://o.invalid") + .insert_header("access-control-allow-credentials", "true"), + ) + .await; + assert_eq!( + first_hop("t", Duration::from_secs(5), &moved) + .await + .unwrap(), + (301, Some("https://b.com/".into()), true) + ); + let no_redirect = Client::builder().redirect(Policy::none()).build().unwrap(); + assert_eq!( + cors_probe(&no_redirect, &moved, "https://o.invalid") + .await + .unwrap(), + (Some("https://o.invalid".into()), true) + ); + assert!( + first_hop( + "t", + Duration::from_secs(5), + &Url::parse("http://127.0.0.1:9/").unwrap() + ) + .await + .is_err() + ); + assert!( + cors_probe(&client(), &Url::parse("http://127.0.0.1:9/").unwrap(), "x") + .await + .is_err() + ); let (_s2, gz) = serve( "/gz", ResponseTemplate::new(200).insert_header("content-encoding", "gzip"), diff --git a/crates/devup-access-checker/src/google.rs b/crates/devup-access-checker/src/google.rs index 8a77281..cfc4e8d 100644 --- a/crates/devup-access-checker/src/google.rs +++ b/crates/devup-access-checker/src/google.rs @@ -56,6 +56,8 @@ pub struct GoogleFacts { pub itunes_meta_outside_head: bool, /// 본문에서 가장 많이 쓴 문자 체계 pub body_script: Option<&'static str>, + /// `` 의 별도 모바일 URL + pub mobile_alternate: Option, } fn push(v: &mut Vec, s: &str) { @@ -85,6 +87,14 @@ pub fn extract(doc: &Html, html: &str, base: &Url) -> GoogleFacts { if e.attr("data-nosnippet").is_some() && !matches!(name, "span" | "div" | "section") { push(&mut f.data_nosnippet_invalid, name); } + if name == "link" + && rels.contains(&"alternate") + && get("hreflang").is_none() + && get("media").is_some_and(|m| m.contains("max-width") || m.contains("handheld")) + && f.mobile_alternate.is_none() + { + f.mobile_alternate = get("href").map(str::to_string); + } if name == "link" && rels.contains(&"alternate") && let Some(lang) = get("hreflang") @@ -244,7 +254,8 @@ mod tests { fn extracts_signals() { let base = Url::parse("https://a.com/").unwrap(); let html = r#" - + +

    x

    ok

    숨김

    안쪽
    @@ -273,6 +284,7 @@ mod tests { assert_eq!((f.yandex_noindex_open, f.yandex_noindex_close), (2, 1)); assert!(!f.itunes_meta_outside_head); assert_eq!(f.body_script, Some("hangul")); + assert_eq!(f.mobile_alternate.as_deref(), Some("https://m.a.com/")); let html = r#""#; assert!(extract(&Html::parse_document(html), html, &base).itunes_meta_outside_head); } diff --git a/crates/devup-access-checker/src/lib.rs b/crates/devup-access-checker/src/lib.rs index 298ea69..2a4e1a6 100644 --- a/crates/devup-access-checker/src/lib.rs +++ b/crates/devup-access-checker/src/lib.rs @@ -35,6 +35,7 @@ mod signals; mod sitemap; mod spec; mod trust; +mod vulnjs; use std::time::{Duration, Instant}; @@ -804,16 +805,63 @@ impl Checker { })) .await }; + let statement = async { + if !opts.check_links { + return None; + } + let raw = facts.aria.statement_links.first()?; + let u = facts.link_base(&base).join(raw).ok()?; + Some((u.to_string(), fetch::probe_status_body(&probe, &u).await)) + }; + let mobile_alt = async { + if !opts.check_links { + return None; + } + let raw = facts.google.mobile_alternate.as_deref()?; + let u = facts.link_base(&base).join(raw).ok()?; + Some((u.to_string(), fetch::probe_page(&probe, &u).await)) + }; + let cors = async { + if !opts.check_transport { + return None; + } + Some(fetch::cors_probe(&probe, &base, checks::CORS_PROBE_ORIGIN).await) + }; + let http_first_hop = async { + if !opts.check_transport { + return None; + } + let mut http = base.clone(); + let _ = http.set_scheme("http"); + Some( + fetch::first_hop( + &opts.user_agent, + opts.probe_timeout.min(Duration::from_secs(5)), + &http, + ) + .await, + ) + }; + let apple_touch = async { + if !opts.check_links { + return None; + } + let raw = facts.apple_touch_icon.as_deref()?; + let u = facts.link_base(&base).join(raw).ok()?; + Some(image_info(&probe, &u).await) + }; let gpc_url = at("/.well-known/gpc.json"); let gpc = fetch::probe_file(&probe, &gpc_url, Json); let ( (feed, bing, not_found_chain, indexnow), (llms_subpath, agent_card, robots_chain), (change_password, gpc, conditional, asset_encodings), + (statement, mobile_alternate, cors, http_first_hop, apple_touch_image), ) = tokio::join!( async { tokio::join!(feed, bing, not_found_chain, indexnow) }, async { tokio::join!(llms_subpath, agent_card, robots_chain) }, async { tokio::join!(change_password, gpc, conditional, asset_encodings) }, + async { tokio::join!(statement, mobile_alt, cors, http_first_hop, apple_touch) }, ); checks::SearchProbes { llms_subpath, @@ -822,6 +870,12 @@ impl Checker { gpc: Some(gpc), conditional, asset_encodings, + statement, + mobile_alternate, + cors, + http_first_hop, + apple_touch_image, + manifest_icon: None, robots_chain, feed, bing_site_auth: Some(bing), @@ -870,6 +924,17 @@ impl Checker { search_fut, ); search.chain_robots = chain_robots; + // manifest 에서 가장 크게 선언된 아이콘의 실제 크기 (manifest 를 받은 뒤라 따로 요청) + if let Some(Ok((_, Some(json)))) = &manifest + && let Some(manifest_url) = facts + .manifest + .as_deref() + .and_then(|m| facts.link_base(&base).join(m).ok()) + && let Some((declared, src)) = largest_icon(json) + && let Ok(u) = manifest_url.join(&src) + { + search.manifest_icon = Some((declared, image_info(&probe, &u).await)); + } let well_known = checks::WellKnown { favicon_ico, apple_touch_icon, @@ -937,6 +1002,44 @@ impl Checker { } } +/// 이미지를 받아 크기를 읽는다. +async fn image_info(probe: &reqwest::Client, url: &Url) -> Result { + fetch::fetch_bytes(probe, url, 2 * 1024 * 1024).await.map( + |(status, content_type, bytes, truncated)| { + let size = imagesize::blob_size(&bytes).ok(); + checks::ImageInfo { + url: url.to_string(), + status, + content_type, + bytes: bytes.len(), + truncated, + width: size.map(|s| s.width), + height: size.map(|s| s.height), + } + }, + ) +} + +/// manifest icons 중 가장 크게 선언된 것의 ("WxH", src). +fn largest_icon(json: &serde_json::Value) -> Option<(String, String)> { + json.get("icons")? + .as_array()? + .iter() + .filter_map(|i| { + let src = i.get("src")?.as_str()?.to_string(); + let size = i + .get("sizes")? + .as_str()? + .split_ascii_whitespace() + .next()? + .to_ascii_lowercase(); + let (w, h) = size.split_once('x')?; + Some((w.parse::().ok()? * h.parse::().ok()?, size, src)) + }) + .max_by_key(|(area, _, _)| *area) + .map(|(_, size, src)| (size, src)) +} + /// www 변형 호스트를 요청해 본다. 변형이 없으면(IP·단일 레이블 호스트) None. async fn probe_host_variant( probe: &reqwest::Client, diff --git a/crates/devup-access-checker/src/quality.rs b/crates/devup-access-checker/src/quality.rs index 5655d42..dbb6385 100644 --- a/crates/devup-access-checker/src/quality.rs +++ b/crates/devup-access-checker/src/quality.rs @@ -370,6 +370,8 @@ pub struct QualityFacts { pub inline_handlers: usize, pub ad_class_names: Vec, pub unsafe_attr_chars: Vec, + /// 같은 dl 안에서 반복된 dt 이름 + pub duplicate_dt: Vec, } fn push(v: &mut Vec, s: String) { @@ -639,6 +641,25 @@ pub fn extract(doc: &Html, base: &Url) -> QualityFacts { ); } } + if name == "dl" { + let mut seen: Vec = Vec::new(); + for dt in el + .descendants() + .filter_map(ElementRef::wrap) + .filter(|d| d.value().name() == "dt") + { + let t = dt + .text() + .collect::() + .split_whitespace() + .collect::>() + .join(" "); + if seen.contains(&t) { + push(&mut f.duplicate_dt, t.clone()); + } + seen.push(t); + } + } if matches!(name, "section" | "article") { f.sections += 1; let heading = el @@ -829,7 +850,7 @@ mod tests { spj
    -

    한글

    한글

    +

    한글

    한글

    용어
    a
    용어
    b
    다른
    a
    b

    ok

    ref

    no heading

    ok

    @@ -878,6 +899,7 @@ mod tests { assert_eq!((f.inline_styles, f.inline_handlers), (1, 1)); assert_eq!(f.ad_class_names, ["ad-banner"]); assert_eq!(f.unsafe_attr_chars, ["p[title]"]); + assert_eq!(f.duplicate_dt, ["용어"]); let nfd: String = unicode_normalization::UnicodeNormalization::nfd("한글").collect(); let f = run(&format!("

    {nfd}

    ")); assert_eq!(f.non_nfc, 1); diff --git a/crates/devup-access-checker/src/vulnjs.rs b/crates/devup-access-checker/src/vulnjs.rs new file mode 100644 index 0000000..efedfae --- /dev/null +++ b/crates/devup-access-checker/src/vulnjs.rs @@ -0,0 +1,208 @@ +//! 알려진 취약 버전의 JS 라이브러리 찾기. retire.js 저장소(`data/retire.json`, `scripts/update_retire.py` 로 갱신)의 +//! URL·파일명·파일 내용 정규식으로 버전을 알아내고 취약 범위와 비교한다. 네트워크 접근 없음. + +use std::cmp::Ordering; +use std::collections::BTreeMap; +use std::sync::LazyLock; + +use regex::Regex; +use serde::Deserialize; + +/// retire.js 의 버전 자리표시자를 대신하는 패턴. +const VERSION: &str = r"[0-9][0-9.a-z_\-]+"; + +#[derive(Deserialize)] +struct RawLib { + uri: Vec, + filename: Vec, + filecontent: Vec, + vulnerabilities: Vec, +} + +#[derive(Debug, Clone, Deserialize, PartialEq, Eq)] +pub struct Vuln { + #[serde(rename = "atOrAbove")] + pub at_or_above: Option, + pub below: Option, + pub severity: String, + pub ids: Vec, +} + +struct Lib { + name: String, + uri: Vec, + filename: Vec, + filecontent: Vec, + vulnerabilities: Vec, +} + +fn compile(patterns: &[String]) -> Vec { + // Rust regex 가 지원하지 않는 역참조·전후방 탐색 패턴은 건너뛴다 + patterns + .iter() + .filter_map(|p| Regex::new(&p.replace("§§version§§", VERSION)).ok()) + .collect() +} + +static LIBS: LazyLock> = LazyLock::new(|| { + let raw: BTreeMap = + serde_json::from_str(include_str!("../data/retire.json")).expect("valid retire.json"); + raw.into_iter() + .map(|(name, l)| Lib { + name, + uri: compile(&l.uri), + filename: compile(&l.filename), + filecontent: compile(&l.filecontent), + vulnerabilities: l.vulnerabilities, + }) + .collect() +}); + +/// retire.js 방식의 버전 비교 (점·대시로 나눈 조각을 숫자면 숫자로, 아니면 문자열로). +pub fn compare(a: &str, b: &str) -> Ordering { + let split = |s: &str| s.split(['.', '-']).map(str::to_string).collect::>(); + let (x, y) = (split(a), split(b)); + for i in 0..x.len().max(y.len()) { + let ord = match (x.get(i), y.get(i)) { + (Some(p), Some(q)) => match (p.parse::(), q.parse::()) { + (Ok(m), Ok(n)) => m.cmp(&n), + // 숫자 조각이 접미사(rc·beta)보다 나중 버전 + (Ok(_), Err(_)) => Ordering::Greater, + (Err(_), Ok(_)) => Ordering::Less, + (Err(_), Err(_)) => p.cmp(q), + }, + // 1.0 과 1.0.0 은 같고, 1.0-rc 는 1.0 보다 이르다 + (Some(p), None) => match p.parse::() { + Ok(0) => Ordering::Equal, + Ok(_) => Ordering::Greater, + Err(_) => Ordering::Less, + }, + (None, q) => match q.map(|q| q.parse::()) { + Some(Ok(0)) | None => Ordering::Equal, + Some(Ok(_)) => Ordering::Less, + Some(Err(_)) => Ordering::Greater, + }, + }; + if ord != Ordering::Equal { + return ord; + } + } + Ordering::Equal +} + +fn affected(v: &Vuln, version: &str) -> bool { + v.at_or_above + .as_deref() + .is_none_or(|a| compare(version, a) != Ordering::Less) + && v.below + .as_deref() + .is_some_and(|b| compare(version, b) == Ordering::Less) +} + +/// 찾은 라이브러리 하나. +#[derive(Debug, Clone, PartialEq, Eq)] +pub struct Finding { + pub library: String, + pub version: String, + pub url: String, + pub vulnerabilities: Vec, +} + +fn first_version(res: &[Regex], text: &str) -> Option { + res.iter().find_map(|r| { + let c = r.captures(text)?; + c.iter() + .skip(1) + .flatten() + .map(|m| { + // 탐욕적 버전 패턴이 붙여 가져온 `.min`·`.slim` 등을 뗀다 + let mut v = m.as_str(); + for suffix in [".min", "-min", ".slim", ".js", "."] { + v = v.strip_suffix(suffix).unwrap_or(v); + } + v.to_string() + }) + .find(|s| s.starts_with(|ch: char| ch.is_ascii_digit())) + }) +} + +/// 스크립트 URL 과 (있으면) 본문으로 라이브러리·버전을 알아내고 취약점을 찾는다. +pub fn scan(url: &str, body: Option<&str>) -> Vec { + let filename = url + .split(['?', '#']) + .next() + .unwrap_or_default() + .rsplit('/') + .next() + .unwrap_or_default(); + LIBS.iter() + .filter_map(|lib| { + let version = first_version(&lib.uri, url) + .or_else(|| first_version(&lib.filename, filename)) + .or_else(|| body.and_then(|b| first_version(&lib.filecontent, b)))?; + let vulnerabilities: Vec = lib + .vulnerabilities + .iter() + .filter(|v| affected(v, &version)) + .cloned() + .collect(); + Some(Finding { + library: lib.name.clone(), + version, + url: url.to_string(), + vulnerabilities, + }) + }) + .collect() +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn versions() { + assert_eq!(compare("1.12.4", "1.12.4"), Ordering::Equal); + assert_eq!(compare("1.9.1", "1.12.0"), Ordering::Less); + assert_eq!(compare("3.5.0", "3.4.99"), Ordering::Greater); + assert_eq!(compare("1.0.0-rc1", "1.0.0"), Ordering::Less); + assert_eq!(compare("1.0.0", "1.0.0-beta"), Ordering::Greater); + assert_eq!(compare("2.0", "2.0.1"), Ordering::Less); + assert_eq!(compare("2.0.1", "2.0"), Ordering::Greater); + assert_eq!(compare("1.0-a", "1.0-b"), Ordering::Less); + assert_eq!(compare("1.0a", "1.0"), Ordering::Less); + assert_eq!(compare("1.0.0", "1.0"), Ordering::Equal); + assert_eq!(compare("1.0", "1.0.0"), Ordering::Equal); + assert_eq!(compare("1.0", "1.0.rc"), Ordering::Greater); + assert_eq!(compare("1.1", "1.rc"), Ordering::Greater); + } + + #[test] + fn finds_vulnerable_libraries() { + let f = scan("https://code.jquery.com/jquery-1.12.4.min.js", None); + let jq = f.iter().find(|x| x.library == "jquery").expect("jquery"); + assert_eq!(jq.version, "1.12.4"); + assert!(!jq.vulnerabilities.is_empty()); + let f = scan( + "https://cdn.a.com/app.js", + Some("/*! jQuery v3.7.1 | (c) OpenJS Foundation */"), + ); + let jq = f + .iter() + .find(|x| x.library == "jquery") + .expect("jquery by content"); + assert_eq!(jq.version, "3.7.1"); + assert!(jq.vulnerabilities.is_empty()); + assert!(scan("https://a.com/main.js", Some("console.log(1)")).is_empty()); + assert!(scan("https://a.com/main.js", None).is_empty()); + let v = Vuln { + at_or_above: Some("2.0".into()), + below: Some("3.0".into()), + severity: "low".into(), + ids: vec![], + }; + assert!(affected(&v, "2.5") && !affected(&v, "1.9") && !affected(&v, "3.0")); + let open = Vuln { below: None, ..v }; + assert!(!affected(&open, "2.5")); + } +} diff --git a/crates/devup-access-checker/tests/end_to_end.rs b/crates/devup-access-checker/tests/end_to_end.rs index 793b134..ff320bf 100644 --- a/crates/devup-access-checker/tests/end_to_end.rs +++ b/crates/devup-access-checker/tests/end_to_end.rs @@ -1437,3 +1437,104 @@ async fn subpath_llms_agent_card_and_robots_chain() { Presence::Present ); } + +#[tokio::test] +async fn statement_mobile_icons_and_vulnerable_js() { + let s = MockServer::start().await; + let png = |w: u32| { + let mut v = vec![ + 0x89, b'P', b'N', b'G', 13, 10, 26, 10, 0, 0, 0, 13, b'I', b'H', b'D', b'R', + ]; + v.extend(w.to_be_bytes()); + v.extend(w.to_be_bytes()); + v.extend([8, 6, 0, 0, 0, 0, 0, 0, 0]); + v + }; + let page = r#"t + +웹 접근성 정책"#; + let ok = |ct: &str, body: &str| { + ResponseTemplate::new(200) + .insert_header("content-type", ct) + .set_body_string(body) + }; + Mock::given(method("GET")) + .and(path("/")) + .respond_with(ok("text/html", page)) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/accessibility")) + .respond_with(ok( + "text/html", + "

    문의: 메일 WCAG 2.2 2026-01-01

    ", + )) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/m")) + .respond_with(ok( + "text/html", + &format!( + r#"m"#, + s.uri() + ), + )) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/apple.png")) + .respond_with( + ResponseTemplate::new(200) + .insert_header("content-type", "image/png") + .set_body_bytes(png(180)), + ) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/icon.png")) + .respond_with( + ResponseTemplate::new(200) + .insert_header("content-type", "image/png") + .set_body_bytes(png(180)), + ) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/m.json")) + .respond_with(ok("application/manifest+json", r#"{"name":"a","icons":[{"src":"/icon.png","sizes":"512x512"},{"src":"/x.png","sizes":"bad"},{"src":"/y.png","sizes":5},{"src":"/z.png","sizes":""}]}"#)) + .mount(&s) + .await; + Mock::given(method("GET")) + .and(path("/js/jquery-1.12.4.min.js")) + .respond_with(ok("text/javascript", "/*! jQuery v1.12.4 */")) + .mount(&s) + .await; + let r = Checker::new(opts(|o| { + o.page_samples = 0; + o.check_ai_user_agents = false; + })) + .check(&s.uri()) + .await + .unwrap(); + for id in [ + "accessibility.statement_link", + "accessibility.statement_feedback", + "meta.apple_touch_icon_spec", + "meta.manifest_icon_size_mismatch", + "security.vulnerable_js_libraries", + ] { + assert_eq!(presence(&r, id), Presence::Present, "{id}"); + } + for id in [ + "meta.mobile_alternate_mismatch", + "security.cors_reflects_origin_credentials", + "transport.hsts_over_http", + ] { + assert_eq!(presence(&r, id), Presence::Missing, "{id}"); + } + assert_eq!( + presence(&r, "transport.http_redirect_off_host"), + Presence::NotApplicable + ); +} diff --git a/docs/coverage.md b/docs/coverage.md index 94ffdb9..b443662 100644 --- a/docs/coverage.md +++ b/docs/coverage.md @@ -613,7 +613,7 @@ MDN browser-compat-data 가 폐기(deprecated) 또는 비표준으로 표시한 | Apple (Applebot·앱 연결 문서) | 5쪽 | `crawling.robots_allows.applebot` `crawling.ua_access.applebot` `indexing.applebot_meta` `meta.apple_app_site_association_valid` `meta.apple_itunes_app_valid` | | sitemaps.org·Common Crawl | 3쪽 | `crawling.sitemap_namespace` `crawling.sitemap_invalid_priority` `crawling.sitemap_invalid_changefreq` `crawling.sitemap_invalid_lastmod` `crawling.sitemap_unescaped_entities` `crawling.sitemap_invalid_loc` `crawling.sitemap_out_of_scope` `crawling.sitemap_encoding` `geo.ua_access.ccbot` | -robots.txt 해석은 Google 규칙에 맞췄습니다: 토큰 뒤 텍스트 무시(`Googlebot/2.1`), 가장 구체적인 그룹 대체(googlebot-image → googlebot), Crawl-delay 같은 비규칙 필드가 그룹을 끊지 않음, 429 를 5xx 처럼 취급. 별도 모바일 URL 의 메타 일치와 UA 별 동적 제공 비교는 모바일 UA 로 한 번 더 받아야 해 아직 넣지 않았습니다. 콘솔 기능, 스팸 의도 판단, 렌더링 후 상태는 확인할 수 없습니다. +robots.txt 해석은 Google 규칙에 맞췄습니다: 토큰 뒤 텍스트 무시(`Googlebot/2.1`), 가장 구체적인 그룹 대체(googlebot-image → googlebot), Crawl-delay 같은 비규칙 필드가 그룹을 끊지 않음, 429 를 5xx 처럼 취급. 별도 모바일 URL 의 메타 일치는 `meta.mobile_alternate_mismatch`, Googlebot 스마트폰 UA 응답과의 동적 제공 비교는 `crawling.ua_access.googlebot_smartphone` `crawling.dynamic_serving_without_vary` 입니다. 콘솔 기능, 스팸 의도 판단, 렌더링 후 상태는 확인할 수 없습니다. ## AI·GEO 프로토콜 @@ -635,21 +635,21 @@ MCP 서버 발견(`/.well-known/mcp.json`)은 표준이 확정되지 않았고, | Observatory 테스트 | 항목 id | 비고 | |---|---|---| | cookies | `security.insecure_cookies` `security.cookie_samesite_invalid` `security.session_cookie_flags` `security.cookie_prefix_invalid` `security.cookie_syntax_invalid` | 리다이렉트 경유 응답의 쿠키는 보지 않음 | -| cors | `security.cors_wildcard` | Origin 을 반사하는 자격증명 허용은 별도 요청이 필요해 미구현 | +| cors | `security.cors_wildcard` `security.cors_reflects_origin_credentials` | — | | cross-origin-embedder-policy | `security.cross_origin_embedder_policy` `security.cross_origin_policy_invalid` | — | | cross-origin-opener-policy | `security.cross_origin_opener_policy` `security.cross_origin_policy_invalid` | — | | cross-origin-resource-policy | `security.cross_origin_resource_policy` `security.cross_origin_policy_invalid` | — | | csp | `security.csp` `security.csp_meta` `security.csp_unsafe_inline` `security.csp_unsafe_eval` `security.csp_broad_script_source` `security.csp_object_src_unrestricted` `security.csp_unsafe_inline_style` `security.csp_insecure_scheme` `security.csp_base_uri_unrestricted` `security.csp_form_action_unrestricted` `security.csp_default_src_missing` `security.csp_strict_dynamic_without_nonce` `security.csp_duplicate_directives` `security.csp_report_only_only` `security.trusted_types` | — | -| redirection | `transport.http_to_https_redirect` `transport.hsts_preload_ineligible` | http 요청의 첫 단계가 같은 호스트 https 인지는 preload 요건 안에서만 확인 | +| redirection | `transport.http_to_https_redirect` `transport.http_redirect_not_https_first` `transport.http_redirect_off_host` `transport.hsts_preload_ineligible` | — | | referrer-policy | `security.referrer_policy` `security.referrer_policy_unsafe` | — | -| strict-transport-security | `transport.hsts` `transport.hsts_invalid` `transport.hsts_max_age_short` `transport.hsts_preload_ineligible` | Chromium preload 목록 등재 여부 (외부 목록) | +| strict-transport-security | `transport.hsts` `transport.hsts_invalid` `transport.hsts_max_age_short` `transport.hsts_preload_ineligible` `transport.hsts_over_http` | Chromium preload 목록 등재 여부 (외부 목록) | | subresource-integrity | `security.sri_missing` `security.sri_invalid` | — | | x-content-type-options | `security.x_content_type_options` `security.x_content_type_options_invalid` | — | | x-frame-options | `security.x_frame_options` `security.x_frame_options_invalid` `security.clickjacking_unprotected` | — | | webhint hint | 항목 id | 비고 | |---|---|---| -| apple-touch-icons | `meta.apple_touch_icon` `meta.apple_touch_icon_file` | PNG·180px 확인은 미구현 (이미지 디코드 필요) | +| apple-touch-icons | `meta.apple_touch_icon` `meta.apple_touch_icon_file` `meta.apple_touch_icon_spec` | — | | axe | [axe-core 규칙](#axe-core-규칙) 표 | — | | babel-config | — | 확인 불가: 빌드 설정 파일 | | button-type | `content.button_type_missing` | — | @@ -671,7 +671,7 @@ MCP 서버 발견(`/.well-known/mcp.json`)은 표준이 확정되지 않았고, | manifest-app-name | `meta.manifest_name_length` | — | | manifest-exists | `meta.manifest` `links.manifest` | — | | manifest-file-extension | `meta.manifest_file_extension` | — | -| manifest-icons | `meta.manifest_icons_192_512` `meta.manifest_maskable_icon` | 아이콘 실제 크기 (이미지 디코드) | +| manifest-icons | `meta.manifest_icons_192_512` `meta.manifest_maskable_icon` `meta.manifest_icon_size_mismatch` | 가장 크게 선언된 아이콘 하나만 받아 확인 | | manifest-is-valid | `meta.manifest_content` `meta.manifest_display_valid` | — | | manifest-scoped-urls | `meta.manifest_start_url_scope` | — | | meta-charset-utf-8 | `meta.charset_not_utf8` `meta.charset_late` `meta.charset_duplicate` | — | @@ -682,12 +682,12 @@ MCP 서버 발견(`/.well-known/mcp.json`)은 표준이 확정되지 않았고, | no-broken-links | `content.broken_internal_links` `content.broken_resources` | — | | no-disallowed-headers | `security.server_header` `security.x_powered_by` `security.info_disclosure_headers` `security.hpkp` `security.p3p` | Expires·Host·X-Frame-Options 금지 권고는 OWASP·Observatory 와 충돌해 따르지 않음 | | no-friendly-error-pages | — | 해당 없음: IE 전용 (`not_found_page.custom` 참고) | -| no-html-only-headers | — | 미구현: 하위 리소스 응답 헤더 표본이 필요 | +| no-html-only-headers | `performance.html_only_headers` | 정적 리소스 표본 하나 기준 | | no-http-redirects | `transport.redirect` `performance.asset_redirects` | — | | no-inline-styles | `performance.inline_style_attrs` `performance.inline_code_bytes` | — | | no-p3p | `security.p3p` | /w3c/p3p.xml 파일은 요청하지 않음 | | no-protocol-relative-urls | `security.protocol_relative_urls` | — | -| no-vulnerable-javascript-libraries | — | 보류: 취약점 DB(retire.js 등)를 내장하고 갱신하는 설계가 필요 | +| no-vulnerable-javascript-libraries | `security.vulnerable_js_libraries` | retire.js 저장소 내장 (`scripts/update_retire.py` 로 갱신). JS 실행이 필요한 판별은 제외 | | performance-budget | `performance.page_weight` `performance.html_bytes` | 네트워크 모델 기반 판정은 하지 않음 | | scoped-svg-styles | — | 확인 불가: CSS 선택자 적용 범위 계산 | | sri | `security.sri_missing` `security.sri_invalid` | 해시 일치 확인은 하지 않음 | @@ -715,7 +715,7 @@ RFC 9116·IANA: `transport.security_txt` `transport.security_txt_fields`(10개 | WAVE | 항목 110개 | `accessibility.redundant_title_attr` `content.linked_documents` (나머지는 기존 항목) | | EN 301 549 V3.2.1 | 9장 외 조항 71개 | `accessibility.statement_link` `accessibility.media_controls_missing` `structured_data.accessibility_metadata` (9장은 WCAG 2.2 표) | -EU 웹 접근성 지침 제7조의 피드백 수단(접근성 성명 페이지 안의 연락 수단)은 성명 페이지를 한 번 더 받아야 해 아직 넣지 않았습니다. +EU 웹 접근성 지침 제7조의 피드백 수단은 접근성 성명 페이지를 받아 `accessibility.statement_feedback` 으로 확인합니다. Nu HTML Checker 의 dl 안 dt 중복 경고는 `accessibility.definition_list_duplicate_terms` 입니다. ## HTML 검사기·성능 diff --git a/scripts/update_retire.py b/scripts/update_retire.py new file mode 100644 index 0000000..321745d --- /dev/null +++ b/scripts/update_retire.py @@ -0,0 +1,42 @@ +"""retire.js 취약점 저장소(jsrepository-v4.json)의 최신판을 받아 라이브러리가 쓰는 부분만 남긴다. + + python scripts/update_retire.py + +결과: crates/devup-access-checker/data/retire.json +URL·파일명·파일 내용 정규식과 취약 버전 범위만 남긴다 (JS 실행이 필요한 func·ast 추출기는 제외). +""" +import json +import urllib.request + +URL = "https://raw.githubusercontent.com/RetireJS/retire.js/master/repository/jsrepository-v4.json" +OUT = "crates/devup-access-checker/data/retire.json" + +req = urllib.request.Request(URL, headers={"User-Agent": "Mozilla/5.0"}) +with urllib.request.urlopen(req, timeout=60) as r: + repo = json.loads(r.read().decode("utf-8")) + +out = {} +for name, lib in sorted(repo.items()): + if name == "retire-example": + continue + ex = lib.get("extractors", {}) + vulns = [] + for v in lib.get("vulnerabilities", []): + ids = v.get("identifiers", {}) + refs = ids.get("CVE", []) + ([ids["githubID"]] if ids.get("githubID") else []) + vulns.append({ + "atOrAbove": v.get("atOrAbove"), + "below": v.get("below"), + "severity": v.get("severity", ""), + "ids": refs or [ids.get("summary", "")[:80]], + }) + out[name] = { + "uri": ex.get("uri", []), + "filename": ex.get("filename", []), + "filecontent": ex.get("filecontent", []), + "vulnerabilities": vulns, + } +with open(OUT, "w", encoding="utf-8", newline="\n") as f: + json.dump(out, f, ensure_ascii=False, separators=(",", ":")) + f.write("\n") +print(f"{len(out)} libraries, {sum(len(v['vulnerabilities']) for v in out.values())} vulnerabilities -> {OUT}")