The Island in the River of Bureaucracy Between SPID and CIE

A tax identifier, a federation login, and a card with a chip solve different problems. Italy puts them in the same administrative journey. The citizen gets to discover the boundaries at the login screen.

Italy has more than one digital identity route. The citizen still gets the login screen, the recovery procedure, and the deadline.

Antonio Meucci filed his telephone caveat in 1871 and could not afford to renew it, according to the Library of Congress. The paperwork has its own history alongside the invention. SPID, Sistema Pubblico di Identità Digitale, puts another kind of paperwork between a citizen and a service, with an identity provider authenticating the person in between.

The passport is real. So is the codice fiscale. Moving back is always on the table, the hill town, the sea, the long table, the wine. The architecture is the argument for staying put, so this is the thing a dual-citizen engineer with a laptop can actually do: read it carefully and write it down. I can read the blueprint and compare it with CIE. No live provider was tested for this article.


SAML 2.0 Is a 2005 Fax Machine With a Certificate

At the protocol layer, SPID is built on SAML 2.0, a spec formalized in 2005, the same year YouTube launched and nobody had an iPhone. OpenID Connect is also a formal SPID integration path, not merely an SDK wrapper around XML. AgID adopted its OpenID Connect guidelines in 2021. The following discussion concerns the SAML path; an OIDC integration needs its own token and federation checks.

The loop: a citizen hits a government Service Provider, the SP mints a SAML AuthnRequest, the user gets bounced to their chosen Identity Provider, the IdP authenticates them and bounces back a signed XML assertion. That assertion is the keys to the kingdom, and it is a parser's nightmare. The relying service must validate the signature and consume the assertion it actually validated. A mismatch between those operations can turn a signed document into an identity decision about the wrong subject.

In XML signature wrapping, the verifier can validate a signed element while application code selects a different element for the identity decision. The boundary fails when verification and consumption disagree about which assertion is authoritative. A robust implementation must reject ambiguous structures and consume the exact validated assertion, with issuer, audience, recipient, request correlation, and time conditions checked as appropriate. This is a protocol-family failure mode, not a demonstrated vulnerability in a named SPID provider.

The selection boundary is small enough to exercise. The function below receives an ID from a separate trusted verifier, rejects multiple or relocated assertions, and consumes only the exact matching element:

from xml.etree import ElementTree as ET

SAML = "urn:oasis:names:tc:SAML:2.0:assertion"
PROTOCOL = "urn:oasis:names:tc:SAML:2.0:protocol"

def consume_verified_assertion(xml_bytes, verified_id):
    if not isinstance(xml_bytes, bytes) or len(xml_bytes) > 65536:
        raise ValueError("Expected at most 64 KiB of XML bytes")
    xml_text = xml_bytes.decode("utf-8")
    if "\x00" in xml_text:
        raise ValueError("Only UTF-8 XML text is accepted")
    if "<!DOCTYPE" in xml_text.upper() or "<!ENTITY" in xml_text.upper():
        raise ValueError("DTD/entity declarations rejected")
    root = ET.fromstring(xml_text)
    if root.tag != f"{{{PROTOCOL}}}Response":
        raise ValueError("Expected SAML Response")
    assertions = list(root.iter(f"{{{SAML}}}Assertion"))
    if len(assertions) != 1 or assertions[0] not in list(root):
        raise ValueError("Ambiguous or relocated assertion")
    matching = [node for node in root.iter() if node.get("ID") == verified_id]
    if len(matching) != 1 or matching[0] is not assertions[0]:
        raise ValueError("Verified element differs from consumed assertion")
    names = assertions[0].findall(f"{{{SAML}}}Subject/{{{SAML}}}NameID")
    if len(names) != 1 or not names[0].text:
        raise ValueError("Expected exactly one subject NameID")
    return names[0].text

The complete replay accepts one authored citizen assertion and rejects an extra leading assertion, missing verified ID, relocation and a duplicate ID on another element. Recorded results.

python3 assertion_selection_check.py

