Repository navigation
Commit b5c9f51
committed
Read each piece of code once, and turn confirmed findings into rules
Code reasoning now runs after each scan on every branch that gets code
scanning: the default branch when the code pass ran on it, and any branch
whose scan scope gives it every pass. A branch still on the commit it was
last read at is not fetched. On a branch that moved, only handlers whose
code or access check helpers changed are asked about. Answers are reused
across forks and copies by digest, an unreadable answer is tried twice and
then left until the code changes, and a provider outage is not held against
the code. The per repository setting now limits new questions per scan,
and handlers past it are read on later scans instead of never. Cached
findings keep the right line after lines are added above them. Each
connection has an AI code reasoning switch, on by default.
When the pass confirms a high finding, the model drafts one semgrep rule for
that kind of mistake and language, once. The draft is run by semgrep before
it is offered: it has to match the handler it came from, miss the fixed
version, and stay under eight matches in that repository. Drafts are listed
on the AI page switched off, and reach scans only once an administrator turns
them on. Their tokens count against the reasoning monthly limit.
Sixteen built in rules cover what a pattern can see without reasoning: JWT
signature checks switched off or the algorithm read from the token, secrets
compared with == in Python, JavaScript and PHP, tokens from a non secure
random, request bodies poured into models, a Django REST view set open to
anybody, request forgery checks switched off or exempted with no signature
check, model output handed to a shell or a query, and exception text from
broad or database errors returned to the caller. Each was run over real code
and every false alarm found is a test case.1 parent 366af17 commit b5c9f51
14 files changed
Lines changed: 1476 additions & 63 deletions
File tree
- app
- core
- web
- templates
- config
- documentation
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
121 | | - | |
122 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
123 | 124 | | |
124 | 125 | | |
125 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
310 | 310 | | |
311 | 311 | | |
312 | 312 | | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| |||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
1735 | 1739 | | |
1736 | 1740 | | |
1737 | 1741 | | |
| |||
2025 | 2029 | | |
2026 | 2030 | | |
2027 | 2031 | | |
| 2032 | + | |
| 2033 | + | |
| 2034 | + | |
| 2035 | + | |
| 2036 | + | |
| 2037 | + | |
| 2038 | + | |
| 2039 | + | |
| 2040 | + | |
| 2041 | + | |
| 2042 | + | |
| 2043 | + | |
| 2044 | + | |
| 2045 | + | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
| 2050 | + | |
| 2051 | + | |
| 2052 | + | |
| 2053 | + | |
| 2054 | + | |
| 2055 | + | |
| 2056 | + | |
| 2057 | + | |
| 2058 | + | |
| 2059 | + | |
| 2060 | + | |
| 2061 | + | |
| 2062 | + | |
| 2063 | + | |
| 2064 | + | |
| 2065 | + | |
| 2066 | + | |
| 2067 | + | |
| 2068 | + | |
| 2069 | + | |
| 2070 | + | |
| 2071 | + | |
| 2072 | + | |
| 2073 | + | |
| 2074 | + | |
| 2075 | + | |
| 2076 | + | |
| 2077 | + | |
| 2078 | + | |
| 2079 | + | |
| 2080 | + | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
| 2085 | + | |
| 2086 | + | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
2028 | 2090 | | |
2029 | 2091 | | |
2030 | 2092 | | |
| |||
0 commit comments