You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opcache: bounds-validate relocation offsets and document the trust model #123
Follow-up to the OpCache binary-file API (#111, merged). Defense-in-depth (raised in the PR security review; filtered as not a new vulnerability because it restates opcache's own file-cache trust model, but worth doing).
PayloadRelocator computes real addresses as base + stored for every interior pointer, and drives loops off count/offset fields (scriptOffset, nNumUsed, last_literal, num_args, …) read straight from the payload, without validating them against the buffer bounds. isSerialized()/isUnserialized() are idempotency guards, not range checks. A crafted .bin carrying the current build's system_id (a build fingerprint, not an authenticator; adler32 is forgeable) would therefore be an FFI arbitrary read/write primitive if an application ever feeds an untrusted binary into getReflection().
Scope:
Validate every stored offset against [0, memSize) (tagged/interned offsets against [0, strSize)), plus scriptOffset, each count field, and each dataAddress + i*size element range, before dereference — throw truncatedFile/unsupportedPayload on violation.
Document the trust model in docs/opcache-binary.md: .bin input must come from a trusted source; system_id is not authenticity; adler32 is not integrity against a motivated attacker.
Optional: offer a keyed-MAC integrity check for the "distribute protected binaries" use case.
No security label exists in this repo; flagging the security nature here in the title/body.
Activity
feat(opcache): bounds-validate relocation offsets and document the tr…