Skip to content

AI powered OSINT engine to discover and map 840+ social media identities across the web

fix(correlate): stop the searched handle from chaining every profile together

arxhr0071dc886a598d9
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c639667..cd0e325 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,23 @@
# Changelog
+## 2.5.0 (2026-09-18)
+
+### Fixed
+- **`--correlate` merged almost everything into one "same person" cluster.** Correlation
+ linked two profiles when one bio @-mentioned the handle the other was found under. In a
+ scan of a single handle, every profile was found under that handle, and many sites echo it
+ in page chrome (Twitter: *"The latest posts from @handle"*). One such page therefore linked
+ itself to every other profile: a live scan produced a 228-profile cluster, 227 of whose
+ links ran through Twitter alone. Mentions of a searched handle no longer count. Two bios
+ mentioning the same *other* handle still link, as does a mention across two different
+ searched handles.
+- Display names that are just the site's brand (og:title "Flickr" on `flickr.albums`) no
+ longer link sibling pages of the same service.
+
+### Added
+- `aliens_eye.api.correlate()` also returns `profiles`: every profile considered, with its
+ avatar hash, so callers can apply their own linkage rules on top of the clusters.
+
## 2.4.0 (2026-09-18)
### Security
diff --git a/pyproject.toml b/pyproject.toml
index 38072c1..ee6c49f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "aliens-eye"
-version = "2.4.0"
+version = "2.5.0"
description = "AI-powered OSINT username scanner across 800+ social media and web platforms"
readme = "README.md"
requires-python = ">=3.10"
diff --git a/src/aliens_eye/__init__.py b/src/aliens_eye/__init__.py
index 935ae96..b33e931 100644
--- a/src/aliens_eye/__init__.py
+++ b/src/aliens_eye/__init__.py
@@ -1,3 +1,3 @@
"""Aliens Eye - AI-powered OSINT username scanner."""
-__version__ = "2.4.0"
+__version__ = "2.5.0"
diff --git a/src/aliens_eye/api.py b/src/aliens_eye/api.py
index e4042cd..3d7626f 100644
--- a/src/aliens_eye/api.py
+++ b/src/aliens_eye/api.py
@@ -129,7 +129,11 @@ async def correlate(
timeout: float = 10.0,
allow_private_avatars: bool = False,
) -> dict[str, Any]:
- """Cluster the report's Found/Maybe profiles that look like the same person.
+ """Cluster the report's Found profiles that look like the same person.
+
+ Returns ``clusters`` (multi-site groups with the reasons they linked) and
+ ``profiles`` -- every profile considered, with its avatar hash -- so callers
+ can apply their own, stricter linkage on top.
Avatar URLs are scraped from the pages themselves, so they are fetched only
when they resolve to public addresses. ``allow_private_avatars`` lifts that,
@@ -142,4 +146,5 @@ async def correlate(
proxy=proxy,
timeout=timeout,
allow_private_avatars=allow_private_avatars,
+ include_profiles=True,
)
diff --git a/src/aliens_eye/core/correlate.py b/src/aliens_eye/core/correlate.py
index 7027bb1..1a33d1b 100644
--- a/src/aliens_eye/core/correlate.py
+++ b/src/aliens_eye/core/correlate.py
@@ -258,6 +258,41 @@ class _UnionFind:
self.parent[rb] = ra
+def _handle_link(a: Profile, b: Profile) -> bool:
+ """Whether @-mentions tie two profiles together.
+
+ Mentions of a handle that was *searched* carry no signal. Every profile in a
+ scan of one handle was found under it, and many sites echo it in page chrome
+ -- Twitter's description is "The latest posts from @handle". Counting that
+ let a single such page link itself to every other profile in the scan: a
+ live scan produced one 228-profile cluster, 227 of whose links ran through
+ Twitter alone.
+
+ So only two things count: both bios mentioning the same *third* handle, or a
+ bio mentioning the handle the *other* profile was found under when the two
+ were found under different handles.
+ """
+ own_a, own_b = a.variation.lower(), b.variation.lower()
+ searched = {own_a, own_b} - {""}
+ if (a.handles - searched) & (b.handles - searched):
+ return True
+ if own_a and own_b and own_a != own_b:
+ return own_a in b.handles or own_b in a.handles
+ return False
+
+
+def _is_brand(norm_name: str, site: str) -> bool:
+ """Whether a display name is just the site's own brand.
+
+ A page with no real profile often carries the service's name as og:title
+ ("Flickr" on flickr.albums), which is structured metadata but not an
+ identity. Matching two of those linked sibling pages of the same service.
+ """
+ name = norm_name.replace(" ", "")
+ site_key = "".join(_WORD_RE.findall((site or "").lower()))
+ return bool(name) and bool(site_key) and (site_key.startswith(name) or name.startswith(site_key))
+
+
def _pair_reason(
a: Profile, b: Profile, common_names: frozenset[str] = frozenset()
) -> str | None:
@@ -275,10 +310,13 @@ def _pair_reason(
return "avatar"
if a.links & b.links:
return "shared-link"
- if a.handles & b.handles or (a.variation and a.variation in b.handles) or (b.variation and b.variation in a.handles):
+ if _handle_link(a, b):
return "handle"
na, nb = _norm_name(a.name), _norm_name(b.name)
- if na and na == nb and len(na) > 3 and na not in common_names:
+ if (
+ na and na == nb and len(na) > 3 and na not in common_names
+ and not _is_brand(na, a.site) and not _is_brand(nb, b.site)
+ ):
return "name"
if _jaccard(_tokens(a.bio), _tokens(b.bio)) >= BIO_MIN_JACCARD:
return "bio"
@@ -336,18 +374,23 @@ async def correlate_report(
proxy: str | None = None,
timeout: float = 10.0,
allow_private_avatars: bool = False,
+ include_profiles: bool = False,
) -> dict[str, Any]:
"""Full correlation pass over a report dict. Returns a ``correlation`` block.
``allow_private_avatars`` lifts the guard that stops scraped avatar URLs
resolving to private or loopback addresses; only set it when scanning a
- network you own.
+ network you own. ``include_profiles`` adds every considered profile, with its
+ avatar hash, not just those that landed in a multi-site cluster.
"""
profiles = profiles_from_report(report)
await hash_avatars(profiles, proxy=proxy, timeout=timeout, allow_private=allow_private_avatars)
clusters = cluster_profiles(profiles)
- return {
+ result: dict[str, Any] = {
"avatar_hashing": pillow_available(),
"profiles_considered": len(profiles),
"clusters": clusters,
}
+ if include_profiles:
+ result["profiles"] = [p.to_dict() for p in profiles]
+ return result
diff --git a/tests/test_api.py b/tests/test_api.py
index 7d89351..3ea6f8f 100644
--- a/tests/test_api.py
+++ b/tests/test_api.py
@@ -133,3 +133,22 @@ async def test_quiet_scan_does_not_silence_the_global_console(site_server): # n
after = get_console()
assert after is before
assert not after.quiet
+
+
+async def test_correlate_returns_every_profile_with_its_hash(monkeypatch):
+ """Callers need hashes for unclustered profiles too, to apply stricter linkage."""
+ import aliens_eye.core.correlate as correlate_mod
+
+ async def no_download(profiles, **kwargs):
+ for p in profiles:
+ p.avatar_hash = 0xFFFF000011112222
+
+ monkeypatch.setattr(correlate_mod, "hash_avatars", no_download)
+ report = {"variations": {"arx": {"sites": {
+ "github": {"status": "Found", "url": "https://github.com/arx",
+ "ai_analysis": {"signals": {"profile": {"name": "", "bio": "", "avatar": "x"}}}},
+ }}}}
+ result = await api.correlate(report)
+ assert result["clusters"] == []
+ assert result["profiles"][0]["site"] == "github"
+ assert result["profiles"][0]["avatar_hash"] == "ffff000011112222"
diff --git a/tests/test_new_features.py b/tests/test_new_features.py
index df07296..07d0ae8 100644
--- a/tests/test_new_features.py
+++ b/tests/test_new_features.py
@@ -355,3 +355,55 @@ def test_blocked_avatar_is_never_downloaded(monkeypatch):
)
asyncio.run(_download_and_hash(ExplodingSession(), profile, timeout=1.0))
assert profile.avatar_hash is None
+
+
+# --- correlation: handle-mention chaining (regression) --------------------
+
+
+def test_mentioning_the_searched_handle_links_nothing():
+ """One page echoing @handle in its chrome linked itself to every profile.
+
+ Live scan: Twitter's description is "The latest posts from @handle", and a
+ single-handle scan produced a 228-profile cluster through that one page.
+ """
+ twitter = Profile("arx", "twitter", name="", bio="The latest posts from @arx",
+ avatar="", url="", status="Found")
+ words = ["cats", "chess", "piano", "rust", "hiking", "coffee", "jazz", "vim", "linux", "ramen",
+ "surf", "birds", "golang", "poetry", "tennis", "maps", "space", "fonts", "tea", "yoga"]
+ # Distinct bios, so nothing but the handle mention could possibly link them.
+ others = [Profile("arx", f"site{i}", name="", bio=f"{word} enthusiast{i}", avatar="",
+ url="", status="Found") for i, word in enumerate(words)]
+ assert cluster_profiles([twitter, *others]) == []
+
+
+def test_two_bios_mentioning_the_same_third_handle_still_link():
+ a = Profile("arx", "s1", name="", bio="work at @acmecorp", avatar="", url="", status="Found")
+ b = Profile("arx", "s2", name="", bio="engineer @acmecorp", avatar="", url="", status="Found")
+ [cluster] = cluster_profiles([a, b])
+ assert "handle" in cluster["reasons"]
+
+
+def test_mention_across_different_searched_handles_still_links():
+ """b, found under 'aaron.t', points at 'arx': real evidence of one owner."""
+ a = Profile("arx", "github", name="", bio="", avatar="", url="", status="Found")
+ b = Profile("aaron.t", "reddit", name="", bio="main account @arx", avatar="", url="", status="Found")
+ [cluster] = cluster_profiles([a, b])
+ assert "handle" in cluster["reasons"]
+
+
+def test_a_brand_title_is_not_a_shared_name():
+ """og:title 'Flickr' on flickr and flickr.albums is the service, not a person."""
+ profiles = [
+ Profile("arx", "flickr", name="Flickr", bio="", avatar="", url="", status="Found"),
+ Profile("arx", "flickr.albums", name="Flickr", bio="", avatar="", url="", status="Found"),
+ ]
+ assert cluster_profiles(profiles) == []
+
+
+def test_real_shared_names_still_link():
+ profiles = [
+ Profile("arx", "github", name="Aaron Thomas", bio="", avatar="", url="", status="Found"),
+ Profile("arx", "gitlab", name="Aaron Thomas", bio="", avatar="", url="", status="Found"),
+ ]
+ [cluster] = cluster_profiles(profiles)
+ assert cluster["reasons"] == ["name"]