Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

A client-side mortgage or loan pre-approval widget still ships its DTI and cutoff rules

Lenders like a pre-approval widget that feels instant: the borrower types income, debts, and a purchase price, and a green "likely approved" badge appears before a loan officer has seen the file. When the debt-to-income

Lenders like a pre-approval widget that feels instant: the borrower types income, debts, and a purchase price, and a green "likely approved" badge appears before a loan officer has seen the file. When the debt-to-income bands, the credit-score floors, the residual-income tables, and the "exception if flags X" rules all run in the browser, you have published the underwriting shortcut — and a way to shop the form until it says yes.

A competitor can read the same cutoffs you spent years calibrating. A determined applicant can hook the scorer and present a passing result to a later step that trusts the widget. Neither is acceptable if that badge is later treated as a credit decision, a rate lock, or a green light to collect sensitive documents.

What actually ships

A typical client-side pre-approval script includes:

  • Cutoff tables — DTI ceilings by product, loan-to-value bands, minimum scores, and residual-income floors.
  • Product eligibility — which programs are offered in which states, occupancy types, and property classes.
  • Compensating-factor shortcuts — "if reserves > N months, raise DTI by X" and similar overrides.
  • Decline and refer reasons — the exact messages and reason codes your team uses internally.
  • Rate or fee hints — even a coarse pricing grid is a map of how you compete.

The official application can still be submitted to a server. The function that decided "pre-approved" is often already in the bundle.

How it gets lifted

People search the bundle for strings like dti, maxLtv, preApproved, or a function named scoreApplication.

export const CUTOFFS = {
  conventional: { maxDti: 0.45, minScore: 620, maxLtv: 0.97, reservesMo: 2 },
  fha: { maxDti: 0.57, minScore: 580, maxLtv: 0.965, reservesMo: 1 },
  jumbo: { maxDti: 0.43, minScore: 700, maxLtv: 0.8, reservesMo: 6 },
};

export function preApprove(app) {
  const c = CUTOFFS[app.product];
  const dti = (app.debts + estimatedPayment(app)) / app.income;
  if (app.score < c.minScore) return { status: "decline", reason: "score-floor" };
  if (dti > c.maxDti && app.reservesMo < c.reservesMo + 6) {
    return { status: "refer", reason: "dti-exception" };
  }
  return { status: "likely-approved", dti };
}

Once CUTOFFS is public, the "FHA exception at 57%" is no longer a conversation with an underwriter. If a later page trusts status from localStorage or a query parameter, you have turned a marketing widget into a self-serve approval.

What actually protects you

Move credit decisions off the client

  • Authoritative eligibility belongs on the server, against the current overlays, the real credit pull, and a logged decision.
  • Unreleased products and exception paths should not be described in a public bundle at all.
  • Staff or broker overrides must be authorized server-side, not unlocked by a hidden field in the page.

Protect a local affordability hint if you still want one

A rough payment estimate can still run locally so the form feels fast. For that chunk:

  • Ship only presentational math (a payment formula, a generic "this may be tight" hint), not product cutoffs or reason codes.
  • Bundle the hint separately from the application and document-upload UI.
  • Apply stronger-than-mangling protection (control-flow flattening or VM-based compilation) to any table you still ship.
  • Leave source maps off the public CDN.
  • Re-decide, or at least confirm, eligibility on the server before you quote a rate, lock a price, or collect identity documents.

Do not treat the widget as an underwriter

If a later step proceeds because the page said likely-approved, anyone can write that string into storage. A pre-approval that matters needs a server that already made the call.

Practical checklist

  • [ ] Product eligibility, DTI ceilings, and score floors are evaluated or confirmed on the server.
  • [ ] Exception paths, overlays, and internal reason codes are not described in the public bundle.
  • [ ] Any local hint is limited to generic payment math, split from the application UI, and protected with stronger-than-Terser obfuscation.
  • [ ] Source maps for the scorer are not on the public CDN.
  • [ ] Hooking the widget cannot change a quoted rate, a lock, or a document-collection gate.
  • [ ] Decisions that matter for audit or fair-lending review are logged server-side.
  • [ ] The UI does not treat a localStorage status as a completed pre-approval.

Honest limits

Curious applicants will still try nearby income and debt figures and watch the badge change. Obfuscation does not hide a visible yes/no; it raises the cost of reading the cutoff table and forcing a pass. If a rule cannot be public, do not put it in JavaScript you send to every browser.

Summary

A client-side pre-approval widget ships the work that makes it powerful: the cutoffs, the exceptions, and the reason codes. Use a payment hint if you must, protect that chunk, and let the server be the only path that calls a borrower pre-approved.

Disclosure: I work on VEILVM, a JavaScript VM-protection service. Free browser tier (3 runs/day, up to 5 KB) and a Pro plan at $9/month or $79/year with API access. Try the playground at vm.ldvmp.com.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.