Skip to content

Security: rahfianugerah/github-project-convert-docs

Security

SECURITY.md

Security Policy

Supported Versions

Version Security fixes
0.1.0 Supported
Any commit before 0.1.0 Not Supported

Reporting a Vulnerability

Never report a vulnerability in a public issue, a pull request, or a discussion. Report it privately through GitHub private vulnerability reporting on this repository, with:

  • What the vulnerability is, and where it is.
  • The steps to reproduce it.
  • The version or commit it affects.
  • The impact you expect.

Do not access, change, or delete data that is not yours while testing, and stop as soon as you have shown the issue.

What Happens Next

Step Within
Acknowledgement of your report 3 business days
An assessment, with a severity 7 days
A fix or a mitigation for a critical or high finding 30 days
A fix for a medium or low finding The next release

You are kept informed at every step, and credited in the release notes if you wish.

Disclosure

Details are published only after a fix is released, or after 90 days, whichever comes first, on a date agreed with you.

Out of Scope

  • A finding that needs physical access to a device, or a device already compromised.
  • Social engineering of anyone involved in the project.
  • Denial of service by volume.
  • A scanner's output with no demonstrated impact.

Security Controls

Each code is a requirement in docs/SRS.md.

Control Where it is enforced
The token is optional, and narrow. Without GITHUB_TOKEN, the run reads public data and leaves packages unchecked. To list packages, use a classic token with only read:packages and an expiry date, never one with repo app/settings.py Settings; app/releases.py fetch_packages; README.md Configuration
A GITHUB_TOKEN already set is used. A token that another tool already put in the environment is used if present, ahead of .env, and the run says so on standard error: Using GITHUB_TOKEN from the environment. app/settings.py Settings; main.py main
NFR-SEC-12, the token's handling. It is read once, from the environment or the gitignored .env at the project root, never from the working directory or a flag. A value that is not 1 to 255 characters of A-Z, a-z, 0-9, and _ stops the run before any request, without echoing it. It is hidden from the settings' repr. It goes out as Authorization: Bearer to api.github.com only, decided again for every hop. A 401 stops the run and is never retried without it app/settings.py Settings, load_settings; app/client.py _send, _raise_for_status; .gitignore
No ambient credential. File and image requests carry no credential. No netrc, no stored cookie, and no proxy or certificate bundle from the environment is used app/client.py GitHubClient.__init__, _send
NFR-SEC-01, the link check. --src must be at most 300 printable ASCII characters with no whitespace. The owner and repository must match explicit ASCII patterns in full, and nothing is percent-decoded. A link that fails is rejected before any request, and the link itself is never requested app/source.py parse_repo_url, called first in main.py main
NFR-SEC-02, two host lists, HTTPS only. Only api.github.com receives API requests. Files and images may come only from an exact list of GitHub content hosts, which leaves out api.github.com. Every URL sent must use https on the default port, with no user information. TLS verification is never turned off app/settings.py API_HOSTS, CONTENT_HOSTS; app/client.py _check_url
NFR-SEC-03, redirects. The HTTP client never follows a redirect on its own. The code follows at most 3 and checks each hop against the list its request started on. A malformed Location is refused app/client.py _follow, _join, _send
NFR-SEC-04, time limits. 5 s to connect and 15 s per idle read. One 20 s deadline covers every hop of a request, checked before each hop and between body chunks. All images in a run stop after 60 s, and rendering stops at 120 s app/client.py _send, _read_capped; app/content.py Images; app/render.py _print_pdf
NFR-SEC-05, size and count limits. Bodies are streamed and counted after decoding, whatever Content-Length says. Limits: 5 MB for an API response, 1 MB for a file or a release's notes, 5 MB per image, 50 images and 50 MB of downloads per run, and 30 requests to api.github.com per run. A response that lists more than one content coding is refused before it is decoded. No body is read on an error status app/client.py _read_capped, _raise_for_status, _send; app/content.py Images; app/github.py _read; app/releases.py _release
NFR-SEC-06, one sanitizer. All GitHub HTML is cleaned by one nh3 allowlist. Links are kept only as http, https, mailto, or a # fragment. Images are kept only as data URIs of downloaded bytes. Scripts, styles, forms, frames, SVG, and MathML markup are dropped app/content.py clean_html
NFR-SEC-07, our own template. Every GitHub value placed outside the sanitizer is escaped. A homepage or package link is clickable only when it is http or https. The CSS is a constant app/document.py build_html, page_templates, _link
NFR-SEC-08, a locked-down Chromium. Linux needs Chromium's sandbox. Playwright's own Chromium always starts with its sandbox and no weakening argument. Where the sandbox cannot start, as on a Linux host that blocks it, the run stops with error: Chromium could not start with its sandbox and never retries without it. JavaScript is off, the page is offline, every request is aborted, and the HTML is loaded only with set_content, under a CSP with no unsafe-inline app/render.py _launch, _chromium; app/document.py _CSP
NFR-SEC-09, images. The type comes from the bytes. Pillow opens only PNG, JPEG, GIF, and WebP, with at most 25 MP per image and 100 MP per document. An SVG is never parsed in Python and reaches Chromium only as an image app/content.py _inline, Images.data_uri
NFR-SEC-10, data from GitHub is checked. A full name GitHub returns must pass the link check's patterns. Only allowlisted file names are read. Every URL path segment is percent-encoded onto a literal host. A field of the wrong type stops the run app/source.py parse_full_name; app/github.py _name, _known; app/releases.py url, field, utc
NFR-SEC-11, public data only. A repository is read only when GitHub marks it public, after any redirect, and the same holds for <owner>/.github before anything is inherited. Drafts are dropped. Only public packages of this repository are listed app/github.py _public_repo, _inherit; app/releases.py fetch_releases, _is_listed
NFR-SEC-13, terminal output. Only fixed messages, counts, validated names, and local paths are printed. An unexpected failure prints its exception class name only, with no traceback main.py _Parser.error, main, the __main__ block; the error classes in app/client.py
NFR-SEC-14, the output path. Files are written only inside output/, through a temporary folder the run creates there. A symlink or junction that leads elsewhere stops the run. Cleanup deletes only the PDF and the run's page images app/render.py render, _publish, _check_inside
NFR-SEC-15, metadata and size. The PDF names no local path, user, host, or OS. JPGs carry no EXIF. A PDF over 300 pages stops the run before anything is written app/render.py render, _write_jpg
NFR-SEC-16, dependencies. Every direct dependency is pinned to a bounded range, and requirements.lock is a pip freeze of the tested environment. pip-audit runs locally against requirements.lock at each release, not in CI, and a high or critical finding in a direct dependency blocks the release. Playwright and its Chromium are upgraded at each release. brotli, brotlicffi, and zstandard are kept out of the lock pyproject.toml, requirements.lock, the release audit

