Skip to content

fix: no third-party requests on page view; literal % and _ in searches - #184

Merged
velixio merged 26 commits into
mainfrom
fix/real-data-findings
Nov 19, 2026
Merged

velixio merged 26 commits into
mainfrom
fix/real-data-findings

Conversation

@velixio

@velixio velixio commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator

Builds on #183 (real-backend journey and fixes). Merge #183 first.

1. No third-party requests on page view

Requests from the web app to a non-relative origin, found by grepping apps/web/src, index.html and public:

Where Request Loaded without a click? Now
pages/login.tsx api.github.com/repos/... (star count) yes, on /login and /setup removed; the plain GitHub link stays
pages/workbook-editor.tsx, pages/leads.tsx google.com/s2/favicons?domain= per row yes, sent every domain in the table to Google local Globe icon
pages/lead-detail.tsx, components/quick-look/quick-look.tsx same favicon service yes initials
pages/lead-detail.tsx nominatim.openstreetmap.org geocoding and tile.openstreetmap.org tiles yes, leaked the lead address map loads after a click ("Show map (loads openstreetmap.org)")
components/markdown-content.tsx, quick-look image remote <img> no: isSafeImageSrc and safeUrl already block non-same-origin images unchanged
plain <a href="https://..."> links (GitHub, OpenStreetMap, a lead's website, the login page credits) navigation only n/a unchanged
public/source-logos/manifest.json URLs are attribution text for logos that are bundled n/a unchanged

Fonts are bundled; index.html loads only local scripts. The events stream and workbook socket are same-origin.

a11y gate: installMocks now records any request to an origin other than the page's own; every covered route and a new /login test fail if there is one. Before the change the /login test failed on api.github.com; after, all 53 a11y tests pass.

2. Literal % and _ in search terms

  • New internal/sqllike (Escape, Contains) used by the record search (records/store.go, now ILIKE $3 ESCAPE '\', parameterised) and the workbook row query (wbcrud, which already escaped with /, now through the same helper).
  • sqlc queries leads_list.sql and leads_read.sql (search and specialization filters, 17 ILIKEs) escape in SQL, the way emaildata.sql already did; sqlc generate re-run.
  • Audit of every LIKE/ILIKE in the Go backend: the other uses are fixed patterns (%@gmail.com, watch:%:pollnow: and similar).
  • Audit of SQL built by concatenation: every value from a request goes through placeholders. The concatenated pieces are column names from allow-lists (wbcrud/leadupdate.go, leadswrite, collect/bulk.go), fixed table names (records, watchsvc, audiencerefresh) and a validated role name (migrate). I found nothing that is not parameterised.
  • Behaviour change: two recorded Python-era vectors (specialization = IT_Staffing and %, 20 cases in testdata/leads_vectors.json) relied on wildcard matching. Their expected results now reflect literal matching (% matches nothing; IT_Staffing matches the one row that has it). The generator in legacy/python would produce the old values if re-run.

Tests

  • go test ./internal/sqllike ./internal/wbcrud: ok. go test -tags integration ./internal/leadsread ./internal/records ./internal/wbcrud ./internal/audiencevalid against my own Postgres (the opengtm-e2e compose project): all ok. New cases: %, _, \, and str%e/s_ripe match nothing, 50%_o matches the one stored value containing it (records and leads).
  • bun run lint, bun test tests (204), bun run build, bun run test:a11y (53): pass.

Not tested

  • The Python vector generator was not re-run. Other databases than PostgreSQL 16. The map after clicking was not exercised in a browser.

…tegy

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Nine declarative manifests (Anymail Finder, Bouncer, MillionVerifier,
Findymail, ContactOut) with docs-derived fixtures and one generic test,
a wiring test across catalog, workbook and settings registries, and a
rewritten manifest format guide.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Replace every native confirm/prompt with useConfirm()/usePrompt() (focus managed, destructive style, named objects). Fix target-size at shared level via --gtm-target-min (accounts for the shell's CSS zoom), fix contrast and unnamed controls, add six routes to the axe gate, and empty the baseline.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…ls; changelog for the Go cutover

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…_verify words

response.value_maps translates a mapped value with an explicit default,
request.omit_empty drops empty headers, query parameters and body keys,
and values substituted into request.url are escaped. The three verifier
manifests now emit only valid, invalid, catch_all, risky, unknown.
Adds Settings key cards for LeadMagic and Prospeo.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Audience and automation delivery adds a lead to a HeyReach (LinkedIn) or lemlist (email) campaign with the workspace's own API key. Workbook output columns are not part of this change.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…ints

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Upserts each member as an Attio person matched on email and links or creates its company by domain, with the workspace's own token.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
… train/2026-11-19

# Conflicts:
#	apps/backend-go/internal/settings/registry.json
…11-19

# Conflicts:
#	apps/backend-go/internal/settings/registry.json
…rain/2026-11-19

# Conflicts:
#	apps/web/src/components/command-menu-content.tsx
Drives the built app against a running stack (setup, Get started, sample run,
every route in light and dark, one action per area), records API statuses,
console output and error states, and writes screenshots and findings.json.
Separate config and script; not part of test:a11y and not run in CI.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
…nalytics trend contrast

The mocked suite answered unmatched endpoints with [], so /overview, /analytics and
/settings rendered their error states (or a skeleton) and were never audited with
content. Add shapes captured from the real API, fail any page that shows an
error state, and wait for the query retry before auditing. The analytics page,
now rendered with data, exposed low-contrast trend text (emerald-500 and red-400
on white); use the 700/400 pair.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Loading the sample completes step 3, and done steps carry no actions, so
Open it from step 3 pointed at nothing. The workbook link is step 4's.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
The list search cast accepted_fields to text, so domain or name (or any
short term) matched every record. Search the values with jsonb_each_text.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Removed the GitHub star-count fetch from the login page (plain link stays),
replaced Google favicon requests with local icons or initials in the workbook,
legacy leads, lead detail and quick look, and made the lead-detail map
(Nominatim geocoding and OpenStreetMap tiles) load only after a click. The a11y
suite now fails any route, and /login, that requests another origin.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
Add internal/sqllike (Escape, Contains) and use it for the record search and
the workbook row query; the lead list and read queries (sqlc) get the same
escaping in SQL, as emaildata already had. A lone % used to match every row.
The two recorded lead vectors that relied on wildcard semantics (specialization
IT_Staffing and %) now expect literal matches. All other ILIKE/LIKE uses are
fixed patterns. Every query built from request input is parameterised; the few
concatenated identifiers (leads update columns, record table names) come from
allow-lists.

Signed-off-by: Shimul Debnath <270455167+velixio@users.noreply.github.com>
@velixio
velixio requested a review from debpalash as a code owner November 19, 2026 01:26
@github-actions

Copy link
Copy Markdown

All contributors on this pull request have signed the OpenGTM CLA. Thank you!

Agreement: OpenGTM CLA 1.0

@velixio
velixio merged commit 04d77ff into main Nov 19, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed All contributors signed the CLA

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant