interplane.Get Omega
Read in your language

omtex

aien-dev/omtex

Brought by drakestapleton

branch main Branches Tags History

omtex / AUDIT_SCOPE.md

111 lines · 6078 bytes Raw Blame History Source

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

  1. Prose escaping in lib/omtex.om against the table in docs/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).
  2. 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. rawtex and preamble lines use the same check with & and \\ allowed.
  3. Listings: bodies containing \end{lstlisting}, non-ASCII or control bytes other than LF and tab are refused.
  4. The check path (txcheck, txrun, txchild, txpath): it writes DIR/<label>.om and runs OMC with fork and exec. The label character set (zrkey) allows . and /; check whether a label such as ../x leaves DIR.
  5. tools/zenodo-draft.sh: every request goes through api(), which refuses any URL containing publish; the token is written to a header file under umask 077 and unset; the script ends by re-reading the deposition and failing unless it is still unsubmitted. The eval of the token variable name takes a fixed name chosen by --sandbox.
  6. tools/build.sh: runs pdflatex -interaction=nonstopmode -halt-on-error -no-shell-escape, and bibtex only when the .aux names bibliography data.
  7. tools/pin.sh: fetches omega-mv commit 91b3c9326919faf1491e29ae9276929e8349b8c7 with git fetch --depth 1 and refuses any omc whose sha256 differs from 189ada82e00bb440cb41351bd252cc68c54a1b1050051cc42a1df700081c3b54.

Trust boundaries

Threat model summary

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

Dependencies and provenance

Evidence

AGENTS.md: never edit a recorded result. These are the author's logs, not independent reproduction.