This isolates selection, not cryptography. It does not verify XMLDSig, authenticate an issuer or implement SPID's schema, audience, destination, request and time rules. The ID must come from the verifier's actual validated result, never a client parameter. The point of the old wrapping diagram is now an executable parser check: the element you validated must be the element you use.

XXE injection, signature wrapping, DOM confusion are textbook failure modes of exactly the protocol family Italy chose to put millions of legal identities on. The protocol date does not establish a vulnerability. A review needs the deployed library, configuration, and validation behavior. A procurement document naming SAML supplies none of those results.


The Tax Code Was Never a Secret, and They Built the Whole Fortress Anyway

Two designs, opposite assumptions about secrecy.

In the US, the Social Security Number is the holy grail because the credit system is private, decentralized, and matches on name + DOB + SSN with no human in the loop. Steal the number, spin up a phantom, drain it before the victim notices. The number is treated as a secret, so the entire fraud economy is built on the fact that it leaks.

The codice fiscale is the opposite. Its standard alphanumeric form is derived from biographical fields, but the valid identifier is assigned by the tax authority. A local calculation produces a base candidate, not confirmation of the assigned code. Collisions, known as omocodia, and official record details can change the result. Name and birthday alone also omit sex and the birthplace code. The following function computes the base candidate for restricted ASCII inputs:

from datetime import date
import re

MONTH = {1:'A',2:'B',3:'C',4:'D',5:'E',6:'H',
         7:'L',8:'M',9:'P',10:'R',11:'S',12:'T'}

def _consonants(s): return [c for c in s if c not in 'AEIOU']
def _vowels(s):     return [c for c in s if c in 'AEIOU']

def _name_code(s, is_first_name=False):
    if not isinstance(s, str) or not re.fullmatch(r"[A-Za-z '\-]+", s):
        raise ValueError('Use the recorded ASCII name; no transliteration is inferred')
    s = ''.join(ch for ch in s.upper() if 'A' <= ch <= 'Z')
    if not s:
        raise ValueError('Name must contain letters')
    cons, vow = _consonants(s), _vowels(s)
    if is_first_name and len(cons) >= 4:        # the one special case
        cons = [cons[0], cons[2], cons[3]]
    code = (cons + vow + ['X', 'X', 'X'])[:3]
    return ''.join(code)

# Odd/even position tables — also public, also not a secret.
ODD = {**{str(i): v for i, v in enumerate(
        [1,0,5,7,9,13,15,17,19,21])},
       **dict(zip("ABCDEFGHIJKLMNOPQRSTUVWXYZ",
        [1,0,5,7,9,13,15,17,19,21,2,4,18,20,11,3,6,8,12,14,16,10,22,25,24,23]))}
EVEN = {**{str(i): i for i in range(10)},
        **{c: i for i, c in enumerate("ABCDEFGHIJKLMNOPQRSTUVWXYZ")}}

def codice_fiscale(surname, name, year, month, day, sex, belfiore):
    """Compute a base candidate, not an officially assigned identifier."""
    if any(type(v) is not int for v in (year, month, day)):
        raise ValueError('Date fields must be integers')
    date(year, month, day)
    if not isinstance(sex, str) or sex.upper() not in {'M', 'F'}:
        raise ValueError('Recorded sex code must be M or F')
    if not isinstance(belfiore, str) or not re.fullmatch(r'[A-Za-z][0-9]{3}', belfiore):
        raise ValueError('Expected one letter and three digits for a base place code')
    cf  = _name_code(surname)
    cf += _name_code(name, is_first_name=True)
    cf += f"{year % 100:02d}"
    cf += MONTH[month]
    cf += f"{day + (40 if sex.upper() == 'F' else 0):02d}"   # women: day + 40
    cf += belfiore.upper()
    total = sum((ODD if i % 2 == 0 else EVEN)[ch] for i, ch in enumerate(cf))
    return cf + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"[total % 26]

