Ruby: StackTraceExposure: add test for a specific rescue type

This commit is contained in:
Nick Rolfe 2022-11-24 14:08:34 +00:00
Родитель 1c407a28cd
Коммит 50b10be2db
2 изменённых файлов: 8 добавлений и 0 удалений

Просмотреть файл

@ -4,7 +4,9 @@ nodes
| StackTraceExposure.rb:6:18:6:28 | call to backtrace | semmle.label | call to backtrace |
| StackTraceExposure.rb:11:10:11:17 | call to caller : | semmle.label | call to caller : |
| StackTraceExposure.rb:12:18:12:19 | bt | semmle.label | bt |
| StackTraceExposure.rb:18:18:18:28 | call to backtrace | semmle.label | call to backtrace |
subpaths
#select
| StackTraceExposure.rb:6:18:6:28 | call to backtrace | StackTraceExposure.rb:6:18:6:28 | call to backtrace | StackTraceExposure.rb:6:18:6:28 | call to backtrace | $@ can be exposed to an external user. | StackTraceExposure.rb:6:18:6:28 | call to backtrace | Error information |
| StackTraceExposure.rb:12:18:12:19 | bt | StackTraceExposure.rb:11:10:11:17 | call to caller : | StackTraceExposure.rb:12:18:12:19 | bt | $@ can be exposed to an external user. | StackTraceExposure.rb:11:10:11:17 | call to caller | Error information |
| StackTraceExposure.rb:18:18:18:28 | call to backtrace | StackTraceExposure.rb:18:18:18:28 | call to backtrace | StackTraceExposure.rb:18:18:18:28 | call to backtrace | $@ can be exposed to an external user. | StackTraceExposure.rb:18:18:18:28 | call to backtrace | Error information |

Просмотреть файл

@ -12,4 +12,10 @@ class FooController < ApplicationController
render body: bt, content_type: "text/plain"
end
def show3
not_a_method()
rescue NoMethodError => e
render body: e.backtrace, content_type: "text/plain"
end
end