Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
run: |
cd crates/markkit-wasm/pkg
npm pack --dry-run --json --ignore-scripts > "$RUNNER_TEMP/wasm-pack.json"
node -e 'const files=new Set(require(process.argv[1])[0].files.map(f=>f.path)); for (const f of ["index.js","index.d.ts","markkit_wasm.js","markkit_wasm_bg.wasm","README.md"]) if(!files.has(f)) throw Error("archive lacks "+f)' "$RUNNER_TEMP/wasm-pack.json"
node -e 'const files=new Set(require(process.argv[1])[0].files.map(f=>f.path)); for (const f of ["index.js","index.d.ts","markkit_wasm.js","markkit_wasm_bg.wasm","README.md","LICENSE","NOTICE"]) if(!files.has(f)) throw Error("archive lacks "+f)' "$RUNNER_TEMP/wasm-pack.json"

check:
name: Check
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
run: |
cd crates/markkit-js
npm pack --ignore-scripts --json > "$RUNNER_TEMP/markkit-pack.json"
node -e 'const p=require(process.argv[1])[0]; const files=p.files.map(f=>f.path); if(!files.includes("index.js") || !files.some(f=>f.endsWith(".node"))) throw Error("npm package must contain its loader and native binary")' "$RUNNER_TEMP/markkit-pack.json"
node -e 'const p=require(process.argv[1])[0]; const files=p.files.map(f=>f.path); if(!files.includes("index.js") || !files.some(f=>f.endsWith(".node"))) throw Error("npm package must contain its loader and native binary"); for (const f of ["LICENSE","NOTICE"]) if(!files.includes(f)) throw Error("npm package lacks "+f)' "$RUNNER_TEMP/markkit-pack.json"
TARBALL=$(node -e 'console.log(require(process.argv[1])[0].filename)' "$RUNNER_TEMP/markkit-pack.json")
npm install --prefix "$RUNNER_TEMP/markkit-npm-smoke" --ignore-scripts --audit=false --fund=false "$PWD/$TARBALL"
node -e 'const m=require(process.argv[1]); if(m.extractHtmlSync("<h1>Smoke</h1>").trim()!=="# Smoke") throw Error("native extraction smoke failed")' "$RUNNER_TEMP/markkit-npm-smoke/node_modules/@everruns/markkit"
2 changes: 1 addition & 1 deletion .github/workflows/publish-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
run: |
cd crates/markkit-js
npm pack --ignore-scripts --json > "$RUNNER_TEMP/markkit-pack.json"
node -e 'const p=require(process.argv[1])[0]; const files=p.files.map(f=>f.path); if(!files.includes("index.js") || !files.some(f=>f.endsWith(".node"))) throw Error("npm package must contain its loader and native binary")' "$RUNNER_TEMP/markkit-pack.json"
node -e 'const p=require(process.argv[1])[0]; const files=p.files.map(f=>f.path); if(!files.includes("index.js") || !files.some(f=>f.endsWith(".node"))) throw Error("npm package must contain its loader and native binary"); for (const f of ["LICENSE","NOTICE"]) if(!files.includes(f)) throw Error("npm package lacks "+f)' "$RUNNER_TEMP/markkit-pack.json"
TARBALL=$(node -e 'console.log(require(process.argv[1])[0].filename)' "$RUNNER_TEMP/markkit-pack.json")
npm install --prefix "$RUNNER_TEMP/markkit-npm-smoke" --ignore-scripts --audit=false --fund=false "$PWD/$TARBALL"
node -e 'const m=require(process.argv[1]); if(m.extractHtmlSync("<h1>Smoke</h1>").trim()!=="# Smoke") throw Error("native extraction smoke failed")' "$RUNNER_TEMP/markkit-npm-smoke/node_modules/@everruns/markkit"
Expand Down
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/).
PyPI project links, keywords and classifiers.
- Releases now publish PyPI and npm (native + WASM) together with crates.io.

### Fixed

- Every published package (crates.io crates, PyPI wheel/sdist, `@everruns/markkit`,
`@everruns/markkit-wasm`) now ships `LICENSE` and `NOTICE`. Python metadata
declares `License-Expression: MIT`. `NOTICE` reproduces the BSD notices for the
PDFium/Foxit fonts and Adobe CMaps embedded by PDF rendering (`pdf-ocr`).
- `SECURITY.md` lists 0.3.x as supported, adds GitHub private vulnerability
reporting, and covers the WASM package and agent tool.