def checksum_valid(value):
    """Check alphanumeric format/checksum only, never registry assignment."""
    if not isinstance(value, str):
        return False
    value = value.upper()
    pattern = r'[A-Z]{6}[0-9LMNPQRSTUV]{2}[ABCDEHLMPRST][0-9LMNPQRSTUV]{2}[A-Z][0-9LMNPQRSTUV]{3}[A-Z]'
    if not re.fullmatch(pattern, value):
        return False
    total = sum((ODD if i % 2 == 0 else EVEN)[ch]
                for i, ch in enumerate(value[:15]))
    return value[-1] == 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'[total % 26]

# Synthetic calculation fixture; no registry lookup or identity claim.
assert codice_fiscale('Rossi', 'Mario', 1985, 12, 10, 'M', 'A562') == 'RSSMRA85T10A562S'
assert checksum_valid('RSSMRA85T10A562S')
assert not checksum_valid('RSSMRA85T10A562A')
assert not checksum_valid('not-an-identifier')
for bad in ((1985, 2, 30, 'M', 'A562'), (1985, 12, 10, 'X', 'A562'),
            (1985, 12, 10, 'M', 'INVALID')):
    try:
        codice_fiscale('Rossi', 'Mario', *bad)
    except ValueError:
        continue
    raise AssertionError('Invalid input accepted')

The block ran locally on October 25, 2026. Seven checks passed: candidate calculation, accepted checksum, rejected altered checksum, rejected malformed string, and three rejected invalid inputs. The downloadable Python file contains the same code and checks. Run it with python3 codice_fiscale_checks.py; successful assertions produce no output. Checksum acceptance establishes neither a real person nor an official assignment. The format check accepts the standard letter substitutions used in omocodia, but does not obtain or assign a collision variant. It does not resolve historical place codes, transliterate names, assign collision variants, handle provisional numeric identifiers, or query official records. The Agenzia delle Entrate's verification service checks registered identifiers; its technical service specification explicitly handles base-code collisions and updated assignments.

Knowing an identifier does not authenticate its holder. It also does not make identity fraud impossible. Enrollment, recovery, document checks, and the service accepting the identity each need examination. A public calculation cannot establish that every Italian financial institution treats the result correctly.

The political objection remains: an identifier used to join records can make a citizen's activities easier to correlate. Establishing that correlation requires the actual logs, access rules, and data flows. A login on its own does not prove that every lease, car registration, or paycheck is sent to one central record.

The authentication assertion establishes what the provider says about a login at a stated assurance level. The receiving service still decides which action that identity may perform. Approval of a grant, a lease, or a financial transaction needs its own authorization and fraud controls.

For the surveillance question, ask what each operator records: identity, relying service, time, device signals, and retention. Then ask who can query those records and under what authority. That is the route from the login screen to the profile. It has to be traced, not inferred from the existence of a tax code.

Distributed trust, separate operators

There is no government bunker. SPID is a federation, and identity providers authenticate users under AgID accreditation and technical rules. Providers can differ in implementation and dependencies. That does not establish that every provider stores biometrics or runs its own data center. The current official provider comparison is the source for available operators and enrollment methods, rather than a frozen list in this article.

AgID, the technical wing of the Prime Minister's office, issues the guidelines and the audits. Transport security, public-key infrastructure, and multiple assurance levels. The controls on paper are fine. The problem is not the controls. The problem is the topology:

Every accepted provider adds an integration and a signing-key trust relationship to examine. A compromised provider may issue assertions for identities and services within its accepted scope. That does not automatically expose every other provider's records. Determine the accepted issuer, key, audience, attributes, and affected identities before counting the blast radius.

The repository review has to be as specific. Name the package, release, open issue, deployed version, and affected integration. A stale wrapper can be a maintenance problem; it does not prove that a production provider runs that wrapper. I have not established a deployment-wide inventory here. The provider's AgID accreditation obligations and the code actually deployed remain separate things to inspect.

The incident needs an owner

A provider has to handle its own accounts, signing keys, recovery, and service continuity. A relying service has to validate assertions and control its sessions. A response that spans them needs contacts and decisions assigned before the first phone call.