Accepted Risks

No Risk Accepted by Date Review by
1 A slow host can hold one request past its 20 s deadline. The deadline is checked before each hop and between body chunks. So a host that sends its headers slowly, each read under 15 s, can hold a run open, and a stalled body can overrun the deadline by at most 15 s. No watchdog is added. What limits it: only GitHub's own hosts are contacted, over verified TLS, and the run can be stopped with Ctrl+C The owner 2026-11-28 2027-02-28
2 One response can briefly hold about 150 MB of memory while it is decoded. httpx inflates each received chunk of a response with one content coding before the size limit counts it, so one highly compressed chunk can grow to tens of MB before the run stops it as over its limit. What limits it: it happens once per request and is freed when the request ends. A response with more than one coding is refused, and the decoders with far higher ratios are kept out of the lock The owner 2026-11-28 2027-02-28

Last Audit

2026-11-28, the full-codebase release audit of 0.1.0: every module in app/ and main.py, README.md, CONTRIBUTING.md, requirements.lock, and the whole git history. No critical, high, medium, or low finding is open, and every finding of the two earlier reviews is still fixed. pip-audit found no known vulnerability in the 30 pins of requirements.lock. Playwright is 1.65.2, its latest release, with Chromium 159.0.8154.6. Two checks need verification: Chromium's sandbox on Linux, and GitHub's image links when a token is set.

There aren't any published security advisories