a2aproject / a2aproject/a2a-js

[Feat]: Integrated SSRF and DNS Rebinding Protection across all Transports

Aperta
#350 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
TypeScript
Stelle
613
Fork
169
Merge medio
1g 6h
PR unite (30g)
21

Descrizione

### Is your feature request related to a problem? Please describe.

The Gemini CLI team is integrating the A2A SDK to support remote agents. To meet production security standards, it is critical that the CLI is protected against Server-Side Request Forgery (SSRF) and DNS Rebinding attacks.

We believe these security guardrails should be a native part of the SDK to ensure all consumers are "secure by default."

### Describe the solution you'd like

Requested Features:
1. **Transport-Agnostic Connection Filtering:** A unified mechanism (e.g., a connectionInterceptor or lookup hook) in the ClientFactory that applies to all transports (REST, JSONRpc, and gRPC) to block access to private/internal IP ranges.
1. **DNS Rebinding Protection (IP Pinning):** Support for "pinning" a connection to the specific IP address resolved during the initial Agent Card discovery phase. This is necessary to prevent Time-of-Check/Time-of-Use (TOCTOU) attacks where an attacker swaps a hostname's DNS record between discovery and tool execution.
1. **Secure Card Validation:** Built-in validation in the DefaultAgentCardResolver to automatically reject agent cards if the card URL or any nested interface URLs point to restricted IP ranges.

### Describe alternatives you've considered

We attempted to implement these protections at the application layer, but found it impossible to achieve full coverage without "hacking" SDK internals—especially for gRPC, which does not respect the same connection-level hooks as HTTP-based transports.

### Additional context

_No response_

### Code of Conduct

- [x] I agree to follow this project's Code of Conduct

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Look at the ClientFactory and the transport implementations (REST, JSONRpc, gRPC) to understand how connections are made. The DefaultAgentCardResolver needs validation logic. Check for existing hooks or interceptors. The goal is to add IP filtering and DNS pinning across all transports, ensuring secure-by-default behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
nodejs, typescript
Ambito
backend-api-design, networking, security
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.