Skip to content

Revise the Taint extension documentation - #5802

Merged
lacatoire merged 4 commits into
php:masterfrom
laruence:revise-taint-docs
Aug 26, 2026
Merged

Revise the Taint extension documentation#5802
lacatoire merged 4 commits into
php:masterfrom
laruence:revise-taint-docs

Conversation

@laruence

Copy link
Copy Markdown
Member

Summary

  • Rewrite the Taint chapter against the current extension source:
    propagation semantics (detail.xml), the function pages (taint,
    untaint, is_tainted), and the book/setup/installation/INI pages.
  • Document the exact set of operators and string functions that
    propagate the taint mark, and the full list of checked sinks
    (output, filesystem, SQL, command execution, headers/cookies,
    unserialize, mail), each with what argument is inspected.
  • Installation section follows the same style as the other extension
    docs (pecl install plus a git clone + phpize build snippet).
  • Verified with doc-base/configure.php (libxml validation passes),
    PhD xhtml rendering, and docbook-cs (no violations).

Test plan

  • php doc-base/configure.php passes without errors
  • php phd/render.php -P PHP -f xhtml renders all 13 taint pages
  • docbook-cs reference/taint/ reports no violations

Rewrite all taint reference pages against the current extension source
(3.x) and README:

- book.xml: rewrite the introduction to explain the model (user input
  marked tainted at request start, mark tracked through string ops,
  warning at dangerous sinks) and that taint is a dev/audit tool, not
  a runtime defense; update the example output to the actual
  "main() [echo]: ..." warning format
- detail.xml: rebuild as "Propagation and Checked Sinks"; correct the
  propagation-function list and the full sink list (output, filesystem,
  SQL, command, header/cookie, unserialize/mail); remove the obsolete
  "functions which untaint" table (escaping helpers no longer clear the
  mark in 3.x); move basename/dirname/pathinfo from sinks to propagation
- functions/: document real signatures (taint/untaint take variadic
  by-reference strings, is_tainted takes a value), always-true/false
  return semantics, notes and runnable examples
- ini.xml: fix taint.error_level default to 512 (E_USER_WARNING) and
  expand both directives' descriptions
- setup.xml/configure.xml: split installation into configure.xml, add
  PECL/source-build instructions and the GitHub repository, add
  requirements and resources sections

Facts verified against taint.c (arginfo, zend_parse_parameters,
php_taint_fcall_check) and live reflection/warning output.
@lacatoire
lacatoire merged commit befe2b9 into php:master Aug 26, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants