brakeman.ignore 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844
  1. {
  2. "ignored_warnings": [
  3. {
  4. "warning_type": "Remote Code Execution",
  5. "warning_code": 24,
  6. "fingerprint": "0fcd117fd53301f531142fc075ee8d30219c1239affce9322f9939ac0572ba3b",
  7. "check_name": "UnsafeReflection",
  8. "message": "Unsafe reflection method `constantize` called on model attribute",
  9. "file": "app/models/ticket/number.rb",
  10. "line": 45,
  11. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  12. "code": "Setting.get(\"ticket_number\").constantize",
  13. "render_path": null,
  14. "location": {
  15. "type": "method",
  16. "class": "Ticket::Number",
  17. "method": "Ticket::Number.adapter"
  18. },
  19. "user_input": "Setting.get(\"ticket_number\")",
  20. "confidence": "Medium",
  21. "cwe_id": [
  22. 470
  23. ],
  24. "note": "Setting.get(\"ticket_number\") returns defined ticket number backend class names"
  25. },
  26. {
  27. "warning_type": "Denial of Service",
  28. "warning_code": 76,
  29. "fingerprint": "15d4ddbc3ac2ae0a0fe27218a42a1920fe2c1868ae5f504422c4af8ffe893beb",
  30. "check_name": "RegexDoS",
  31. "message": "Model attribute used in regular expression",
  32. "file": "app/models/channel/filter/monitoring_base.rb",
  33. "line": 92,
  34. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  35. "code": "/#{(Setting.get(\"#{integration_name}_recovery_match\") or \"(OK|UP)\")}/i",
  36. "render_path": null,
  37. "location": {
  38. "type": "method",
  39. "class": "Channel::Filter::MonitoringBase",
  40. "method": "Channel::Filter::MonitoringBase.run"
  41. },
  42. "user_input": "Setting.get(\"#{integration_name}_recovery_match\")",
  43. "confidence": "Medium",
  44. "cwe_id": [
  45. 20,
  46. 185
  47. ],
  48. "note": "Admin configured RegExp"
  49. },
  50. {
  51. "warning_type": "Denial of Service",
  52. "warning_code": 76,
  53. "fingerprint": "15d4ddbc3ac2ae0a0fe27218a42a1920fe2c1868ae5f504422c4af8ffe893beb",
  54. "check_name": "RegexDoS",
  55. "message": "Model attribute used in regular expression",
  56. "file": "app/models/channel/filter/monitoring_base.rb",
  57. "line": 121,
  58. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  59. "code": "/#{(Setting.get(\"#{integration_name}_recovery_match\") or \"(OK|UP)\")}/i",
  60. "render_path": null,
  61. "location": {
  62. "type": "method",
  63. "class": "Channel::Filter::MonitoringBase",
  64. "method": "Channel::Filter::MonitoringBase.run"
  65. },
  66. "user_input": "Setting.get(\"#{integration_name}_recovery_match\")",
  67. "confidence": "Medium",
  68. "cwe_id": [
  69. 20,
  70. 185
  71. ],
  72. "note": "Admin configured RegExp"
  73. },
  74. {
  75. "warning_type": "Remote Code Execution",
  76. "warning_code": 24,
  77. "fingerprint": "176994cedb6a57bc52f7a98b0fd93caad211f8f3b48fd010a5db164b37992e1f",
  78. "check_name": "UnsafeReflection",
  79. "message": "Unsafe reflection method `constantize` called on model attribute",
  80. "file": "app/models/avatar.rb",
  81. "line": 427,
  82. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  83. "code": "ObjectLookup.by_id(object_id).constantize",
  84. "render_path": null,
  85. "location": {
  86. "type": "method",
  87. "class": "Avatar",
  88. "method": "Avatar._add_init_avatar"
  89. },
  90. "user_input": "ObjectLookup.by_id(object_id)",
  91. "confidence": "Medium",
  92. "cwe_id": [
  93. 470
  94. ],
  95. "note": "ObjectLookup.by_id works as designed"
  96. },
  97. {
  98. "warning_type": "Redirect",
  99. "warning_code": 18,
  100. "fingerprint": "2ebd9f5e35ae11122d5561fdbbef7432eeef6b34d7c61249365be7dc34cbfb82",
  101. "check_name": "Redirect",
  102. "message": "Possible unprotected redirect",
  103. "file": "app/controllers/external_credentials_controller.rb",
  104. "line": 38,
  105. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  106. "code": "redirect_to(ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url], :allow_other_host => true)",
  107. "render_path": null,
  108. "location": {
  109. "type": "method",
  110. "class": "ExternalCredentialsController",
  111. "method": "link_account"
  112. },
  113. "user_input": "ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url]",
  114. "confidence": "Weak",
  115. "cwe_id": [
  116. 601
  117. ],
  118. "note": ""
  119. },
  120. {
  121. "warning_type": "SQL Injection",
  122. "warning_code": 0,
  123. "fingerprint": "34d5d0f52def9a9fbcb045f4f16b0117cb22d59d8ab6184f3bddd057d81d7cd1",
  124. "check_name": "SQL",
  125. "message": "Possible SQL injection",
  126. "file": "app/models/channel/filter/internal_article_check.rb",
  127. "line": 31,
  128. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  129. "code": "ticket.articles.where(\"ticket_articles.to #{Rails.application.config.db_like} ?\", \"%#{parse_email(mail[:from_email])}%\")",
  130. "render_path": null,
  131. "location": {
  132. "type": "method",
  133. "class": "Channel::Filter::InternalArticleCheck",
  134. "method": "Channel::Filter::InternalArticleCheck.last_outgoing_mail_is_internal?"
  135. },
  136. "user_input": "Rails.application.config.db_like",
  137. "confidence": "Weak",
  138. "cwe_id": [
  139. 89
  140. ],
  141. "note": "The db_like config setting is safe to use in an SQL string."
  142. },
  143. {
  144. "warning_type": "Denial of Service",
  145. "warning_code": 76,
  146. "fingerprint": "381781925211cac1f2592a6537f4abc050f98b081e5554b7d3d70a9454157e35",
  147. "check_name": "RegexDoS",
  148. "message": "Model attribute used in regular expression",
  149. "file": "app/models/ticket/number/increment.rb",
  150. "line": 47,
  151. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  152. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(#{(\"\" or Setting.get(\"system_id\").to_s)}\\d{2,48})\\b/i",
  153. "render_path": null,
  154. "location": {
  155. "type": "method",
  156. "class": "Ticket::Number::Increment",
  157. "method": "Ticket::Number::Increment.check"
  158. },
  159. "user_input": "Setting.get(\"system_id\").to_s",
  160. "confidence": "Medium",
  161. "cwe_id": [
  162. 20,
  163. 185
  164. ],
  165. "note": "Admin configured RegExp"
  166. },
  167. {
  168. "warning_type": "Remote Code Execution",
  169. "warning_code": 24,
  170. "fingerprint": "3c69accdb245b8493b7455698a454c70c2246c14f46f24e28e1c5329cee9ffac",
  171. "check_name": "UnsafeReflection",
  172. "message": "Unsafe reflection method `constantize` called on model attribute",
  173. "file": "config/initializers/store_provider_check.rb",
  174. "line": 11,
  175. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  176. "code": "\"Store::Provider::#{Setting.get(\"storage_provider\")}\".constantize",
  177. "render_path": null,
  178. "location": null,
  179. "user_input": "Setting.get(\"storage_provider\")",
  180. "confidence": "Medium",
  181. "cwe_id": [
  182. 470
  183. ],
  184. "note": ""
  185. },
  186. {
  187. "warning_type": "Denial of Service",
  188. "warning_code": 76,
  189. "fingerprint": "4ea1b96c11cdde309b0f31defd8af9dc39dd7605a7bb18b13b122469a74a5a70",
  190. "check_name": "RegexDoS",
  191. "message": "Model attribute used in regular expression",
  192. "file": "app/models/channel/filter/monitoring_base.rb",
  193. "line": 115,
  194. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  195. "code": "/#{(Setting.get(\"#{integration_name}_ignore_match\") or \"\")}/i",
  196. "render_path": null,
  197. "location": {
  198. "type": "method",
  199. "class": "Channel::Filter::MonitoringBase",
  200. "method": "Channel::Filter::MonitoringBase.run"
  201. },
  202. "user_input": "Setting.get(\"#{integration_name}_ignore_match\")",
  203. "confidence": "Medium",
  204. "cwe_id": [
  205. 20,
  206. 185
  207. ],
  208. "note": "Admin configured RegExp"
  209. },
  210. {
  211. "warning_type": "Remote Code Execution",
  212. "warning_code": 24,
  213. "fingerprint": "55248822583e32826f88a68e27568416fe1f101d83b02791c10296d2393b83a5",
  214. "check_name": "UnsafeReflection",
  215. "message": "Unsafe reflection method `constantize` called on model attribute",
  216. "file": "app/models/store/file.rb",
  217. "line": 32,
  218. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  219. "code": "\"Store::Provider::#{(Setting.get(\"storage_provider\") or \"DB\")}\".constantize",
  220. "render_path": null,
  221. "location": {
  222. "type": "method",
  223. "class": "File",
  224. "method": "s(:self).add"
  225. },
  226. "user_input": "Setting.get(\"storage_provider\")",
  227. "confidence": "Medium",
  228. "cwe_id": [
  229. 470
  230. ],
  231. "note": "Setting.get('storage_provider') returns defined Store::Provider backend class names"
  232. },
  233. {
  234. "warning_type": "Remote Code Execution",
  235. "warning_code": 24,
  236. "fingerprint": "582df3b442a09879f0c035b50f6c4fce9aa8285c907737476f16004246c67bc6",
  237. "check_name": "UnsafeReflection",
  238. "message": "Unsafe reflection method `safe_constantize` called on parameter value",
  239. "file": "app/controllers/tests_controller.rb",
  240. "line": 37,
  241. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  242. "code": "params.fetch(:exception, \"StandardError\").safe_constantize",
  243. "render_path": null,
  244. "location": {
  245. "type": "method",
  246. "class": "TestsController",
  247. "method": "error_raised_exception"
  248. },
  249. "user_input": "params.fetch(:exception, \"StandardError\")",
  250. "confidence": "High",
  251. "cwe_id": [
  252. 470
  253. ],
  254. "note": "Only for testing purposes"
  255. },
  256. {
  257. "warning_type": "Remote Code Execution",
  258. "warning_code": 24,
  259. "fingerprint": "73999042c4866cd2effe286fdd6a74c51659bc4a5fc760d1b96d35bd11b2bcda",
  260. "check_name": "UnsafeReflection",
  261. "message": "Unsafe reflection method `constantize` called on model attribute",
  262. "file": "lib/transaction_dispatcher.rb",
  263. "line": 37,
  264. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  265. "code": "Setting.get(setting.name).constantize",
  266. "render_path": null,
  267. "location": {
  268. "type": "method",
  269. "class": "TransactionDispatcher",
  270. "method": "s(:self).perform"
  271. },
  272. "user_input": "Setting.get(setting.name)",
  273. "confidence": "Medium",
  274. "cwe_id": [
  275. 470
  276. ],
  277. "note": "Setting.where(area: 'Transaction::Backend::Sync').order(:name) returns defined Transaction backend class names"
  278. },
  279. {
  280. "warning_type": "Dangerous Send",
  281. "warning_code": 23,
  282. "fingerprint": "73f7454b7fdc88e0fb9cfc849b74006956a7a031836897a0b61d8d13dde94340",
  283. "check_name": "Send",
  284. "message": "User controlled method execution",
  285. "file": "app/controllers/channels_sms_controller.rb",
  286. "line": 48,
  287. "link": "https://brakemanscanner.org/docs/warning_types/dangerous_send/",
  288. "code": "Channel.driver_class(params[:options][:adapter]).new.send(params[:options], test_options)",
  289. "render_path": null,
  290. "location": {
  291. "type": "method",
  292. "class": "ChannelsSmsController",
  293. "method": "test"
  294. },
  295. "user_input": "params[:options]",
  296. "confidence": "High",
  297. "cwe_id": [
  298. 77
  299. ],
  300. "note": "Channel#send is a custom implementation"
  301. },
  302. {
  303. "warning_type": "Remote Code Execution",
  304. "warning_code": 24,
  305. "fingerprint": "7541faf8d3249dc4ac24f9c354024614ae79b0d6cd4c057f034ea88be1154bf7",
  306. "check_name": "UnsafeReflection",
  307. "message": "Unsafe reflection method `constantize` called on model attribute",
  308. "file": "lib/application_lib.rb",
  309. "line": 26,
  310. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  311. "code": "Setting.get(setting).constantize",
  312. "render_path": null,
  313. "location": {
  314. "type": "method",
  315. "class": "ApplicationLib::ClassMethods",
  316. "method": "load_adapter_by_setting"
  317. },
  318. "user_input": "Setting.get(setting)",
  319. "confidence": "Medium",
  320. "cwe_id": [
  321. 470
  322. ],
  323. "note": "ApplicationLib.load_adapter_by_setting works as designed"
  324. },
  325. {
  326. "warning_type": "Denial of Service",
  327. "warning_code": 76,
  328. "fingerprint": "768e035d4bcb32ab79f5f747ccd5561d3c5f3a8ea74b2be08638d892be2249b2",
  329. "check_name": "RegexDoS",
  330. "message": "Model attribute used in regular expression",
  331. "file": "app/models/ticket/number/date.rb",
  332. "line": 49,
  333. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  334. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  335. "render_path": null,
  336. "location": {
  337. "type": "method",
  338. "class": "Ticket::Number::Date",
  339. "method": "Ticket::Number::Date.check"
  340. },
  341. "user_input": "Setting.get(\"system_id\")",
  342. "confidence": "Medium",
  343. "cwe_id": [
  344. 20,
  345. 185
  346. ],
  347. "note": "Admin configured RegExp"
  348. },
  349. {
  350. "warning_type": "SSL Verification Bypass",
  351. "warning_code": 71,
  352. "fingerprint": "7d088914c00f93dddb545ad9e567d59bf89dad493884b550ba72c014c0190011",
  353. "check_name": "SSLVerify",
  354. "message": "SSL certificate verification was bypassed",
  355. "file": "lib/user_agent.rb",
  356. "line": 335,
  357. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  358. "code": "(Net::HTTP.Proxy($1, $2, ((options[\"proxy_username\"] or Setting.get(\"proxy_username\")) or nil), ((options[\"proxy_password\"] or Setting.get(\"proxy_password\")) or nil)).new(uri.host, uri.port) or Net::HTTP.new(uri.host, uri.port)).verify_mode = OpenSSL::SSL::VERIFY_NONE",
  359. "render_path": null,
  360. "location": {
  361. "type": "method",
  362. "class": "UserAgent",
  363. "method": "s(:self).get_http"
  364. },
  365. "user_input": null,
  366. "confidence": "High",
  367. "cwe_id": [
  368. 295
  369. ],
  370. "note": "SSL Verification can already be requested from callers. The default value should be switched to true at some point."
  371. },
  372. {
  373. "warning_type": "SQL Injection",
  374. "warning_code": 0,
  375. "fingerprint": "8374304b5866de51754c98208fc3dcd434bc20e02bd4c9713f6d35f831a0ddd7",
  376. "check_name": "SQL",
  377. "message": "Possible SQL injection",
  378. "file": "app/models/pgp_key.rb",
  379. "line": 32,
  380. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  381. "code": "PGPKey.where(([\"#{SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)} OR (? LIKE domain_alias)\", SqlHelper.quote_like(uid.downcase)] or SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)))",
  382. "render_path": null,
  383. "location": {
  384. "type": "method",
  385. "class": "PGPKey",
  386. "method": "PGPKey.find_all_by_uid"
  387. },
  388. "user_input": "SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)",
  389. "confidence": "Medium",
  390. "cwe_id": [
  391. 89
  392. ],
  393. "note": ""
  394. },
  395. {
  396. "warning_type": "Remote Code Execution",
  397. "warning_code": 24,
  398. "fingerprint": "8db3b4731daa1ef96c53729b2fca4cc91b47af058564f61cba24833aacaa55ae",
  399. "check_name": "UnsafeReflection",
  400. "message": "Unsafe reflection method `constantize` called on model attribute",
  401. "file": "app/jobs/transaction_job.rb",
  402. "line": 25,
  403. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  404. "code": "Setting.get(setting.name).constantize",
  405. "render_path": null,
  406. "location": {
  407. "type": "method",
  408. "class": "TransactionJob",
  409. "method": "perform"
  410. },
  411. "user_input": "Setting.get(setting.name)",
  412. "confidence": "Medium",
  413. "cwe_id": [
  414. 470
  415. ],
  416. "note": "Setting.where(area: 'Transaction::Backend::Async').order(:name) returns defined Transaction backend class names"
  417. },
  418. {
  419. "warning_type": "SQL Injection",
  420. "warning_code": 0,
  421. "fingerprint": "9385240f75935e7ed242f9b52cc9471bcbb907d1990a33ec083f303d951df563",
  422. "check_name": "SQL",
  423. "message": "Possible SQL injection",
  424. "file": "app/models/taskbar/has_attachments.rb",
  425. "line": 7,
  426. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  427. "code": "where(\"state LIKE '%#{SqlHelper.quote_like(\"form_id\")}%'\")",
  428. "render_path": null,
  429. "location": {
  430. "type": "method",
  431. "class": "Taskbar::HasAttachments",
  432. "method": null
  433. },
  434. "user_input": "SqlHelper.quote_like(\"form_id\")",
  435. "confidence": "Medium",
  436. "cwe_id": [
  437. 89
  438. ],
  439. "note": ""
  440. },
  441. {
  442. "warning_type": "Denial of Service",
  443. "warning_code": 76,
  444. "fingerprint": "949570adfbda072b1fa14632a6d7a0e829a632c699339dce93e1ff109bf79786",
  445. "check_name": "RegexDoS",
  446. "message": "Model attribute used in regular expression",
  447. "file": "app/models/ticket/number/increment.rb",
  448. "line": 41,
  449. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  450. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}#{Regexp.quote(Setting.get(\"ticket_hook_divider\").to_s)}(#{(\"\" or Setting.get(\"system_id\").to_s)}\\d{2,48})\\b/i",
  451. "render_path": null,
  452. "location": {
  453. "type": "method",
  454. "class": "Ticket::Number::Increment",
  455. "method": "Ticket::Number::Increment.check"
  456. },
  457. "user_input": "Setting.get(\"system_id\").to_s",
  458. "confidence": "Medium",
  459. "cwe_id": [
  460. 20,
  461. 185
  462. ],
  463. "note": "Admin configured RegExp"
  464. },
  465. {
  466. "warning_type": "SQL Injection",
  467. "warning_code": 0,
  468. "fingerprint": "9ec74dbe0ca90264aab31f05df4f0565f53e28477c93ced418e0249913c519fc",
  469. "check_name": "SQL",
  470. "message": "Possible SQL injection",
  471. "file": "app/models/organization/search.rb",
  472. "line": 133,
  473. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  474. "code": "Organization.select(\"DISTINCT(organizations.id), #{::SqlHelper.new(:object => (self)).get_order_select(::SqlHelper.new(:object => (self)).get_sort_by(params, [\"active\", \"updated_at\"]), ::SqlHelper.new(:object => (self)).get_order_by(params, [\"desc\", \"desc\"]), \"organizations.updated_at\")}\")",
  475. "render_path": null,
  476. "location": {
  477. "type": "method",
  478. "class": "Organization",
  479. "method": "search"
  480. },
  481. "user_input": "::SqlHelper.new(:object => (self)).get_order_select(::SqlHelper.new(:object => (self)).get_sort_by(params, [\"active\", \"updated_at\"]), ::SqlHelper.new(:object => (self)).get_order_by(params, [\"desc\", \"desc\"]), \"organizations.updated_at\")",
  482. "confidence": "Medium",
  483. "cwe_id": [
  484. 89
  485. ],
  486. "note": "SqlHelper does properly escape table and column names."
  487. },
  488. {
  489. "warning_type": "Cross-Site Scripting",
  490. "warning_code": 2,
  491. "fingerprint": "a9e68e841f16226b94c736d272962dd57d02c2333ead2855f2494dfb2c994de7",
  492. "check_name": "CrossSiteScripting",
  493. "message": "Unescaped parameter value",
  494. "file": "app/views/knowledge_base/public/answers/show.html.erb",
  495. "line": 11,
  496. "link": "https://brakemanscanner.org/docs/warning_types/cross_site_scripting",
  497. "code": "prepare_rich_text(find_answer(find_category(params[:category]).answers, params[:answer]).translation.content.body_with_urls)",
  498. "render_path": [
  499. {
  500. "type": "controller",
  501. "class": "KnowledgeBase::Public::AnswersController",
  502. "method": "show",
  503. "line": 11,
  504. "file": "app/controllers/knowledge_base/public/answers_controller.rb",
  505. "rendered": {
  506. "name": "knowledge_base/public/answers/show",
  507. "file": "app/views/knowledge_base/public/answers/show.html.erb"
  508. }
  509. }
  510. ],
  511. "location": {
  512. "type": "template",
  513. "template": "knowledge_base/public/answers/show"
  514. },
  515. "user_input": "params[:category]",
  516. "confidence": "Weak",
  517. "cwe_id": [
  518. 79
  519. ],
  520. "note": ""
  521. },
  522. {
  523. "warning_type": "Remote Code Execution",
  524. "warning_code": 24,
  525. "fingerprint": "b4e5b1ad22930f849b12cbdf519dced6ec46b6cc653504f0a8e910c0a9590d61",
  526. "check_name": "UnsafeReflection",
  527. "message": "Unsafe reflection method `constantize` called on model attribute",
  528. "file": "app/models/object_manager/attribute.rb",
  529. "line": 896,
  530. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  531. "code": "ObjectLookup.by_id(object_lookup_id).constantize",
  532. "render_path": null,
  533. "location": {
  534. "type": "method",
  535. "class": "ObjectManager::Attribute",
  536. "method": "check_name"
  537. },
  538. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  539. "confidence": "Medium",
  540. "cwe_id": [
  541. 470
  542. ],
  543. "note": "ObjectLookup.by_id works as designed"
  544. },
  545. {
  546. "warning_type": "Command Injection",
  547. "warning_code": 14,
  548. "fingerprint": "be422b13e9cd280bc5ae570cd575777a4d48d8a53aed09bb59d1db85eee4927b",
  549. "check_name": "Execute",
  550. "message": "Possible command injection",
  551. "file": "lib/mysql_strategy.rb",
  552. "line": 62,
  553. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  554. "code": "system(\"mysqldump #{mysql_arguments} > #{backup_file}\", :exception => true)",
  555. "render_path": null,
  556. "location": {
  557. "type": "method",
  558. "class": "MysqlStrategy",
  559. "method": "s(:self).backup"
  560. },
  561. "user_input": "mysql_arguments",
  562. "confidence": "Medium",
  563. "cwe_id": [
  564. 77
  565. ],
  566. "note": "Mysql arguments are internal / from config."
  567. },
  568. {
  569. "warning_type": "Command Injection",
  570. "warning_code": 14,
  571. "fingerprint": "c47bddc058fcf0381c1a91f2d107606a76bb1a5c40130c555ff1dfec713f2775",
  572. "check_name": "Execute",
  573. "message": "Possible command injection",
  574. "file": "lib/secure_mailing/pgp/tool/exec/agent.rb",
  575. "line": 32,
  576. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  577. "code": "Open3.capture3(\"GNUPGHOME\" => (@gnupg_home), *([\"#{File.dirname(binary_path)}/gpgconf\"] + cmdline), :binmode => true)",
  578. "render_path": null,
  579. "location": {
  580. "type": "method",
  581. "class": "SecureMailing::PGP::Tool::Exec::Agent",
  582. "method": "gpgconf"
  583. },
  584. "user_input": "File.dirname(binary_path)",
  585. "confidence": "Medium",
  586. "cwe_id": [
  587. 77
  588. ],
  589. "note": "gpg command line tool stuff."
  590. },
  591. {
  592. "warning_type": "Dynamic Render Path",
  593. "warning_code": 15,
  594. "fingerprint": "c52f57d32456c9ab6dba6dfc93bd8effa16829a87a9ce9368da83a35fc6cf1a7",
  595. "check_name": "Render",
  596. "message": "Render path contains parameter value",
  597. "file": "app/controllers/tests_controller.rb",
  598. "line": 13,
  599. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  600. "code": "render(action => params[:name], {})",
  601. "render_path": null,
  602. "location": {
  603. "type": "method",
  604. "class": "TestsController",
  605. "method": "show"
  606. },
  607. "user_input": "params[:name]",
  608. "confidence": "High",
  609. "cwe_id": [
  610. 22
  611. ],
  612. "note": "Running QUnit tests"
  613. },
  614. {
  615. "warning_type": "SSL Verification Bypass",
  616. "warning_code": 71,
  617. "fingerprint": "c7311ebfec11c51dead99054a31ec84773b4d0d4848c11a15801c439d35d2171",
  618. "check_name": "SSLVerify",
  619. "message": "SSL certificate verification was bypassed",
  620. "file": "app/controllers/integration/exchange_controller.rb",
  621. "line": 93,
  622. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  623. "code": "Autodiscover::Client.new(:email => params[:user], :password => params[:password]).http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE",
  624. "render_path": null,
  625. "location": {
  626. "type": "method",
  627. "class": "Integration::ExchangeController",
  628. "method": "autodiscover_basic_auth_check"
  629. },
  630. "user_input": null,
  631. "confidence": "High",
  632. "cwe_id": [
  633. 295
  634. ],
  635. "note": "Only if requester sends `:disable_ssl_verify` param"
  636. },
  637. {
  638. "warning_type": "Remote Code Execution",
  639. "warning_code": 24,
  640. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  641. "check_name": "UnsafeReflection",
  642. "message": "Unsafe reflection method `constantize` called on model attribute",
  643. "file": "app/models/channel/email_parser.rb",
  644. "line": 159,
  645. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  646. "code": "Setting.get(setting.name).constantize",
  647. "render_path": null,
  648. "location": {
  649. "type": "method",
  650. "class": "Channel::EmailParser",
  651. "method": "_process"
  652. },
  653. "user_input": "Setting.get(setting.name)",
  654. "confidence": "Medium",
  655. "cwe_id": [
  656. 470
  657. ],
  658. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  659. },
  660. {
  661. "warning_type": "Remote Code Execution",
  662. "warning_code": 24,
  663. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  664. "check_name": "UnsafeReflection",
  665. "message": "Unsafe reflection method `constantize` called on model attribute",
  666. "file": "app/models/channel/email_parser.rb",
  667. "line": 324,
  668. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  669. "code": "Setting.get(setting.name).constantize",
  670. "render_path": null,
  671. "location": {
  672. "type": "method",
  673. "class": "Channel::EmailParser",
  674. "method": "_process"
  675. },
  676. "user_input": "Setting.get(setting.name)",
  677. "confidence": "Medium",
  678. "cwe_id": [
  679. 470
  680. ],
  681. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  682. },
  683. {
  684. "warning_type": "Remote Code Execution",
  685. "warning_code": 24,
  686. "fingerprint": "d5d1526bf7a888d1965405d0e3dc5c63f11fe2de47f9704c0e1717ee0410dd6b",
  687. "check_name": "UnsafeReflection",
  688. "message": "Unsafe reflection method `safe_constantize` called on model attribute",
  689. "file": "app/models/online_notification.rb",
  690. "line": 38,
  691. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  692. "code": "ObjectLookup.by_id(object_lookup_id).safe_constantize",
  693. "render_path": null,
  694. "location": {
  695. "type": "method",
  696. "class": "OnlineNotification",
  697. "method": "related_object"
  698. },
  699. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  700. "confidence": "Medium",
  701. "cwe_id": [
  702. 470
  703. ],
  704. "note": ""
  705. },
  706. {
  707. "warning_type": "Denial of Service",
  708. "warning_code": 76,
  709. "fingerprint": "ea2a3af842a48c9ef4dc8d142abd56978baa4823a598d2a76dc8f840799d6967",
  710. "check_name": "RegexDoS",
  711. "message": "Model attribute used in regular expression",
  712. "file": "app/models/ticket/number/date.rb",
  713. "line": 44,
  714. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  715. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}#{Regexp.quote((Setting.get(\"ticket_hook_divider\") or \"\"))}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  716. "render_path": null,
  717. "location": {
  718. "type": "method",
  719. "class": "Ticket::Number::Date",
  720. "method": "Ticket::Number::Date.check"
  721. },
  722. "user_input": "Setting.get(\"system_id\")",
  723. "confidence": "Medium",
  724. "cwe_id": [
  725. 20,
  726. 185
  727. ],
  728. "note": "Admin configured RegExp"
  729. },
  730. {
  731. "warning_type": "Session Setting",
  732. "warning_code": 29,
  733. "fingerprint": "f0ee1cc1980474c82a013645508f002dcc801e00db5592f7dd8cd6bdb93c73fe",
  734. "check_name": "SessionSettings",
  735. "message": "Session secret should not be included in version control",
  736. "file": "config/secrets.yml",
  737. "line": 2,
  738. "link": "https://brakemanscanner.org/docs/warning_types/session_setting/",
  739. "code": null,
  740. "render_path": null,
  741. "location": null,
  742. "user_input": null,
  743. "confidence": "High",
  744. "cwe_id": [
  745. 798
  746. ],
  747. "note": "Since Sessions are stored in the database and not in cookies, the session secret is not used / not relevant.\""
  748. },
  749. {
  750. "warning_type": "Remote Code Execution",
  751. "warning_code": 24,
  752. "fingerprint": "fc299f57cedf226dc79a25c6bca84ceb85d5896a86820648d49c0e59d865575a",
  753. "check_name": "UnsafeReflection",
  754. "message": "Unsafe reflection method `constantize` called on model attribute",
  755. "file": "app/graphql/gql/resolvers/belongs_to_resolver.rb",
  756. "line": 18,
  757. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  758. "code": "ObjectLookup.by_id(object.send(field.through_key)).constantize",
  759. "render_path": null,
  760. "location": {
  761. "type": "method",
  762. "class": "Gql::Resolvers::BelongsToResolver",
  763. "method": "target_object_klass"
  764. },
  765. "user_input": "ObjectLookup.by_id(object.send(field.through_key))",
  766. "confidence": "Medium",
  767. "cwe_id": [
  768. 470
  769. ],
  770. "note": ""
  771. },
  772. {
  773. "warning_type": "SQL Injection",
  774. "warning_code": 0,
  775. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  776. "check_name": "SQL",
  777. "message": "Possible SQL injection",
  778. "file": "lib/models.rb",
  779. "line": 171,
  780. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  781. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  782. "render_path": null,
  783. "location": {
  784. "type": "method",
  785. "class": "Models",
  786. "method": "s(:self).references"
  787. },
  788. "user_input": "reflection_value.name",
  789. "confidence": "Weak",
  790. "cwe_id": [
  791. 89
  792. ],
  793. "note": "Reflections come from the models themselves and are thus safe to use."
  794. },
  795. {
  796. "warning_type": "SQL Injection",
  797. "warning_code": 0,
  798. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  799. "check_name": "SQL",
  800. "message": "Possible SQL injection",
  801. "file": "lib/models.rb",
  802. "line": 184,
  803. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  804. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  805. "render_path": null,
  806. "location": {
  807. "type": "method",
  808. "class": "Models",
  809. "method": "s(:self).references"
  810. },
  811. "user_input": "reflection_value.name",
  812. "confidence": "Weak",
  813. "cwe_id": [
  814. 89
  815. ],
  816. "note": "Reflections come from the models themselves and are thus safe to use."
  817. },
  818. {
  819. "warning_type": "Command Injection",
  820. "warning_code": 14,
  821. "fingerprint": "fe15417756eed2c518c355309ee042b57df5f88a5410858dce3fa9fe9c893b84",
  822. "check_name": "Execute",
  823. "message": "Possible command injection",
  824. "file": "lib/mysql_strategy.rb",
  825. "line": 54,
  826. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  827. "code": "system(\"mysql #{mysql_arguments} < #{backup_file}\", :exception => true)",
  828. "render_path": null,
  829. "location": {
  830. "type": "method",
  831. "class": "MysqlStrategy",
  832. "method": "s(:self).rollback"
  833. },
  834. "user_input": "mysql_arguments",
  835. "confidence": "Medium",
  836. "cwe_id": [
  837. 77
  838. ],
  839. "note": "Mysql arguments are internal / from config."
  840. }
  841. ],
  842. "updated": "2024-02-19 12:24:05 +0100",
  843. "brakeman_version": "6.1.2"
  844. }