For an exercise, record who can suspend an affected credential or signing key, update trusted metadata, expire existing sessions, notify users, and restore a legitimate login. Measure the sequence. Counting organizations in an org chart does not measure response latency, and a web application firewall does not settle whether the application consumed the right assertion.

The surveillance cases have different entry points

In June 2025, Citizen Lab published forensic confirmation of Paragon's Graphite spyware in a European journalist's device and examined cases involving Italian journalists. Its report distinguishes device compromise, targeting notifications, and unresolved attribution. A spyware vendor's nationality does not establish who operated a particular intrusion.

The Milan Equalize dossier investigation concerns another route: alleged unauthorized access to confidential records and their use in dossiers. The Milan prosecutor general's 2026 judicial-year report refers to the investigation into alleged dossier activity. That reference establishes an investigation, not a final judgment or a demonstrated SPID exploit.

The phone and the database are worth keeping in the same threat model, with their entry points still attached. A compromised phone can expose a person's communications. Misused database access can expose records. Neither case, on the evidence cited here, establishes that an attacker forged a SPID assertion or captured the federation.

For a SPID-specific finding, I would want the affected provider or service, the vulnerable component, the access obtained, and the resulting record or action. A list of foreign intelligence groups cannot substitute for those details.


Authoritarianism by Accident, Then on Purpose

A missed deadline remains a missed deadline when the login failure belongs to somebody else. The citizen spends the afternoon on recovery and still has to finish the task.

Nobody needs a volcano lair for administrative friction to hurt. Put a deadline behind an unreliable access path, make recovery slow, and the person waiting carries the cost. The failed login and the waiting citizen are visible. A claim about procurement motives needs the tender and the decisions behind it.

The dependency becomes harder to ignore when the alternative route disappears:

A deadline arrives. The authentication app fails. The citizen spends the afternoon recovering access instead of completing the task. Repeat that often enough and the administrative friction consumes real time. That is the experience this argument concerns. Establishing that officials deliberately exploit it would require evidence beyond the failed login.

A flawless system is invisible. A broken mandatory system forces you to think about the state every single day, and spends the exact cognitive budget you'd otherwise use to organize, build off-grid, or push back. The MFA push that desyncs, the portal that 500s during a deadline, the lockout from one administrative glitch, the friction is the control surface. Where no practical alternative exists, an access failure becomes a barrier to the service itself. Which alternatives are available has to be checked service by service; this article does not establish a universal legal requirement to use SPID.


They Already Have a Better One: It's Called CIE

CIE, Carta d'Identità Elettronica, is the state-issued electronic identity card. Its chip matters, but “tap the card” does not describe every CIE login.

At level 3, the flow uses the card and PIN through a compatible reader or NFC device. Levels 1 and 2 use previously created credentials and, where required, a second factor without reading the card for each login. The Ministry of Interior's CIE access documentation distinguishes them. A comparison with SPID has to name the assurance level and enrollment/recovery path being compared.

CIE also has a server-side federation layer. The Entra con CIE manual describes CieID Server as both a SAML 2.0 server and an OpenID Provider, maintained by the Istituto Poligrafico e Zecca dello Stato. The card can protect key operations while a service still relies on federation assertions. Hardware possession and federated login can coexist.

For IT-Wallet, the government's project page describes Documenti su IO access using CieID or SPID. That does not support the claim that all wallet credentials derive from the CIE chip. A wallet's issued documents, holder authentication, and verifier disclosures need separate analysis.

I prefer having a card-bound path available. I also want to know what happens when the reader fails, the phone is lost, the recovery route opens, or the citizen needs an alternative. The chip doesn't answer those questions on its own. No SPID shutdown date is established by the sources cited here.


CIE Isn't Free of Architecture, Either

Every system has soft spots; the honest question is which threat model is cheaper to live with.

Centralized issuance. The Ministry of Interior holds the root. SPID distributes identity provision across accredited providers; CIE consolidates authentication under one ministry. State capture of the root is a different shape than vendor capture of a federation, smaller, but not zero, and concentrated politically in a way the federation hides.

