Skip to content

Commit 7117d75

Browse files
author
Prayank
committed
Update 'Secure string handling'
Add information about possible path traversal attack with example
1 parent f4ac48d commit 7117d75

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

doc/JSON-RPC-interface.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,14 @@ RPC interface will be abused.
8888
- **Secure string handling:** The RPC interface does not guarantee any
8989
escaping of data beyond what's necessary to encode it as JSON,
9090
although it does usually provide serialized data using a hex
91-
representation of the bytes. If you use RPC data in your programs or
92-
provide its data to other programs, you must ensure any problem
93-
strings are properly escaped. For example, multiple websites have
94-
been manipulated because they displayed decoded hex strings that
95-
included HTML `<script>` tags. For this reason, and other
96-
non-security reasons, it is recommended to display all serialized data
97-
in hex form only.
91+
representation of the bytes. If you use RPC data in your programs or
92+
provide its data to other programs, you must ensure any problem strings
93+
are properly escaped. For example, the `createwallet` RPC accepts
94+
arguments such as `wallet_name` which is a string and could be used
95+
for a path traversal attack without application level checks. Multiple
96+
websites have been manipulated because they displayed decoded hex strings
97+
that included HTML `<script>` tags. For this reason, and others, it is
98+
recommended to display all serialized data in hex form only.
9899

99100
## RPC consistency guarantees
100101

0 commit comments

Comments
 (0)