Audit scope
Written for an outside, independent security audit. Revision described:
4c86614a1ee09a5b8ca4da6c2f4a7bc958d1fd64 on main, 2026-10-26. Everything below is taken from the repository's own files at
that revision; items marked NOT_RUN were not executed while writing this document.
What this repository is
An Omega library, lib/omtex.om (1,176 lines, an om2 unit), that writes LaTeX. A paper
(examples/*/paper.om) is concatenated after the library and compiled with the pinned omc; the
resulting generator prints the .tex file, and paper.gen check OMC DIR compiles every Omega
listing to confirm it is accepted or refused as stated. docs/DESIGN.md (110 lines) is the
contract for escaping, the math check, listings and refusal codes. tools/ holds build.sh,
pin.sh, compare.sh and zenodo-draft.sh; tests/run.sh is the suite. Licence: Apache 2.0
(LICENSE, NOTICE).
What to review, in priority order
- Prose escaping in
lib/omtex.omagainst the table indocs/DESIGN.md("Prose markup"): always-escaped characters, paired quotes and emphasis, cite and ref keys, the allowed backslash escapes, and refusal of control bytes and malformed UTF-8 (trap 11, exit 111). - The math check: printable ASCII only, balanced braces, no
% $ #, and a deny list of control sequences (`\input \include \write \def \edef \gdef \xdef \let \catcode \immediate \openout \openin \csname \special \read`). It is a deny list; check whether other primitives or macros (for example\newcommand,\renewcommand,\expandafter) can reach the same effects.rawtexandpreamblelines use the same check with&and\\allowed. - Listings: bodies containing
\end{lstlisting}, non-ASCII or control bytes other than LF and tab are refused. - The
checkpath (txcheck,txrun,txchild,txpath): it writesDIR/<label>.omand runsOMCwith fork and exec. The label character set (zrkey) allows.and/; check whether a label such as../xleavesDIR. tools/zenodo-draft.sh: every request goes throughapi(), which refuses any URL containingpublish; the token is written to a header file underumask 077and unset; the script ends by re-reading the deposition and failing unless it is still unsubmitted. Theevalof the token variable name takes a fixed name chosen by--sandbox.tools/build.sh: runspdflatex -interaction=nonstopmode -halt-on-error -no-shell-escape, andbibtexonly when the.auxnames bibliography data.tools/pin.sh: fetches omega-mv commit91b3c9326919faf1491e29ae9276929e8349b8c7withgit fetch --depth 1and refuses anyomcwhose sha256 differs from189ada82e00bb440cb41351bd252cc68c54a1b1050051cc42a1df700081c3b54.
Trust boundaries
- The paper source is written by its author and compiled as code. omtex treats prose and math text inside it as data that must not become arbitrary LaTeX.
- pdfTeX is trusted to honour
-no-shell-escape. - Zenodo is reached over HTTPS with a bearer token from the environment (
ZENODO_TOKENorZENODO_SANDBOX_TOKEN).
Threat model summary
- Assets: the integrity of generated papers, the Zenodo token, published Zenodo records.
- Attackers considered: prose or math text that tries to inject LaTeX; a mistaken run of the Zenodo script against a published record.
- Defended: escaping with no raw prose path, math deny list, listing checks, output cap of 4 MiB,
deterministic output, the publish refusal in
api(). - Not defended / explicitly out of scope: a hostile paper author (the paper is a program; it can call Omega host words directly); TeX Live vulnerabilities.
Build from source at a pin
Host tools and versions are listed in DEPENDENCIES.md (pdfTeX 3.141592653-2.6-1.40.25, TeX Live
2023, cm-super 0.3.4-17, git, sha256sum). The compiler is fetched by tools/pin.sh.
tools/build.sh examples/listings/paper.om build/listings
OMTEX_NO_PDF=1 tools/build.sh examples/hello/hello.om build/hello # stop after the .tex
Run every test
NOT_RUN while writing this document. From AGENTS.md:
tests/run.sh
tools/compare.sh ORIG.tex ORIG.pdf build/X/paper.tex build/X/paper.pdf
tests/run.sh pairs every refusal case with an accepted case, prints NOT_RUN (never PASS) for
cases the host cannot run, and exits 1 on any FAIL. tools/compare.sh needs poppler-utils and an
original paper's .tex and PDF. tools/zenodo-draft.sh needs a Zenodo token and network; NOT_RUN.
Known limitations and NOT_RUN
- Hosted CI (
.github/workflows/ci.yml, added with this document) runssh tests/run.shwith the pinnedomcon a GitHub-hosted arm64 runner and writes an SPDX SBOM. It does not runtools/compare.shortools/zenodo-draft.sh. - Moving the pin requires rerunning
tests/run.sh, both reproductions and the keyword parity test (AGENTS.md). - A typesetting engine in Omega is not started; pdfTeX stays a host tool (
DEPENDENCIES.md). curl,jqandmd5sumare used by the Zenodo script; Omega replacements are named inDEPENDENCIES.mdbut not built.
Dependencies and provenance
- Build path: pinned
omc(fetched and hash-checked), pdfTeX and TeX Live packages,bibtexwhen used, POSIX shell tools. The generator is a static Omega binary that only writes LaTeX to stdout (DEPENDENCIES.md). - Verification only: poppler-utils 24.02.0, mawk 1.3.4 (for the pin's
seed/omc/genkw.awk). - Zenodo script: curl 8.5.0, jq 1.7, md5sum (coreutils 9.4).
Evidence
evidence/tests.txt:TESTS pass=59 fail=0 not_run=0.evidence/REPRODUCTION.mdwithcompare-omega-language.txtandcompare-turing-brief.txt: reproductions of two published papers (for the first, 0 differing text lines and 9 of 9 pages pixel-identical against the original rebuilt on the same TeX Live).evidence/zenodo-new.txtandevidence/zenodo-newversion.txt: draft runs against zenodo.org.
AGENTS.md: never edit a recorded result. These are the author's logs, not independent reproduction.