Reader and device requirements. Level 3 needs compatible card-reading hardware and software. Levels 1 and 2 offer other flows. Availability and recovery should be tested against the actual level the service requires, not inferred from the presence of an NFC chip.

Biometric storage on the chip. The chip stores the photograph and fingerprints, as described in the Ministry of Interior documentation. Architecturally that's the right place; the threat-model question is what happens when chip-extraction techniques become practical. Chip storage and authorized biometric-reading rules need separate examination. Storage on a secure element does not by itself establish that data can never be read out under any authorized inspection path.

Single political pressure point. Whoever controls the Ministry of Interior controls authentication. That's a different concentration than SPID's, and it's the one the architecture openly admits to. Federations hide concentration; CIE makes you look at it.

The transition itself. SPID still in production, CIE rolling out, IT-Wallet adding a layer, several identity and wallet components operating in parallel is a state of higher attack surface than a finished migration would be. The transition window is the period to watch, and Italy is years deep in it.


What I'd Put on Italy's Whiteboard, On Top of CIE

CIE supplies a card-based authentication path. The following are design proposals, not a description of capabilities established by this article. Each needs an enrollment model, recovery path, and protocol-level evidence.

The proposed privacy layer would let a citizen prove an attribute, such as meeting an age threshold, while limiting unnecessary disclosure. Whether a particular design hides the relying party from the issuer depends on its issuance, presentation, revocation, and network protocols. No two-second performance measurement or deployed zero-knowledge integration is demonstrated here.

  1. Zero-knowledge by default. Even with CIE, the IdP knows which service was accessed. When the citizen proves over 18 or holds a valid health card, the auth layer should issue a cryptographic yes/no, and the central store should learn nothing about which service asked. Function without surveillance is ZKPs, deployable for years.
  2. Card-bound keys with an explicit federation boundary. Keep the hardware operation distinct from the server-issued assertion and its validation. This is a phone-security boundary, the device becomes the trust root, so the device has to actually be trustworthy.
  3. Document the operators and dependencies. State issuance does not remove server, software, infrastructure, and supplier dependencies. The remaining ask is open-sourcing the IT-Wallet client and letting the eIDAS 2 layer interoperate honestly with the rest of the EU instead of bolting another Italian-only convention on top.
  4. Build the offline safety valve into the law. Every digital public service keeps a fully functioning anonymous offline path, by statute. Grandmother pays cash at the tabaccheria. The artisan trades favors without a token. Convenience, never coercion. Honor the hustle the country was built on.

The question that shocks the compliance reflex isn't about EU checkboxes:

A 2005 identity system in the deepfake era. When synthetic faces walk through biometric push and automated systems replay stolen credentials, name the mechanism by which funneling millions of people into one architecture protects any single one of them.

The answer belongs in the enrollment, assertion-validation, recovery, and incident records. I would ask to see them.


The Name Came From a Committee

It happens in families long before it happens in government. One side arrives with names ready. The other side steps in with something safe. What lands on the documents is the compromise nobody actually chose, a naming committee, a bureaucratic override, an identifier assigned by the people holding the paperwork instead of the people holding the love.

That is the feeling I bring to the login screen: somebody else chose the identifier, the process, and the recovery queue. Keep the heart. Keep the survival instinct. Drop the part the committee assigned.

CIE offers another path through that paperwork. Choosing it still requires checking the assurance level, federation operator, recovery process, and service integration. The country gets its citizen on the books. The citizen gets a card with a chip in it, not a recurring identity subscription to whichever IdP outsourced its DevOps to the lowest bidder.

The phreakers didn't hack the phone network. They understood it better than the people who built it, and they wrote it down. The work is the same.


Technical correction, October 25, 2026: distinguished calculated tax-code candidates from assigned identifiers, added input checks and local fixtures, and corrected CIE assurance levels, federation, and wallet access. Removed non-executable metaphor code. Attribution follow-up separates the documented spyware and dossier investigations from unproven SPID compromise, corrects the Meucci chronology, and distinguishes political argument from procurement or legal findings.

GhostInThePrompt.com // The state computed the identifier, rented the storage to a vendor, and billed the friction back as security.