[Bug] Admin IPC accepts malformed request bytes that admin HTTP rejects
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Accessibilité débutants
- 70/100
- Type d'issue
- Bug
- Clarté
- Clairement spécifiée
- Activité
- Active
- Stack technique
- java
- Domaine
- backend-api-design
Piste de recherche
Read IpcRequestHandler.readRequest, IpcService.handleClient, and IpcRequestHandler.handleCommand, then compare their input handling with AdminRpcServlet and AdminJsonRpcRequestHandler.handleRequest. Reproduce the malformed-byte request using the commands in the issue. Done means IPC and admin HTTP reject the same invalid UTF-8 or surrounding control characters with -32700, without calling the method.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Bug Description
Admin IPC changes a request's bytes before it parses them. Invalid UTF-8 inside the request is replaced with U+FFFD, and control characters before or after the JSON object are removed, so admin_example runs with input the client didn't send. Admin HTTP passes the same bytes to the parser unchanged and returns -32700.
Environment
Network
Mainnet configuration, local node started with --p2p-disable true
Software Versions
OS: Fedora 44, Linux 7.2.9-200.fc44.x86_64
JVM: Temurin 1.8.0_504 amd64
Git Commit: 2d99513742d92af4f7b5f68791d809582a9e4549
Version: 4.8.2.3
Code: 18830
Configuration
FullNode built from release_v4.8.3 with the shipped config.conf plus node.admin.ipc.enable = true and node.admin.http.enable = true.
Expected Behavior
The same request bytes get the same reply over IPC and admin HTTP. A request that isn't valid UTF-8 JSON gets -32700 and the method isn't called.
Actual Behavior
Over IPC, a request with an 0xff byte inside a string runs admin_example and returns a result with U+FFFD where the 0xff byte was. Over admin HTTP the same bytes return -32700. A truncated UTF-8 sequence behaves the same way. A NUL after the object or a vertical tab before it also succeeds over IPC and returns -32700 over HTTP. The node logs nothing for any of these IPC requests.
Frequency
- Always (100%)
- Frequently (>50%)
- Sometimes (10-50%)
- Rarely (<10%)
Steps to Reproduce
- Start a FullNode with
node.admin.ipc.enable = trueandnode.admin.http.enable = true. - Send a request with an 0xff byte inside a string over IPC, then the same bytes to admin HTTP.
printf '{"jsonrpc":"2.0","method":"admin_example","params":["a\xffb","b"],"id":7}\n' | socat - UNIX-CONNECT:output-directory/ipc/<pid>.sock
printf '{"jsonrpc":"2.0","method":"admin_example","params":["a\xffb","b"],"id":7}' | curl -s -H 'Content-Type: application/json' --data-binary @- http://127.0.0.1:8575/admin
Logs and Error Messages
IPC {"jsonrpc":"2.0","id":7,"result":"a�b:b"}
HTTP {"jsonrpc":"2.0","id":null,"error":{"code":-32700,"message":"JSON parse error"}}
The � in the IPC reply is U+FFFD, sent as the bytes EF BF BD.
Additional Context (Optional)
Possible Solution
IpcRequestHandler.readRequest decodes the line into a String, IpcService.handleClient trims it, and IpcRequestHandler.handleCommand encodes it again before calling AdminJsonRpcRequestHandler.handleRequest. AdminRpcServlet calls the same method with the raw body. Passing the IPC line bytes straight through, without the trim, gives both transports the same input.
- Langage dominant
- Java
- Étoiles
- 4.2k
- Forks
- 1.8k
- Merge moyen
- 2 j 15 h
- PR mergées (30 j)
- 41
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Propose un modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de tronprotocol/java-tron
-
type:feature
Difficulté 4/5 3-5 jours Accessibilité débutants 35/100
tronprotocol/java-tron#7013 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Feature] Validate ECKey inputs and improve key handlingPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertetype:feature
Difficulté 4/5 3-5 jours Accessibilité débutants 40/100
tronprotocol/java-tron#6994 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
type:feature
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 25/100
tronprotocol/java-tron#6989 · 7 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Feature] decouple json-rpc filter processing from ManagerPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertetype:feature
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 48/100
tronprotocol/java-tron#6963 · 8 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
[Feature] Remove unused SM2/SM3 crypto enginePeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertetype:feature
Difficulté 5/5 Plus d'une semaine Accessibilité débutants 28/100
tronprotocol/java-tron#6959 · 3 commentaires ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de tronprotocol/java-tron
Issues similaires
-
maintenance
Difficulté 2/5 1-3 heures Accessibilité débutants 83/100
apache/maven-resources-plugin#569 ·
Les mainteneurs répondent en général sous 1 jour
-
Data Sources visit drilldown returns an empty visitDurationByType for Achilles 1.7+ results (query still reads analysis 211)Peut-être pris @DG47 l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
Les mainteneurs répondent en général sous 1 jour
-
BUG
Difficulté 2/5 1-3 heures Accessibilité débutants 77/100
camel-tooling/camel-language-server#1482 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
micronaut-projects/micronaut-redis#844 ·
Les mainteneurs répondent en général sous 4 jours