Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
97d66e7
fix(security): close the 20 leads of the 2026-11 security audit
fabiodalez-dev Nov 13, 2026
555879a
fix(security): stop the style rewrite where the parser and the scanne…
fabiodalez-dev Nov 13, 2026
a60f7fe
fix(security): park sheets in foreign content where both readings agr…
fabiodalez-dev Nov 13, 2026
b044512
fix(security): park a sheet carrying "&" in foreign or <select> conte…
fabiodalez-dev Nov 13, 2026
c9b450c
fix(security): review fixes for the 2026-11 audit branch
fabiodalez-dev Nov 14, 2026
21ae1ed
fix(security): the canonical-host check strips exactly one trailing dot
fabiodalez-dev Nov 14, 2026
abf4700
fix(security): the banner template repair saves https URLs, and the m…
fabiodalez-dev Nov 14, 2026
1db0c33
fix(security): the style walk reads RAW as own keys and stops on scri…
fabiodalez-dev Nov 14, 2026
f628aec
fix(security): judge decoded sheets in foreign context, a real mail-l…
fabiodalez-dev Nov 14, 2026
857f8ef
fix(security): in foreign context the style walk stops only at a "<" …
fabiodalez-dev Nov 14, 2026
99c7263
fix(security): a foreign-context sheet is judged on its decoded readi…
fabiodalez-dev Nov 14, 2026
2a24ea0
fix(security): the Do-Not-Sell mail count is a compare-and-swap, and …
fabiodalez-dev Nov 15, 2026
5c45e8c
test: pin the kept same-origin sheet, the first-window race and a con…
fabiodalez-dev Nov 15, 2026
3b0ca5f
test: a mixed foreign sheet sends no request on the safety release, i…
fabiodalez-dev Nov 15, 2026
01ae1c3
fix(consent): restore parks made by another response once the server …
fabiodalez-dev Nov 15, 2026
8da2a08
test(e2e): the per-service consent spec seeds the detected cookies it…
fabiodalez-dev Nov 15, 2026
7f25139
fix: keep IP verdicts address-specific and retry park verification
fabiodalez-dev Nov 19, 2026
a15dfc2
fix(dnsmpi): bound the opt-out audit row on a shared address, and sur…
fabiodalez-dev Nov 20, 2026
4ce9adb
fix(security): review follow-up on the park proofs, the shared opt-ou…
fabiodalez-dev Nov 21, 2026
0cbd434
fix(geo): take the ipinfo lookup budget atomically, on both cache bac…
fabiodalez-dev Nov 21, 2026
f138804
fix(consent): the late-park watcher honours the GDPR pre-choice gate,…
fabiodalez-dev Nov 21, 2026
185d670
test(geo): the object-cache stubs of two suites add and increment whe…
fabiodalez-dev Nov 21, 2026
e0d8fab
fix(geo): object-cache budget counters always expire, and a dropped c…
fabiodalez-dev Nov 21, 2026
0ae97d2
fix(geo): a lost object-cache counter is created already spent, in a …
fabiodalez-dev Nov 21, 2026
80145c8
fix(consent): a park confirmed after the gate shut again is keyed but…
fabiodalez-dev Nov 21, 2026
aa1fd5f
fix(geo): a window counter evicted between add and incr is put back a…
fabiodalez-dev Nov 21, 2026
9808085
docs(geo): state the add/incr eviction race as a documented limit
fabiodalez-dev Nov 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
114 changes: 66 additions & 48 deletions .github/workflows/pullfrog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,54 +34,10 @@ jobs:
# fails (its rate limit is per account, so a busy week can exhaust it).
# Empty when the secret is not set: then there is no second run.
HAS_OAUTH_FALLBACK: ${{ secrets.PULLFROG_OAUTH_FALLBACK != '' }}
# add at least one provider API key
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_GENERATIVE_AI_API_KEY:
${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
META_MODEL_API_KEY: ${{ secrets.META_MODEL_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}

# for Amazon Bedrock (https://docs.pullfrog.com/bedrock)
# AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: us-east-1
# BEDROCK_MODEL_ID: <bedrock-model-id>

# for Google Vertex AI (https://docs.pullfrog.com/vertex)
# VERTEX_SERVICE_ACCOUNT_JSON: >-
# ${{ secrets.VERTEX_SERVICE_ACCOUNT_JSON }}
# GOOGLE_CLOUD_PROJECT: my-project
# VERTEX_LOCATION: global
# VERTEX_MODEL_ID: <vertex-model-id>

# for Azure OpenAI (https://docs.pullfrog.com/azure)
# AZURE_RESOURCE_NAME is the <name> in https://<name>.openai.azure.com
# AZURE_DEPLOYMENT is your deployment's name, not the model it serves
# AZURE_RESOURCE_NAME: my-resource
# AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
# AZURE_DEPLOYMENT: <deployment-name>
# both limits are required — set them to the real limits of that model
# AZURE_CONTEXT: "400000"
# AZURE_MAX_OUTPUT: "128000"

# for any OpenAI-compatible endpoint — LiteLLM, Cloudflare AI Gateway,
# self-hosted vLLM (https://docs.pullfrog.com/openai-compatible)
# OPENAI_COMPATIBLE_BASE_URL: https://litellm.example.com/v1
# OPENAI_COMPATIBLE_API_KEY: ${{ secrets.OPENAI_COMPATIBLE_API_KEY }}
# OPENAI_COMPATIBLE_MODEL: <model-id>
# both limits are required — set them to the real limits of that model
# OPENAI_COMPATIBLE_CONTEXT: "128000"
# OPENAI_COMPATIBLE_MAX_OUTPUT: "16384"
# Provider keys are NOT set here (2026-11 security audit): a job-level
# env reaches every step, checkout included, and these are long-lived
# paid credentials held next to an agent that reads pull-request text
# written by anyone. They are set on the two agent steps only.
permissions:
# The action mints a short-lived OIDC token to prove this run's identity
# to Pullfrog's own token service, which is how a Router or subscription
Expand Down Expand Up @@ -133,6 +89,55 @@ jobs:
# private some day cannot silently widen it — private repos default
# to `enabled`.
shell: restricted
env:
# add at least one provider API key
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_GENERATIVE_AI_API_KEY:
${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
META_MODEL_API_KEY: ${{ secrets.META_MODEL_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}

# for Amazon Bedrock (https://docs.pullfrog.com/bedrock)
# AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
# AWS_REGION: us-east-1
# BEDROCK_MODEL_ID: <bedrock-model-id>

# for Google Vertex AI (https://docs.pullfrog.com/vertex)
# VERTEX_SERVICE_ACCOUNT_JSON: >-
# ${{ secrets.VERTEX_SERVICE_ACCOUNT_JSON }}
# GOOGLE_CLOUD_PROJECT: my-project
# VERTEX_LOCATION: global
# VERTEX_MODEL_ID: <vertex-model-id>

# for Azure OpenAI (https://docs.pullfrog.com/azure)
# AZURE_RESOURCE_NAME is the <name> in https://<name>.openai.azure.com
# AZURE_DEPLOYMENT is your deployment's name, not the model it serves
# AZURE_RESOURCE_NAME: my-resource
# AZURE_API_KEY: ${{ secrets.AZURE_API_KEY }}
# AZURE_DEPLOYMENT: <deployment-name>
# both limits are required — set them to the real limits of that model
# AZURE_CONTEXT: "400000"
# AZURE_MAX_OUTPUT: "128000"

# for any OpenAI-compatible endpoint — LiteLLM, Cloudflare AI Gateway,
# self-hosted vLLM (https://docs.pullfrog.com/openai-compatible)
# OPENAI_COMPATIBLE_BASE_URL: https://litellm.example.com/v1
# OPENAI_COMPATIBLE_API_KEY: ${{ secrets.OPENAI_COMPATIBLE_API_KEY }}
# OPENAI_COMPATIBLE_MODEL: <model-id>
# both limits are required — set them to the real limits of that model
# OPENAI_COMPATIBLE_CONTEXT: "128000"
# OPENAI_COMPATIBLE_MAX_OUTPUT: "16384"

- name: Run agent with the fallback subscription token
id: agent_fallback
Expand All @@ -143,7 +148,20 @@ jobs:
push: disabled
shell: restricted
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
CLAUDE_CODE_OAUTH_TOKEN: ${{ secrets.PULLFROG_OAUTH_FALLBACK }}
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
GOOGLE_GENERATIVE_AI_API_KEY:
${{ secrets.GOOGLE_GENERATIVE_AI_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
XAI_API_KEY: ${{ secrets.XAI_API_KEY }}
DEEPSEEK_API_KEY: ${{ secrets.DEEPSEEK_API_KEY }}
MOONSHOT_API_KEY: ${{ secrets.MOONSHOT_API_KEY }}
KIMI_API_KEY: ${{ secrets.KIMI_API_KEY }}
META_MODEL_API_KEY: ${{ secrets.META_MODEL_API_KEY }}
OPENROUTER_API_KEY: ${{ secrets.OPENROUTER_API_KEY }}
AI_GATEWAY_API_KEY: ${{ secrets.AI_GATEWAY_API_KEY }}
OPENCODE_API_KEY: ${{ secrets.OPENCODE_API_KEY }}
# The first run's failure was held back by continue-on-error; when the
# fallback did not save it, the check reports it. The review is not a
# required check, so a red run never blocks a merge.
Expand Down
13 changes: 13 additions & 0 deletions admin/modules/banners/includes/class-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -1143,6 +1143,19 @@ public function clear_template( $clear = true ) {
public function get_assets_path( $path ) {
$base_name = wp_basename( $path );
$assets_url = defined( 'FAZ_APP_ASSETS_URL' ) ? FAZ_APP_ASSETS_URL : '';
// This URL is written into the shared template cache (update()), which
// anonymous requests regenerate — the public banner REST route among
// them — and which every later visitor is served. FAZ_APP_ASSETS_URL
// takes its scheme from faz_request_is_https(), which also trusts a
// client-sent X-Forwarded-Proto, so one anonymous request could persist
// https:// icon URLs on an http-only site (or the reverse) for everyone.
// Persist only a server-verified scheme; Frontend::banner_html() still
// upgrades the per-request render behind a TLS-terminating proxy.
if ( '' !== $assets_url && function_exists( 'set_url_scheme' ) ) {
$verified_https = ( function_exists( 'is_ssl' ) && is_ssl() )
|| 0 === stripos( (string) get_option( 'siteurl' ), 'https://' );
$assets_url = set_url_scheme( $assets_url, $verified_https ? 'https' : 'http' );
}
return $assets_url . $base_name;
}
/**
Expand Down
24 changes: 21 additions & 3 deletions admin/modules/consentlogs/includes/class-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,14 @@ public function log_consent( $data ) {
break;
}
$key = substr( sanitize_text_field( (string) $key ), 0, 190 );
// Keys are category slugs, svc.<id>, ck.<cookie name> and meta.*:
// printable ASCII. Anything outside it (a quote, a backslash,
// non-ASCII that wp_json_encode() turns into six-byte \u escapes)
// only lets an anonymous row grow several-fold or break out of
// its CSV field, so such a key is dropped.
if ( ! preg_match( '/^[\x21\x23-\x5B\x5D-\x7E]+$/', $key ) ) {
continue;
}
// Only yes/no scalars are valid. Skip nested arrays/objects before
// the string cast so a crafted payload can't trigger an
// array-to-string warning (or an object __toString fatal).
Expand Down Expand Up @@ -578,7 +586,12 @@ protected function resolve_geo_audit_fields( $data ) {
// are typically < 1 KB).
if ( isset( $data['tc_string'] ) && is_string( $data['tc_string'] ) ) {
$tc = sanitize_text_field( wp_unslash( $data['tc_string'] ) );
if ( '' !== $tc ) {
// Same rule as the GPP string below: a TC string is base64url
// segments joined by `.`, and a real one stays well under a few KB
// even with publisher restrictions. Anything else (a 64 KB blob, a
// quote, markup) is an anonymous client writing free text into the
// accountability record, and is not stored.
if ( '' !== $tc && strlen( $tc ) <= 8192 && preg_match( '/^[A-Za-z0-9_-]+(?:\.[A-Za-z0-9_-]*)*$/', $tc ) ) {
$out['tc_string'] = $tc;
}
}
Expand Down Expand Up @@ -1159,7 +1172,12 @@ private function write_csv( $handle, $args = array() ) {
),
',',
'"',
'\\'
// RFC 4180: no escape character, so an enclosure inside a value is
// always doubled. With '\\' PHP emitted \" undoubled and an anonymous
// consent_id / category key / tc_string containing \" closed its
// field in Excel, LibreOffice and Python's csv, shifting the columns
// and handing a split-off "=..." cell past sanitize_csv_cell().
''
);

// Stream in keyset-paginated batches instead of materialising the whole
Expand Down Expand Up @@ -1234,7 +1252,7 @@ private function write_csv( $handle, $args = array() ) {
),
',',
'"',
'\\'
'' // RFC 4180, see the header row above.
);
}
} while ( count( $items ) === $batch_size );
Expand Down
25 changes: 19 additions & 6 deletions admin/modules/cookies/api/class-cookies-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1295,14 +1295,27 @@ public static function sanitize_meta_for_current_user( $meta ) {
return $meta;
}

$decoded = $meta;
// Unwrap every JSON-string layer, not just the first. The readers
// decode more than once (Cookie_Controller::prepare_json, then
// Cookie::get_meta on the remaining string), so a meta value whose
// decoded form is itself the JSON text of an object used to pass this
// gate untouched and come out the other side with opt_in_script
// intact, ready to be re-serialised by the next privileged save.
$decoded = $meta;
$was_json_string = false;
if ( is_string( $meta ) ) {
$tentative = json_decode( $meta, true );
if ( is_array( $tentative ) ) {
$decoded = $tentative;
$was_json_string = true;
for ( $depth = 0; is_string( $decoded ) && $depth < 4; $depth++ ) {
$tentative = json_decode( $decoded, true );
if ( null === $tentative || JSON_ERROR_NONE !== json_last_error() ) {
break;
}
$decoded = $tentative;
$was_json_string = true;
}

// Still JSON after the depth bound: refuse rather than guess what a
// deeper reader would find. No legitimate meta is nested this deep.
if ( is_string( $decoded ) && null !== json_decode( $decoded, true ) ) {
return wp_json_encode( array() );
}

if ( ! is_array( $decoded ) ) {
Expand Down
17 changes: 16 additions & 1 deletion admin/modules/geo-routing/includes/class-geo-detector.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,22 @@ public function detect( $ip_override = null ) {
&& method_exists( '\\FazCookie\\Includes\\Geolocation', 'country_header_in_play' )
&& \FazCookie\Includes\Geolocation::country_header_in_play() );
if ( ! $from_header ) {
wp_cache_set( $ip_hash, $result, self::CACHE_GROUP, self::CACHE_TTL );
// A failed ipinfo lookup (refusal, budget, transport) leaves the VPN
// verdict unknown. Kept here for the full hour, the address would go
// without a VPN verdict long after ipinfo could answer again: it is
// kept for ERROR_TTL at most, and no longer than ipinfo says the
// failure lasts (`retry_after`: what is left of a refusal marker or
// of a spent hourly budget). A transport failure carries no
// `retry_after` and is kept for ERROR_TTL, so an outage does not
// cost every request a call up to the timeout.
$ttl = self::CACHE_TTL;
if ( isset( $vpn_result['source'] ) && 'error' === $vpn_result['source'] ) {
$ttl = min( self::CACHE_TTL, Ipinfo_Client::ERROR_TTL );
if ( isset( $vpn_result['retry_after'] ) && (int) $vpn_result['retry_after'] > 0 ) {
$ttl = min( $ttl, (int) $vpn_result['retry_after'] );
}
}
wp_cache_set( $ip_hash, $result, self::CACHE_GROUP, $ttl );
}
return $result;
}
Expand Down
Loading
Loading