Live demo · platform/gateway.py

ThreatShield Gateway

This page talks to the actual ThreatShield Gateway v1.0.0 from the GOLD workspace (GOLD/platform/gateway.py, Python stdlib only), running as a service and reached through a Cloudflare Tunnel and this site's same-origin /api/ proxy. Every result below is the gateway's real response — nothing is mocked or simulated.

Send a payload

The gateway threat-scores the request body: each injection-pattern class that matches adds 25 points (capped at 100). Score ≥ 70 → 403 BLOCKED; 35–69 → 200 with verdict WARN; below 35 → 200 ALLOW. Blocked requests are scored before the rate limiter runs.

Gateway response

No request sent yet. The gateway's exact HTTP status and JSON will appear here.

What it checks — the six pattern classes

ClassWhat matchesExample trigger
SQL tautologyA quote followed by OR/AND and a numeric equality — the classic always-true login bypass.' OR 1=1
SQL keywordsDROP, INSERT, SELECT, UPDATE, DELETE or UNION followed by whitespace.DROP TABLE
Path traversalParent-directory sequences, forward or back slash.../ · ..\
Cross-site scriptingAn opening script tag.<script>
Prototype pollutionA __proto__ key assignment in a JSON body."__proto__":
NoSQL injectionA MongoDB-style $where clause key."$where":

Rate limiting & metering — stated plainly

../../etc/passwd', proto:'{__proto__: {"admin": true}}', nosql:'{"user":"bob", $where: "this.password.length > 0"}' }; var calls=0; function setCounter(){document.getElementById('counter').textContent=calls?('Demo calls this tab: '+calls+' (gateway limit: 100 / 60s per key)'):'';} document.querySelectorAll('.chip').forEach(function(b){b.addEventListener('click',function(){ document.getElementById('payload').value=SAMPLES[b.getAttribute('data-sample')];});}); function health(){ var dot=document.getElementById('gw-dot'), st=document.getElementById('gw-status'); var ctl=new AbortController(); var t=setTimeout(function(){ctl.abort()},7000); fetch('/api/health',{signal:ctl.signal}).then(function(r){return r.json()}).then(function(j){ clearTimeout(t); if(j&&j.status==='ok'){dot.style.background='var(--green)';st.textContent='LIVE — v'+j.version+', component '+j.component+'.';} else{dot.style.background='var(--red)';st.textContent='UNAVAILABLE — unexpected health response.';} }).catch(function(){clearTimeout(t);dot.style.background='var(--red)';st.textContent='UNAVAILABLE — the gateway did not answer. This page will not fake a verdict while it is down.';}); } health(); document.getElementById('send').addEventListener('click',function(){ var body=document.getElementById('payload').value; var lic=document.getElementById('license').value.trim(); var headers={'Content-Type':'text/plain'}; if(lic) headers['X-JAVA1KIND-License']=lic; var res=document.getElementById('result'), raw=document.getElementById('raw'); res.innerHTML='

Sending…

'; raw.style.display='none'; fetch('/api/check',{method:'POST',headers:headers,body:body}).then(function(r){ return r.text().then(function(txt){return {status:r.status,txt:txt};}); }).then(function(o){ calls++; setCounter(); raw.style.display='block'; raw.textContent='HTTP '+o.status+' '+o.txt; var j=null; try{j=JSON.parse(o.txt);}catch(e){} if(!j){res.innerHTML='NON-JSON RESPONSE';return;} if(j.error==='BLOCKED'){res.innerHTML='BLOCKED Score '+j.score+'/100 — HTTP 403. Three or more pattern classes matched, so the gateway refused the payload before rate limiting.';} else if(j.error==='RATE_LIMITED'){res.innerHTML='RATE LIMITED — HTTP 429. This license key (or the anonymous bucket) exceeded 100 calls in 60 seconds.';} else if(j.error){res.innerHTML=''+j.error+' — see the raw response below.';} else{ var cls=j.verdict==='WARN'?'warn':'allow'; res.innerHTML=''+j.verdict+' Score '+j.score+'/100 — HTTP 200. '+(j.verdict==='WARN'?'One or two pattern classes matched: allowed through, flagged.':'No pattern class matched.'); var pct=Math.min(j.score,100); res.innerHTML+='
'; } }).catch(function(e){ res.innerHTML='GATEWAY UNREACHABLE — the request failed before a verdict ('+e.message+'). No result is shown because none exists.'; }); });