## [0.3.1] - 2026-11-03

### Security
Expand Down
98 changes: 91 additions & 7 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,100 @@ by, or derived from any of the above projects.

=== Key Dependencies ===

Markkit relies on several permissively licensed crates:
Markkit relies on permissively licensed crates, including:

* scraper (MIT) – HTML parsing and CSS selector matching
* html5ever (MIT/Apache-2.0) – HTML5 parsing
* scraper (ISC), html5ever (MIT/Apache-2.0) – HTML parsing
* zip (MIT), quick-xml (MIT), calamine (MIT), cfb (MIT) – Office document containers and XML
* reqwest (MIT/Apache-2.0) – HTTP client
* tokio (MIT) – Async runtime
* serde / serde_json (MIT/Apache-2.0) – Serialization
* hayro-syntax / hayro (MIT/Apache-2.0) – PDF parsing and page rendering
* ocrs, rten (MIT/Apache-2.0) – optional Rust OCR backend
* reqwest (MIT/Apache-2.0), rustls (Apache-2.0/ISC/MIT) – optional HTTP client
* tokio (MIT) – async runtime
* serde / serde_json (MIT/Apache-2.0) – serialization
* pyo3 (MIT/Apache-2.0), napi (MIT), wasm-bindgen (MIT/Apache-2.0) – bindings

Full dependency license details are available via `cargo deny check licenses`.
The allowed license set is enforced by `cargo deny check licenses` (deny.toml).
Binary packages (CLI, Python wheels, Node native addon, WebAssembly) statically
link these crates; their license texts and copyright notices are in each
crate's source on crates.io, pinned by Cargo.lock. cssparser and selectors
(via scraper) are MPL-2.0; their unmodified source is available from crates.io.

=== Bundled Third-Party Data ===

The `pdf-ocr` feature renders PDF pages with hayro, which compiles the
following data into the binary. It is enabled in the CLI, the Python package
and the native Node package (not in the default crate build or WebAssembly).

