aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/bugs.json35
-rw-r--r--docs/bugs.rst17
2 files changed, 29 insertions, 23 deletions
diff --git a/docs/bugs.json b/docs/bugs.json
index 839ea128..cf03adfe 100644
--- a/docs/bugs.json
+++ b/docs/bugs.json
@@ -1,21 +1,22 @@
[
- {
- "name": "EventStructWrongData",
- "summary": "Using structs in events logged wrong data.",
- "description": "If a struct is used in an event, the address of the struct is logged instead of the actual data.",
- "introduced": "0.4.17",
- "fixed": "0.5.0",
- "severity": "very low"
- },
- {
- "name": "NestedArrayFunctionCallDecoder",
- "summary": "Calling functions that return multi-dimensional fixed-size arrays can result in memory corruption.",
- "description": "If Solidity code calls a function that returns a multi-dimensional fixed-size array, array elements are incorrectly interpreted as memory pointers and thus can cause memory corruption if the return values are accessed. Calling functions with multi-dimensional fixed-size arrays is unaffected as is returning fixed-size arrays from function calls. The regular expression only checks if such functions are present, not if they are called, which is required for the contract to be affected.",
- "introduced": "0.1.4",
- "fixed": "0.4.22",
- "severity": "medium",
- "check": {"regex-source": "returns[^;{]*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\]\\s*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\][^{;]*[;{]"}
- },
+ {
+ "name": "EventStructWrongData",
+ "summary": "Using structs in events logged wrong data.",
+ "description": "If a struct is used in an event, the address of the struct is logged instead of the actual data.",
+ "introduced": "0.4.17",
+ "fixed": "0.5.0",
+ "severity": "very low",
+ "check": {"ast-compact-json-path": "$..[?(@.nodeType === 'EventDefinition')]..[?(@.nodeType === 'UserDefinedTypeName' && @.typeDescriptions.typeString.startsWith('struct'))]"}
+ },
+ {
+ "name": "NestedArrayFunctionCallDecoder",
+ "summary": "Calling functions that return multi-dimensional fixed-size arrays can result in memory corruption.",
+ "description": "If Solidity code calls a function that returns a multi-dimensional fixed-size array, array elements are incorrectly interpreted as memory pointers and thus can cause memory corruption if the return values are accessed. Calling functions with multi-dimensional fixed-size arrays is unaffected as is returning fixed-size arrays from function calls. The regular expression only checks if such functions are present, not if they are called, which is required for the contract to be affected.",
+ "introduced": "0.1.4",
+ "fixed": "0.4.22",
+ "severity": "medium",
+ "check": {"regex-source": "returns[^;{]*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\]\\s*\\[\\s*[^\\] \\t\\r\\n\\v\\f][^\\]]*\\][^{;]*[;{]"}
+ },
{
"name": "OneOfTwoConstructorsSkipped",
"summary": "If a contract has both a new-style constructor (using the constructor keyword) and an old-style constructor (a function with the same name as the contract) at the same time, one of them will be ignored.",
diff --git a/docs/bugs.rst b/docs/bugs.rst
index 6f315a65..f7522183 100644
--- a/docs/bugs.rst
+++ b/docs/bugs.rst
@@ -57,13 +57,18 @@ conditions
means that the optimizer has to be switched on to enable the bug.
If no conditions are given, assume that the bug is present.
check
- This field contains JavaScript regular expressions that are to be matched
- against the source code ("source-regex") to find out if the
- smart contract contains the bug or not. If there is no match,
- then the bug is very likely not present. If there is a match,
- the bug might be present. For improved accuracy, the regular
- expression should be applied to the source code after stripping
+ This field contains different checks that report whether the smart contract
+ contains the bug or not. The first type of check are Javascript regular
+ expressions that are to be matched against the source code ("source-regex")
+ if the bug is present. If there is no match, then the bug is very likely
+ not present. If there is a match, the bug might be present. For improved
+ accuracy, the checks should be applied to the source code after stripping
comments.
+ The second type of check are patterns to be checked on the compact AST of
+ the Solidity program ("ast-compact-json-path"). The specified search query
+ is a `JsonPath <https://github.com/json-path/JsonPath>`_ expression.
+ If at least one path of the Solidity AST matches the query, the bug is
+ likely present.
.. literalinclude:: bugs.json
:language: js