Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

## Unreleased

- Audit profile entropy, canvas/audio consistency, timezone semantics, native
worker initialization, header coherence and storage teardown.
- Await proxy setup before target navigation and reject cross-tab identity access.
- Replace certificate-name trust with verified public-CA pinning; automatically
retrieve Burp's public CA through the explicitly selected local HTTP proxy.
- Move interception actions above the request editor and keep them visible
while scrolling; place Forward all beside the interceptor toggle.
- Add a session-only research workspace with include/exclude target scope and
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Built with Electron and Chromium for Windows, Linux, and macOS.

[Download](https://github.com/iMumd/fathi-browser/releases/latest) ·
[Research guide](docs/research-workspace.md) ·
[Identity audit](docs/identity-audit.md) ·
[Contribute](CONTRIBUTING.md) ·
[Changelog](CHANGELOG.md)

Expand Down Expand Up @@ -38,6 +39,11 @@ Research tools do not automatically crawl, scan, or attack targets. Passive
notes do not issue extra requests and are not confirmed vulnerability reports.
JWT inspection decodes claims; it does not verify their signature.

Use Burp also retrieves and validates the public CA from the local Burp listener
and pins it inside Fathi. No system-wide certificate installation is performed.
If retrieval fails, open Burp and retry Retrieve local Burp CA, or import its
public certificate manually. Remote proxy CAs are never fetched automatically.

## Privacy, with clear boundaries

- Browsing sessions, captured traffic, scope, toolbox input, and comparison
Expand Down
116 changes: 116 additions & 0 deletions docs/identity-audit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# Identity and isolation audit

Status: unreleased changes following 1.0.2. No release is published by this audit.

## Contract

A new tab and New identity allocate a fresh random profile and a fresh
non-persistent Electron session. Reloading the same tab keeps its identity and
storage stable. Different identities do not require every individual field to
change: two realistic Chrome profiles can share a UA, screen size, or core
count. Identity and noise material must be independently generated instead of
inventing impossible values merely to make every field different.

The generator uses independent cryptographic material for a 128-bit identity
seed and canvas/audio noise. Partition IDs use independent UUIDs. Renderer
supplied profiles are not reused. Profile lists and device GPU data are copied
so mutating one profile cannot change another.

## Findings addressed

- Canvas readout used a parity-only noise pattern and inconsistent seeds across
read and export APIs. Stable coordinate-based noise now agrees across
getImageData, PNG export, and OffscreenCanvas, including dedicated workers.
- Audio variation missed OfflineAudioContext results. AudioBuffer reads and
copyFromChannel now receive stable per-profile perturbations without repeated
drift. Tiny noise can affect audio applications; the preference can disable it.
- Date timezone-offset sign was reversed and explicit Intl timezones were
overwritten. Offsets, daylight saving, explicit UTC, and native page timezone
configuration are now checked.
- Native worker values could race profile installation. Guests initialize on
about:blank and target navigation waits for native identity and worker hooks.
- Chromium client hints leaked into Safari-shaped profiles, native header
spellings could coexist with spoofed ones, and Android model hints were empty.
- Chrome versions were randomly invented despite a fixed underlying engine.
Reported Chromium versions now match the installed engine. Device-memory
values respect Chromium's 8 GiB reporting cap; Intel Mac GPU profiles use x86.
- Plain arrays replaced PluginArray/MimeTypeArray, and device group IDs
contained a literal application marker. Native plugin arrays are preserved;
that marker is removed. OS speech-voice enumeration is minimized.
- Spoofing preferences were not propagated to new profiles. Changes now apply
to new tabs and New identity, without silently changing an existing profile.
- Proxy setup was not awaited before navigation. Initialization now waits, and
configured-proxy failures do not silently continue as successful preparation.
- Session teardown retained fingerprint/proxy mappings. Teardown now removes
those mappings, closes connections and clears auth, storage, cache and DNS
state before New identity continues.
- Guests cannot create/destroy arbitrary tab sessions or retrieve another
tab's fingerprint. Only known, non-persistent partitions can attach.
- The extension-install bridge is no longer exposed to arbitrary websites.

## Burp certificate trust

Previously, certificate issuer/subject names containing Burp or PortSwigger
could bypass verification. Names are not proof of trust. That path is removed.

Use Burp now configures the explicit loopback HTTP proxy and retrieves its
public CA from `http://burp/cert` through that proxy. The response must parse as
a currently valid CA certificate. Downloads are bounded to 64 KiB and five
seconds, do not follow redirects, and cannot use a remote or SOCKS proxy for
automatic retrieval. A manual public-certificate import remains available.

Trust is limited to the imported public CA, with signature-chain, validity,
hostname and server-auth usage checks. It only applies while proxy trust and
the proxy itself are enabled. Certificate names alone never suffice. The
public CA persists in proxy preferences; no CA private key is imported or
stored. Nothing is installed into the operating system trust store.

This workflow is tested with a generated local test CA and a loopback proxy
fixture. A live Burp installation is not part of the automated test environment.
Review the locally selected proxy: another process controlling that listener
can supply its own CA when you explicitly retrieve it. Retrieval does not
silently replace an existing pin on startup.

## Validation

`npm test` covers 2,000 independently generated profiles, mutation isolation,
timezone behavior, navigator/prototype agreement, header consistency, scoped
research tools and network history. Certificate tests generate temporary keys
with OpenSSL, test real signatures/hostnames, reject malformed certificates and
exercise the bounded local download. No test private keys are committed.

Run the application audit with:

```bash
npx electron . --fathi-e2e --fathi-identity-audit
```

The local HTTP fixture checks early page scripts, cross-origin frames, workers,
on-wire identity, canvas/audio stability and differences, storage isolation
(cookies, localStorage, IndexedDB and CacheStorage), reload stability, and New
identity teardown. E2E uses temporary preferences. The broader E2E suite also
visits example.com. Runtime checks here are executed locally on Windows; CI
unit checks run on Windows, Linux and macOS. This is not a claim of independent
third-party certification or identical runtime coverage on every platform.

## Important limits

- Fathi remains Chromium. An iOS/Safari profile does not turn it into WebKit;
CSS behavior, TLS/HTTP transport, fonts, codecs and API implementations can
reveal the real engine or host. System fonts are not virtualized.
- This is profile emulation and session isolation, not a guarantee that every
fingerprint surface is covered or that automation cannot be detected.
- Main-world wrappers are observable. Sophisticated pages may detect them.
Service-worker startup, nested worker chains, worklets and all browser
extensions are not comprehensively audited by these tests.
- Worker initialization shares the recorder's debugger connection. Opening
DevTools can detach it; worker protections are not guaranteed while another
debugger owns the target. Avoid that during privacy-sensitive browsing.
- A new fingerprint does not change a direct public IP, account identity,
server-side identifiers, downloaded files, exported data or clipboard history.
Proxy rotation changes only what the configured proxy actually provides.
- WebRTC non-proxied UDP is disabled per guest, but this is not a blanket
guarantee against every possible network-side correlation channel.

Treat these limits as part of the product contract, not as reasons to label a
profile fully anonymous or undetectable.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"license": "MIT",
"main": "src/main/main.js",
"scripts": {
"test": "node tools/check-syntax.js && node --test tools/test-research.js tools/test-network.js && node tools/test-rules.js",
"test": "node tools/check-syntax.js && node --test tools/test-research.js tools/test-network.js tools/test-identity.js tools/test-certificate.js && node tools/test-rules.js",
"start": "electron .",
"icons": "node tools/make-icons.js && node tools/make-installer-art.js",
"dist:win": "electron-builder --win nsis portable --x64 --publish never",
Expand Down
25 changes: 25 additions & 0 deletions src/main/burp-ca.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
'use strict';
const http = require('node:http');
const { parseCa } = require('./certificate-trust');
/** Fetch only through the explicitly selected loopback HTTP proxy. */
function fetchCa(entry) {
if (!entry || entry.scheme !== 'http' || !['127.0.0.1', 'localhost', '[::1]', '::1'].includes(entry.host.toLowerCase())) return Promise.reject(new Error('Automatic CA import requires a loopback HTTP Burp proxy'));
return new Promise((resolve, reject) => {
const headers = { Host: 'burp', Connection: 'close' };
if (entry.username) headers['Proxy-Authorization'] = 'Basic ' + Buffer.from(`${entry.username}:${entry.password || ''}`).toString('base64');
const request = http.request({ hostname: entry.host.replace(/^\[|\]$/g, ''), port: entry.port, method: 'GET', path: 'http://burp/cert', headers, agent: false }, (response) => {
if (response.statusCode !== 200) { response.resume(); reject(new Error('Burp did not return a CA certificate')); return; }
const chunks = []; let size = 0;
response.on('data', (chunk) => {
size += chunk.length;
if (size > 65536) { request.destroy(new Error('CA certificate exceeds 64 KiB')); return; }
chunks.push(chunk);
});
response.on('error', reject);
response.on('end', () => { try { resolve(parseCa(Buffer.concat(chunks))); } catch (error) { reject(error); } });
});
request.setTimeout(5000, () => request.destroy(new Error('Burp CA download timed out. Confirm Burp is listening locally.')));
request.on('error', reject); request.end();
});
}
module.exports = { fetchCa };
34 changes: 34 additions & 0 deletions src/main/certificate-trust.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'use strict';
const { X509Certificate } = require('node:crypto');
const { isIP } = require('node:net');
function valid(cert) { const now = Date.now(); return now >= Date.parse(cert.validFrom) && now <= Date.parse(cert.validTo); }
function parseCa(data) {
const ca = new X509Certificate(data);
if (!ca.ca || !valid(ca)) throw new Error('Select a currently valid CA certificate');
return ca;
}
function verifies(request, pem) {
try {
const root = parseCa(pem);
const leaf = new X509Certificate(request.certificate.data);
if (!valid(leaf) || !(isIP(request.hostname) ? leaf.checkIP(request.hostname) : leaf.checkHost(request.hostname))) return false;
const usages = leaf.keyUsage;
if (usages?.length && !usages.includes('1.3.6.1.5.5.7.3.1') && !usages.includes('2.5.29.37.0')) return false;
let node = request.certificate;
const seen = new Set();
for (let depth = 0; node && depth < 10; depth++) {
const cert = new X509Certificate(node.data);
if (!valid(cert) || seen.has(cert.fingerprint256)) return false;
seen.add(cert.fingerprint256);
if (cert.fingerprint256 === root.fingerprint256) return true;
if (cert.checkIssued(root) && cert.verify(root.publicKey)) return true;
const issuer = node.issuerCert;
if (!issuer) return false;
const next = new X509Certificate(issuer.data);
if (!next.ca || !cert.checkIssued(next) || !cert.verify(next.publicKey)) return false;
node = issuer;
}
} catch {}
return false;
}
module.exports = { parseCa, verifies };
5 changes: 5 additions & 0 deletions src/main/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ async function run(win) {
JSON.stringify(about));

/* ---- 3. second tab gets a different partition */
if (process.argv.includes('--fathi-identity-audit')) {
trace('identity isolation audit');
const checks = await require('./identity-checks').run(ui);
for (const check of checks) add(check.name, check.pass, check.detail);
}
const updateUi = await ui.executeJavaScript(`(async () => {
openSettings('proxy');
const port = document.getElementById('tor-port');
Expand Down
28 changes: 15 additions & 13 deletions src/main/fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,14 +182,16 @@ function randHex(bytes) { return crypto.randomBytes(bytes).toString('hex'); }
function generate(opts) {
const options = typeof opts === 'string' ? { seed: opts } : (opts || {});
const device = devices.get(options.deviceId);
const seed = options.seed ? hash32(String(options.seed)) : crypto.randomBytes(4).readUInt32LE(0);
const rng = mulberry32(seed);
const material = options.seed ? crypto.createHash('sha256').update(String(options.seed)).digest() : crypto.randomBytes(32);
const seed = material.subarray(0, 16).toString('hex');
const rng = mulberry32(material.readUInt32LE(0));

const osKey = pickWeighted(rng, Object.keys(OS_PROFILES));
const os = OS_PROFILES[osKey];
const lang = pick(rng, LANG_POOL);
const ver = REAL_CHROME - Math.floor(rng() * 7); // last ~7 majors
const fullVer = `${ver}.0.${6482 + Math.floor(rng() * 60)}.${40 + Math.floor(rng() * 90)}`;
// The JavaScript engine cannot become an older Chrome build by changing UA.
const ver = REAL_CHROME;
const fullVer = process.versions.chrome || `${ver}.0.0.0`;

const ua = `Mozilla/5.0 (${os.uaOs}) AppleWebKit/537.36 (KHTML, like Gecko) ` +
`Chrome/${ver}.0.0.0 Safari/537.36`;
Expand All @@ -199,8 +201,8 @@ function generate(opts) {

const gpu = pick(rng, os.gpus);
const cores = pick(rng, os.cores);
const memory = pick(rng, os.memory);
const plugins = pick(rng, PLUGIN_SETS);
const memory = Math.min(8, pick(rng, os.memory));
const plugins = PLUGIN_SETS[0].slice();
const platformVersion = pick(rng, os.platformVersions);

const brands = shuffle(rng, [
Expand Down Expand Up @@ -233,7 +235,7 @@ function generate(opts) {
productSub: '20030107',
oscpu: undefined,
language: lang.language,
languages: lang.languages,
languages: lang.languages.slice(),
doNotTrack: null,
hardwareConcurrency: cores,
deviceMemory: memory,
Expand All @@ -247,7 +249,7 @@ function generate(opts) {
uaMobile: false,
uaDataPlatform: os.uaDataPlatform,
platformVersion,
architecture: os.architecture,
architecture: osKey === 'mac' && /Intel/.test(gpu.r) ? 'x86' : os.architecture,
bitness: os.bitness,
wow64: os.wow64,

Expand All @@ -264,13 +266,13 @@ function generate(opts) {

// graphics / media
webgl: { vendor: gpu.v, renderer: gpu.r },
canvasSeed: Math.floor(rng() * 0xFFFFFFFF),
audioSeed: Math.floor(rng() * 0xFFFFFFFF),
canvasSeed: material.readUInt32LE(16),
audioSeed: material.readUInt32LE(20),
fonts,
plugins,

// misc
timezone: lang.timezone,
timezone: new Intl.DateTimeFormat('en-US', { timeZone: lang.timezone }).resolvedOptions().timeZone,
timezoneOffsetBase: 0,
colorScheme: rng() > 0.28 ? 'light' : 'dark',
pdfViewerEnabled: true,
Expand Down Expand Up @@ -338,11 +340,11 @@ function applyMobileProfile(fp, device, rng, chromeMajor) {
};

// ---- graphics
fp.webgl = device.gpu;
fp.webgl = { ...device.gpu };

// ---- hardware
fp.hardwareConcurrency = isIOS ? pick(rng, [6]) : pick(rng, [8, 8, 8]);
fp.deviceMemory = isIOS ? 8 : pick(rng, [4, 6, 8]);
fp.deviceMemory = isIOS ? undefined : pick(rng, [4, 8]);
fp.pdfViewerEnabled = true;
fp.cookieEnabled = true;
fp.connection = {
Expand Down
Loading
Loading