--- Standard PDF fonts (hayro-interpret, assets/*.pfb) ---

Extracted from PDFium.

Copyright 2014 PDFium Authors. All rights reserved.
Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Google Inc. nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--- Adobe CMap resources (hayro-cmap, assets) ---

Copyright 1990-2023 Adobe. All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

--- ICC color profiles (hayro-interpret, assets/*.icc) ---

CGATS001Compat-v2-micro.icc from saucecontrol/Compact-ICC-Profiles, CC0-1.0.
LAB.icc generated with LCMS2 by the hayro authors.

=== Not Bundled ===

OCR model weights (CC-BY-SA 4.0), Tesseract and its language data are not
included in any markkit package. `just ocr-models` downloads the pinned models
and writes their license and attribution to target/ocr-models/NOTICE.json.

=== Public Benchmark Tooling ===

Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,4 +426,6 @@ Markkit is part of the [Everruns](https://everruns.com) ecosystem, alongside

## License

MIT License. See [LICENSE](LICENSE) for details.
MIT License. See [LICENSE](LICENSE) for details. Third-party attributions,
including data embedded by PDF rendering, are in [NOTICE](NOTICE). Report
vulnerabilities privately per [SECURITY.md](SECURITY.md).
93 changes: 68 additions & 25 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,89 @@
# Security Policy

Markkit turns untrusted documents into Markdown, often inside AI agents and
services that accept files or URLs from users. We take reports seriously and
appreciate responsible disclosure.

## Reporting a Vulnerability

**Please do not report security vulnerabilities through public GitHub issues.**
**Do not report security vulnerabilities through public GitHub issues,
discussions or pull requests.**

Report privately through either channel:

Instead, please report them via email to **security@everruns.com**.
- [GitHub private vulnerability reporting](https://github.com/everruns/markkit/security/advisories/new)
(preferred)
- Email **security@everruns.com**

Please include:

- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
- Affected package(s) and version(s), and the feature flags or binding in use
- Description of the vulnerability and its impact
- Steps to reproduce, ideally a minimal input file (attach it; do not link
public hosting) or a failing test
- Suggested fix (optional)

Inputs that make markkit panic, hang, exhaust memory past its configured
limits, execute embedded content, or reach a network address the fetch policy
should refuse are all in scope; see the invariants in the
[threat model](knowledge/security/threat-model.md).

## Response Timeline

- **Acknowledgment**: Within 48 hours
- **Initial assessment**: Within 1 week
- **Critical fixes**: Target 30 days
- **Acknowledgment**: within 48 hours
- **Initial assessment**: within 7 days
- **Fix target**: within 30 days for critical issues

We coordinate disclosure with the reporter, publish a GitHub security advisory
(and a RustSec advisory for the crates) once a fixed release is available, and
credit reporters who wish to be named.

## Supported Versions

Markkit is pre-1.0. Security fixes land on `main` and ship in a new release of
the latest minor line, published in sync to crates.io, PyPI and npm.

| Version | Supported |
|---------|-----------|
| 0.1.x | Yes |
| 0.3.x | Yes |
| < 0.3 | No |

## Security Architecture

Markkit processes untrusted input (HTML, DOCX, spreadsheets) and converts it to markdown. Key security considerations:
## Scope

- **No code execution**: scripts, styles, forms, iframes and SVG are stripped; macros and formulas are never executed; XML entities are never expanded
- **Resource limits**: input size, HTML/XML nesting depth, archive entry count and decompressed size, spreadsheet grid cells, rows and columns
- **Explicit failure**: malformed input returns errors, never panics; unsupported formats fail explicitly
- **URL fetching**: opt-in `http_client` feature (off by default; CLI and Python/Node bindings enable it); http/https only, non-public addresses refused by default (after DNS and on every redirect), optional host allowlist, bounded redirects, body size and fetch time. Behind an environment HTTP proxy, the proxy resolves names, so restrict egress there too
- `markkit` crate (crates.io)
- `markkit-cli` crate and `markkit` command-line tool
- `markkit` Python package (PyPI)
- `@everruns/markkit` Node.js package and `@everruns/markkit-wasm` WebAssembly
package (npm)
- `MarkkitTool` LLM agent tool (`tool` feature)
- Official examples and documentation

Full analysis: [threat model](knowledge/security/threat-model.md).
Out of scope: vulnerabilities in host-installed tools markkit invokes or reads
(Tesseract, OCR model files, language data), host runtimes (CPython, Node,
browsers) and third-party dependencies, unless markkit's use of them creates
the issue. Report those upstream; tell us too if markkit should mitigate them.

## Scope

The following components are in scope for security reports:
## Security Architecture

- `markkit` core library crate
- `markkit-cli` command-line tool
- Official Python and Node.js bindings
- Published documentation
Key properties, enforced by tests and fuzzing:

- **No code execution**: scripts, styles, forms, iframes and SVG are stripped;
macros, formulas and PDF JavaScript are never executed; XML entities are
never expanded
- **Resource limits**: input size, HTML/XML nesting depth, archive entry count
and decompressed size, spreadsheet cells/rows/columns, PDF pages/objects/
stream sizes, output size and processing deadlines (`Limits`)
- **Explicit failure**: malformed input returns errors, never panics;
unsupported formats fail explicitly
- **Output safety**: rendered Markdown neutralizes dangerous link schemes and
raw HTML
- **URL fetching**: opt-in `http_client` feature (off by default; CLI and
Python/Node bindings enable it); http/https only, non-public addresses
refused by default (after DNS and on every redirect), optional host
allowlist, bounded redirects, body size and fetch time. Behind an environment
HTTP proxy, the proxy resolves names, so restrict egress there too

Full analysis: [security model](knowledge/security/security-model.md),
[threat model](knowledge/security/threat-model.md),
[native dependencies](knowledge/security/native-dependencies.md) and
[fuzzing](knowledge/security/fuzzing.md).
1 change: 1 addition & 0 deletions crates/markkit-cli/LICENSE
1 change: 1 addition & 0 deletions crates/markkit-cli/NOTICE
21 changes: 21 additions & 0 deletions crates/markkit-js/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024-2026 Everruns

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading
Loading