brakeman.ignore 37 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009
  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": 432,
  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": "SQL Injection",
  99. "warning_code": 0,
  100. "fingerprint": "2251415d8897d2c79a5c952dd0fe57dadd5ca96defd67ccefa27fc7b5ab06148",
  101. "check_name": "SQL",
  102. "message": "Possible SQL injection",
  103. "file": "app/services/service/translation/search/collector/model.rb",
  104. "line": 28,
  105. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  106. "code": "Translation.not_customized.where(\"locale = :locale AND (source #{like_operator} :query OR target #{like_operator} :query OR target_initial #{like_operator} :query)\", :locale => locale, :query => like_query)",
  107. "render_path": null,
  108. "location": {
  109. "type": "method",
  110. "class": "Service::Translation::Search::Collector::Model",
  111. "method": "search_by_query"
  112. },
  113. "user_input": "like_operator",
  114. "confidence": "Medium",
  115. "cwe_id": [
  116. 89
  117. ],
  118. "note": ""
  119. },
  120. {
  121. "warning_type": "Redirect",
  122. "warning_code": 18,
  123. "fingerprint": "2ebd9f5e35ae11122d5561fdbbef7432eeef6b34d7c61249365be7dc34cbfb82",
  124. "check_name": "Redirect",
  125. "message": "Possible unprotected redirect",
  126. "file": "app/controllers/external_credentials_controller.rb",
  127. "line": 38,
  128. "link": "https://brakemanscanner.org/docs/warning_types/redirect/",
  129. "code": "redirect_to(ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url], :allow_other_host => true)",
  130. "render_path": null,
  131. "location": {
  132. "type": "method",
  133. "class": "ExternalCredentialsController",
  134. "method": "link_account"
  135. },
  136. "user_input": "ExternalCredential.request_account_to_link(params[:provider].downcase, params)[:authorize_url]",
  137. "confidence": "Weak",
  138. "cwe_id": [
  139. 601
  140. ],
  141. "note": ""
  142. },
  143. {
  144. "warning_type": "SQL Injection",
  145. "warning_code": 0,
  146. "fingerprint": "34d5d0f52def9a9fbcb045f4f16b0117cb22d59d8ab6184f3bddd057d81d7cd1",
  147. "check_name": "SQL",
  148. "message": "Possible SQL injection",
  149. "file": "app/models/channel/filter/internal_article_check.rb",
  150. "line": 31,
  151. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  152. "code": "ticket.articles.where(\"ticket_articles.to #{Rails.application.config.db_like} ?\", \"%#{parse_email(mail[:from_email])}%\")",
  153. "render_path": null,
  154. "location": {
  155. "type": "method",
  156. "class": "Channel::Filter::InternalArticleCheck",
  157. "method": "Channel::Filter::InternalArticleCheck.last_outgoing_mail_is_internal?"
  158. },
  159. "user_input": "Rails.application.config.db_like",
  160. "confidence": "Weak",
  161. "cwe_id": [
  162. 89
  163. ],
  164. "note": "The db_like config setting is safe to use in an SQL string."
  165. },
  166. {
  167. "warning_type": "Denial of Service",
  168. "warning_code": 76,
  169. "fingerprint": "381781925211cac1f2592a6537f4abc050f98b081e5554b7d3d70a9454157e35",
  170. "check_name": "RegexDoS",
  171. "message": "Model attribute used in regular expression",
  172. "file": "app/models/ticket/number/increment.rb",
  173. "line": 47,
  174. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  175. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(#{(\"\" or Setting.get(\"system_id\").to_s)}\\d{2,48})\\b/i",
  176. "render_path": null,
  177. "location": {
  178. "type": "method",
  179. "class": "Ticket::Number::Increment",
  180. "method": "Ticket::Number::Increment.check"
  181. },
  182. "user_input": "Setting.get(\"system_id\").to_s",
  183. "confidence": "Medium",
  184. "cwe_id": [
  185. 20,
  186. 185
  187. ],
  188. "note": "Admin configured RegExp"
  189. },
  190. {
  191. "warning_type": "Remote Code Execution",
  192. "warning_code": 24,
  193. "fingerprint": "3c69accdb245b8493b7455698a454c70c2246c14f46f24e28e1c5329cee9ffac",
  194. "check_name": "UnsafeReflection",
  195. "message": "Unsafe reflection method `constantize` called on model attribute",
  196. "file": "config/initializers/store_provider_check.rb",
  197. "line": 11,
  198. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  199. "code": "\"Store::Provider::#{Setting.get(\"storage_provider\")}\".constantize",
  200. "render_path": null,
  201. "location": null,
  202. "user_input": "Setting.get(\"storage_provider\")",
  203. "confidence": "Medium",
  204. "cwe_id": [
  205. 470
  206. ],
  207. "note": ""
  208. },
  209. {
  210. "warning_type": "SQL Injection",
  211. "warning_code": 0,
  212. "fingerprint": "49c4e60297a41654cfb9d8ac6b8232e0d3a68ee7ebd53f48b7c6d0ec6f830318",
  213. "check_name": "SQL",
  214. "message": "Possible SQL injection",
  215. "file": "app/services/service/translation/search/collector/macro.rb",
  216. "line": 11,
  217. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  218. "code": "::Macro.where(\"name #{like_operator} :query\", :query => like_query)",
  219. "render_path": null,
  220. "location": {
  221. "type": "method",
  222. "class": "Service::Translation::Search::Collector::Macro",
  223. "method": "search_sources"
  224. },
  225. "user_input": "like_operator",
  226. "confidence": "Weak",
  227. "cwe_id": [
  228. 89
  229. ],
  230. "note": ""
  231. },
  232. {
  233. "warning_type": "Remote Code Execution",
  234. "warning_code": 25,
  235. "fingerprint": "4de4e9e3a023616489b5ae24a6cad8500e0c82f40963828bc73fd07cc69e0ac1",
  236. "check_name": "Deserialize",
  237. "message": "Use of `Marshal.load` may be dangerous",
  238. "file": "app/models/core_workflow/attributes.rb",
  239. "line": 106,
  240. "link": "https://brakemanscanner.org/docs/warning_types/unsafe_deserialization",
  241. "code": "Marshal.load(Marshal.dump(payload_class.find_by(:id => @payload[\"params\"][\"id\"])))",
  242. "render_path": null,
  243. "location": {
  244. "type": "method",
  245. "class": "CoreWorkflow::Attributes",
  246. "method": "saved_only"
  247. },
  248. "user_input": null,
  249. "confidence": "Weak",
  250. "cwe_id": [
  251. 502
  252. ],
  253. "note": ""
  254. },
  255. {
  256. "warning_type": "Denial of Service",
  257. "warning_code": 76,
  258. "fingerprint": "4ea1b96c11cdde309b0f31defd8af9dc39dd7605a7bb18b13b122469a74a5a70",
  259. "check_name": "RegexDoS",
  260. "message": "Model attribute used in regular expression",
  261. "file": "app/models/channel/filter/monitoring_base.rb",
  262. "line": 115,
  263. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  264. "code": "/#{(Setting.get(\"#{integration_name}_ignore_match\") or \"\")}/i",
  265. "render_path": null,
  266. "location": {
  267. "type": "method",
  268. "class": "Channel::Filter::MonitoringBase",
  269. "method": "Channel::Filter::MonitoringBase.run"
  270. },
  271. "user_input": "Setting.get(\"#{integration_name}_ignore_match\")",
  272. "confidence": "Medium",
  273. "cwe_id": [
  274. 20,
  275. 185
  276. ],
  277. "note": "Admin configured RegExp"
  278. },
  279. {
  280. "warning_type": "Remote Code Execution",
  281. "warning_code": 24,
  282. "fingerprint": "55248822583e32826f88a68e27568416fe1f101d83b02791c10296d2393b83a5",
  283. "check_name": "UnsafeReflection",
  284. "message": "Unsafe reflection method `constantize` called on model attribute",
  285. "file": "app/models/store/file.rb",
  286. "line": 32,
  287. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  288. "code": "\"Store::Provider::#{(Setting.get(\"storage_provider\") or \"DB\")}\".constantize",
  289. "render_path": null,
  290. "location": {
  291. "type": "method",
  292. "class": "File",
  293. "method": "s(:self).add"
  294. },
  295. "user_input": "Setting.get(\"storage_provider\")",
  296. "confidence": "Medium",
  297. "cwe_id": [
  298. 470
  299. ],
  300. "note": "Setting.get('storage_provider') returns defined Store::Provider backend class names"
  301. },
  302. {
  303. "warning_type": "Remote Code Execution",
  304. "warning_code": 24,
  305. "fingerprint": "582df3b442a09879f0c035b50f6c4fce9aa8285c907737476f16004246c67bc6",
  306. "check_name": "UnsafeReflection",
  307. "message": "Unsafe reflection method `safe_constantize` called on parameter value",
  308. "file": "app/controllers/tests_controller.rb",
  309. "line": 37,
  310. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  311. "code": "params.fetch(:exception, \"StandardError\").safe_constantize",
  312. "render_path": null,
  313. "location": {
  314. "type": "method",
  315. "class": "TestsController",
  316. "method": "error_raised_exception"
  317. },
  318. "user_input": "params.fetch(:exception, \"StandardError\")",
  319. "confidence": "High",
  320. "cwe_id": [
  321. 470
  322. ],
  323. "note": "Only for testing purposes"
  324. },
  325. {
  326. "warning_type": "SQL Injection",
  327. "warning_code": 0,
  328. "fingerprint": "6f9bc95786e5e3904c8cf11eaff8d481d057ac2a15edad0a753587047a9bd785",
  329. "check_name": "SQL",
  330. "message": "Possible SQL injection",
  331. "file": "app/services/service/translation/search/collector/overview.rb",
  332. "line": 11,
  333. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  334. "code": "::Overview.where(\"name #{like_operator} :query\", :query => like_query)",
  335. "render_path": null,
  336. "location": {
  337. "type": "method",
  338. "class": "Service::Translation::Search::Collector::Overview",
  339. "method": "search_sources"
  340. },
  341. "user_input": "like_operator",
  342. "confidence": "Weak",
  343. "cwe_id": [
  344. 89
  345. ],
  346. "note": ""
  347. },
  348. {
  349. "warning_type": "Remote Code Execution",
  350. "warning_code": 24,
  351. "fingerprint": "73999042c4866cd2effe286fdd6a74c51659bc4a5fc760d1b96d35bd11b2bcda",
  352. "check_name": "UnsafeReflection",
  353. "message": "Unsafe reflection method `constantize` called on model attribute",
  354. "file": "lib/transaction_dispatcher.rb",
  355. "line": 37,
  356. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  357. "code": "Setting.get(setting.name).constantize",
  358. "render_path": null,
  359. "location": {
  360. "type": "method",
  361. "class": "TransactionDispatcher",
  362. "method": "s(:self).perform"
  363. },
  364. "user_input": "Setting.get(setting.name)",
  365. "confidence": "Medium",
  366. "cwe_id": [
  367. 470
  368. ],
  369. "note": "Setting.where(area: 'Transaction::Backend::Sync').order(:name) returns defined Transaction backend class names"
  370. },
  371. {
  372. "warning_type": "Remote Code Execution",
  373. "warning_code": 24,
  374. "fingerprint": "7541faf8d3249dc4ac24f9c354024614ae79b0d6cd4c057f034ea88be1154bf7",
  375. "check_name": "UnsafeReflection",
  376. "message": "Unsafe reflection method `constantize` called on model attribute",
  377. "file": "lib/application_lib.rb",
  378. "line": 26,
  379. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  380. "code": "Setting.get(setting).constantize",
  381. "render_path": null,
  382. "location": {
  383. "type": "method",
  384. "class": "ApplicationLib::ClassMethods",
  385. "method": "load_adapter_by_setting"
  386. },
  387. "user_input": "Setting.get(setting)",
  388. "confidence": "Medium",
  389. "cwe_id": [
  390. 470
  391. ],
  392. "note": "ApplicationLib.load_adapter_by_setting works as designed"
  393. },
  394. {
  395. "warning_type": "Denial of Service",
  396. "warning_code": 76,
  397. "fingerprint": "768e035d4bcb32ab79f5f747ccd5561d3c5f3a8ea74b2be08638d892be2249b2",
  398. "check_name": "RegexDoS",
  399. "message": "Model attribute used in regular expression",
  400. "file": "app/models/ticket/number/date.rb",
  401. "line": 49,
  402. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  403. "code": "/(?<=\\W|^)#{Regexp.quote(Setting.get(\"ticket_hook\"))}\\s{0,2}(\\d{4,10}#{(Setting.get(\"system_id\") or \"\")}\\d{2,40})\\b/i",
  404. "render_path": null,
  405. "location": {
  406. "type": "method",
  407. "class": "Ticket::Number::Date",
  408. "method": "Ticket::Number::Date.check"
  409. },
  410. "user_input": "Setting.get(\"system_id\")",
  411. "confidence": "Medium",
  412. "cwe_id": [
  413. 20,
  414. 185
  415. ],
  416. "note": "Admin configured RegExp"
  417. },
  418. {
  419. "warning_type": "SSL Verification Bypass",
  420. "warning_code": 71,
  421. "fingerprint": "7d088914c00f93dddb545ad9e567d59bf89dad493884b550ba72c014c0190011",
  422. "check_name": "SSLVerify",
  423. "message": "SSL certificate verification was bypassed",
  424. "file": "lib/user_agent.rb",
  425. "line": 363,
  426. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  427. "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",
  428. "render_path": null,
  429. "location": {
  430. "type": "method",
  431. "class": "UserAgent",
  432. "method": "s(:self).get_http"
  433. },
  434. "user_input": null,
  435. "confidence": "High",
  436. "cwe_id": [
  437. 295
  438. ],
  439. "note": "SSL Verification can already be requested from callers. The default value should be switched to true at some point."
  440. },
  441. {
  442. "warning_type": "SQL Injection",
  443. "warning_code": 0,
  444. "fingerprint": "8374304b5866de51754c98208fc3dcd434bc20e02bd4c9713f6d35f831a0ddd7",
  445. "check_name": "SQL",
  446. "message": "Possible SQL injection",
  447. "file": "app/models/pgp_key.rb",
  448. "line": 32,
  449. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  450. "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)))",
  451. "render_path": null,
  452. "location": {
  453. "type": "method",
  454. "class": "PGPKey",
  455. "method": "PGPKey.find_all_by_uid"
  456. },
  457. "user_input": "SqlHelper.new(:object => (PGPKey)).array_contains_one(:email_addresses, uid.downcase)",
  458. "confidence": "Medium",
  459. "cwe_id": [
  460. 89
  461. ],
  462. "note": ""
  463. },
  464. {
  465. "warning_type": "Remote Code Execution",
  466. "warning_code": 25,
  467. "fingerprint": "89ac258e481395b8687e1a3607cf2c6c7f4bd77c8bde7a570c39f6dc3488110d",
  468. "check_name": "Deserialize",
  469. "message": "Use of `Marshal.load` may be dangerous",
  470. "file": "app/models/core_workflow/result.rb",
  471. "line": 20,
  472. "link": "https://brakemanscanner.org/docs/warning_types/unsafe_deserialization",
  473. "code": "Marshal.load(Marshal.dump(payload.permit!.to_h))",
  474. "render_path": null,
  475. "location": {
  476. "type": "method",
  477. "class": "CoreWorkflow::Result",
  478. "method": "initialize"
  479. },
  480. "user_input": null,
  481. "confidence": "Weak",
  482. "cwe_id": [
  483. 502
  484. ],
  485. "note": ""
  486. },
  487. {
  488. "warning_type": "Remote Code Execution",
  489. "warning_code": 24,
  490. "fingerprint": "8db3b4731daa1ef96c53729b2fca4cc91b47af058564f61cba24833aacaa55ae",
  491. "check_name": "UnsafeReflection",
  492. "message": "Unsafe reflection method `constantize` called on model attribute",
  493. "file": "app/jobs/transaction_job.rb",
  494. "line": 25,
  495. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  496. "code": "Setting.get(setting.name).constantize",
  497. "render_path": null,
  498. "location": {
  499. "type": "method",
  500. "class": "TransactionJob",
  501. "method": "perform"
  502. },
  503. "user_input": "Setting.get(setting.name)",
  504. "confidence": "Medium",
  505. "cwe_id": [
  506. 470
  507. ],
  508. "note": "Setting.where(area: 'Transaction::Backend::Async').order(:name) returns defined Transaction backend class names"
  509. },
  510. {
  511. "warning_type": "SQL Injection",
  512. "warning_code": 0,
  513. "fingerprint": "9385240f75935e7ed242f9b52cc9471bcbb907d1990a33ec083f303d951df563",
  514. "check_name": "SQL",
  515. "message": "Possible SQL injection",
  516. "file": "app/models/taskbar/has_attachments.rb",
  517. "line": 7,
  518. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  519. "code": "where(\"state LIKE '%#{SqlHelper.quote_like(\"form_id\")}%'\")",
  520. "render_path": null,
  521. "location": {
  522. "type": "method",
  523. "class": "Taskbar::HasAttachments",
  524. "method": null
  525. },
  526. "user_input": "SqlHelper.quote_like(\"form_id\")",
  527. "confidence": "Medium",
  528. "cwe_id": [
  529. 89
  530. ],
  531. "note": ""
  532. },
  533. {
  534. "warning_type": "Denial of Service",
  535. "warning_code": 76,
  536. "fingerprint": "949570adfbda072b1fa14632a6d7a0e829a632c699339dce93e1ff109bf79786",
  537. "check_name": "RegexDoS",
  538. "message": "Model attribute used in regular expression",
  539. "file": "app/models/ticket/number/increment.rb",
  540. "line": 41,
  541. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  542. "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",
  543. "render_path": null,
  544. "location": {
  545. "type": "method",
  546. "class": "Ticket::Number::Increment",
  547. "method": "Ticket::Number::Increment.check"
  548. },
  549. "user_input": "Setting.get(\"system_id\").to_s",
  550. "confidence": "Medium",
  551. "cwe_id": [
  552. 20,
  553. 185
  554. ],
  555. "note": "Admin configured RegExp"
  556. },
  557. {
  558. "warning_type": "Remote Code Execution",
  559. "warning_code": 24,
  560. "fingerprint": "99ea0a566c684509f05b93d53f68bef433b0c6ff357e84f516f8f08c7a1e5faf",
  561. "check_name": "UnsafeReflection",
  562. "message": "Unsafe reflection method `constantize` called on model attribute",
  563. "file": "app/models/link/triggers_subscriptions.rb",
  564. "line": 20,
  565. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  566. "code": "Link::Object.find(link_object_id).name.constantize",
  567. "render_path": null,
  568. "location": {
  569. "type": "method",
  570. "class": "Link::TriggersSubscriptions",
  571. "method": "trigger_subscriptions"
  572. },
  573. "user_input": "Link::Object.find(link_object_id).name",
  574. "confidence": "Medium",
  575. "cwe_id": [
  576. 470
  577. ],
  578. "note": ""
  579. },
  580. {
  581. "warning_type": "Cross-Site Scripting",
  582. "warning_code": 2,
  583. "fingerprint": "a9e68e841f16226b94c736d272962dd57d02c2333ead2855f2494dfb2c994de7",
  584. "check_name": "CrossSiteScripting",
  585. "message": "Unescaped parameter value",
  586. "file": "app/views/knowledge_base/public/answers/show.html.erb",
  587. "line": 11,
  588. "link": "https://brakemanscanner.org/docs/warning_types/cross_site_scripting",
  589. "code": "prepare_rich_text(find_answer(find_category(params[:category]).answers, params[:answer]).translation.content.body_with_urls)",
  590. "render_path": [
  591. {
  592. "type": "controller",
  593. "class": "KnowledgeBase::Public::AnswersController",
  594. "method": "show",
  595. "line": 11,
  596. "file": "app/controllers/knowledge_base/public/answers_controller.rb",
  597. "rendered": {
  598. "name": "knowledge_base/public/answers/show",
  599. "file": "app/views/knowledge_base/public/answers/show.html.erb"
  600. }
  601. }
  602. ],
  603. "location": {
  604. "type": "template",
  605. "template": "knowledge_base/public/answers/show"
  606. },
  607. "user_input": "params[:category]",
  608. "confidence": "Weak",
  609. "cwe_id": [
  610. 79
  611. ],
  612. "note": ""
  613. },
  614. {
  615. "warning_type": "Remote Code Execution",
  616. "warning_code": 24,
  617. "fingerprint": "b4e5b1ad22930f849b12cbdf519dced6ec46b6cc653504f0a8e910c0a9590d61",
  618. "check_name": "UnsafeReflection",
  619. "message": "Unsafe reflection method `constantize` called on model attribute",
  620. "file": "app/models/object_manager/attribute.rb",
  621. "line": 919,
  622. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  623. "code": "ObjectLookup.by_id(object_lookup_id).constantize",
  624. "render_path": null,
  625. "location": {
  626. "type": "method",
  627. "class": "ObjectManager::Attribute",
  628. "method": "check_name"
  629. },
  630. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  631. "confidence": "Medium",
  632. "cwe_id": [
  633. 470
  634. ],
  635. "note": "ObjectLookup.by_id works as designed"
  636. },
  637. {
  638. "warning_type": "Command Injection",
  639. "warning_code": 14,
  640. "fingerprint": "be422b13e9cd280bc5ae570cd575777a4d48d8a53aed09bb59d1db85eee4927b",
  641. "check_name": "Execute",
  642. "message": "Possible command injection",
  643. "file": "lib/mysql_strategy.rb",
  644. "line": 62,
  645. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  646. "code": "system(\"mysqldump #{mysql_arguments} > #{backup_file}\", :exception => true)",
  647. "render_path": null,
  648. "location": {
  649. "type": "method",
  650. "class": "MysqlStrategy",
  651. "method": "s(:self).backup"
  652. },
  653. "user_input": "mysql_arguments",
  654. "confidence": "Medium",
  655. "cwe_id": [
  656. 77
  657. ],
  658. "note": "Mysql arguments are internal / from config."
  659. },
  660. {
  661. "warning_type": "SQL Injection",
  662. "warning_code": 0,
  663. "fingerprint": "c3e251f444d988a200ae5c5e811dc7264337906df99740007bfa499c35e203c9",
  664. "check_name": "SQL",
  665. "message": "Possible SQL injection",
  666. "file": "app/services/service/translation/search/collector/priority.rb",
  667. "line": 11,
  668. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  669. "code": "Ticket::Priority.where(\"name #{like_operator} :query\", :query => like_query)",
  670. "render_path": null,
  671. "location": {
  672. "type": "method",
  673. "class": "Service::Translation::Search::Collector::Priority",
  674. "method": "search_sources"
  675. },
  676. "user_input": "like_operator",
  677. "confidence": "Medium",
  678. "cwe_id": [
  679. 89
  680. ],
  681. "note": ""
  682. },
  683. {
  684. "warning_type": "Command Injection",
  685. "warning_code": 14,
  686. "fingerprint": "c47bddc058fcf0381c1a91f2d107606a76bb1a5c40130c555ff1dfec713f2775",
  687. "check_name": "Execute",
  688. "message": "Possible command injection",
  689. "file": "lib/secure_mailing/pgp/tool/exec/agent.rb",
  690. "line": 32,
  691. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  692. "code": "Open3.capture3(\"GNUPGHOME\" => (@gnupg_home), *([\"#{File.dirname(binary_path)}/gpgconf\"] + cmdline), :binmode => true)",
  693. "render_path": null,
  694. "location": {
  695. "type": "method",
  696. "class": "SecureMailing::PGP::Tool::Exec::Agent",
  697. "method": "gpgconf"
  698. },
  699. "user_input": "File.dirname(binary_path)",
  700. "confidence": "Medium",
  701. "cwe_id": [
  702. 77
  703. ],
  704. "note": "gpg command line tool stuff."
  705. },
  706. {
  707. "warning_type": "Dynamic Render Path",
  708. "warning_code": 15,
  709. "fingerprint": "c52f57d32456c9ab6dba6dfc93bd8effa16829a87a9ce9368da83a35fc6cf1a7",
  710. "check_name": "Render",
  711. "message": "Render path contains parameter value",
  712. "file": "app/controllers/tests_controller.rb",
  713. "line": 13,
  714. "link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
  715. "code": "render(action => params[:name], {})",
  716. "render_path": null,
  717. "location": {
  718. "type": "method",
  719. "class": "TestsController",
  720. "method": "show"
  721. },
  722. "user_input": "params[:name]",
  723. "confidence": "High",
  724. "cwe_id": [
  725. 22
  726. ],
  727. "note": "Running QUnit tests"
  728. },
  729. {
  730. "warning_type": "SQL Injection",
  731. "warning_code": 0,
  732. "fingerprint": "c686d86a18e1345c9216a074fb8cd86f1e4d4bc1f6d78c8f00891f4c13dfb849",
  733. "check_name": "SQL",
  734. "message": "Possible SQL injection",
  735. "file": "app/services/service/translation/search/collector/state.rb",
  736. "line": 11,
  737. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  738. "code": "Ticket::State.where(\"name #{like_operator} :query\", :query => like_query)",
  739. "render_path": null,
  740. "location": {
  741. "type": "method",
  742. "class": "Service::Translation::Search::Collector::State",
  743. "method": "search_sources"
  744. },
  745. "user_input": "like_operator",
  746. "confidence": "Medium",
  747. "cwe_id": [
  748. 89
  749. ],
  750. "note": ""
  751. },
  752. {
  753. "warning_type": "SSL Verification Bypass",
  754. "warning_code": 71,
  755. "fingerprint": "c7311ebfec11c51dead99054a31ec84773b4d0d4848c11a15801c439d35d2171",
  756. "check_name": "SSLVerify",
  757. "message": "SSL certificate verification was bypassed",
  758. "file": "app/controllers/integration/exchange_controller.rb",
  759. "line": 93,
  760. "link": "https://brakemanscanner.org/docs/warning_types/ssl_verification_bypass/",
  761. "code": "Autodiscover::Client.new(:email => params[:user], :password => params[:password]).http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE",
  762. "render_path": null,
  763. "location": {
  764. "type": "method",
  765. "class": "Integration::ExchangeController",
  766. "method": "autodiscover_basic_auth_check"
  767. },
  768. "user_input": null,
  769. "confidence": "High",
  770. "cwe_id": [
  771. 295
  772. ],
  773. "note": "Only if requester sends `:disable_ssl_verify` param"
  774. },
  775. {
  776. "warning_type": "Remote Code Execution",
  777. "warning_code": 24,
  778. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  779. "check_name": "UnsafeReflection",
  780. "message": "Unsafe reflection method `constantize` called on model attribute",
  781. "file": "app/models/channel/email_parser.rb",
  782. "line": 172,
  783. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  784. "code": "Setting.get(setting.name).constantize",
  785. "render_path": null,
  786. "location": {
  787. "type": "method",
  788. "class": "Channel::EmailParser",
  789. "method": "_process"
  790. },
  791. "user_input": "Setting.get(setting.name)",
  792. "confidence": "Medium",
  793. "cwe_id": [
  794. 470
  795. ],
  796. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  797. },
  798. {
  799. "warning_type": "Remote Code Execution",
  800. "warning_code": 24,
  801. "fingerprint": "d48809837203098f7be4803f19b4f180f93361030bcf145560c65582d44f8edc",
  802. "check_name": "UnsafeReflection",
  803. "message": "Unsafe reflection method `constantize` called on model attribute",
  804. "file": "app/models/channel/email_parser.rb",
  805. "line": 347,
  806. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  807. "code": "Setting.get(setting.name).constantize",
  808. "render_path": null,
  809. "location": {
  810. "type": "method",
  811. "class": "Channel::EmailParser",
  812. "method": "_process"
  813. },
  814. "user_input": "Setting.get(setting.name)",
  815. "confidence": "Medium",
  816. "cwe_id": [
  817. 470
  818. ],
  819. "note": "Setting.where(area: 'Postmaster::PreFilter').order(:name) returns defined postmaster backend class names"
  820. },
  821. {
  822. "warning_type": "Remote Code Execution",
  823. "warning_code": 24,
  824. "fingerprint": "d5d1526bf7a888d1965405d0e3dc5c63f11fe2de47f9704c0e1717ee0410dd6b",
  825. "check_name": "UnsafeReflection",
  826. "message": "Unsafe reflection method `safe_constantize` called on model attribute",
  827. "file": "app/models/online_notification.rb",
  828. "line": 38,
  829. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  830. "code": "ObjectLookup.by_id(object_lookup_id).safe_constantize",
  831. "render_path": null,
  832. "location": {
  833. "type": "method",
  834. "class": "OnlineNotification",
  835. "method": "related_object"
  836. },
  837. "user_input": "ObjectLookup.by_id(object_lookup_id)",
  838. "confidence": "Medium",
  839. "cwe_id": [
  840. 470
  841. ],
  842. "note": ""
  843. },
  844. {
  845. "warning_type": "Denial of Service",
  846. "warning_code": 76,
  847. "fingerprint": "ea2a3af842a48c9ef4dc8d142abd56978baa4823a598d2a76dc8f840799d6967",
  848. "check_name": "RegexDoS",
  849. "message": "Model attribute used in regular expression",
  850. "file": "app/models/ticket/number/date.rb",
  851. "line": 44,
  852. "link": "https://brakemanscanner.org/docs/warning_types/denial_of_service/",
  853. "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",
  854. "render_path": null,
  855. "location": {
  856. "type": "method",
  857. "class": "Ticket::Number::Date",
  858. "method": "Ticket::Number::Date.check"
  859. },
  860. "user_input": "Setting.get(\"system_id\")",
  861. "confidence": "Medium",
  862. "cwe_id": [
  863. 20,
  864. 185
  865. ],
  866. "note": "Admin configured RegExp"
  867. },
  868. {
  869. "warning_type": "Remote Code Execution",
  870. "warning_code": 25,
  871. "fingerprint": "f4f4cba4803223bb1c6a3b61140050f188912dde06d3c3d08959772701ab7936",
  872. "check_name": "Deserialize",
  873. "message": "Use of `Marshal.load` may be dangerous",
  874. "file": "app/models/core_workflow/result.rb",
  875. "line": 207,
  876. "link": "https://brakemanscanner.org/docs/warning_types/unsafe_deserialization",
  877. "code": "Marshal.load(Marshal.dump(@result.except(:rerun_count)))",
  878. "render_path": null,
  879. "location": {
  880. "type": "method",
  881. "class": "CoreWorkflow::Result",
  882. "method": "consider_rerun"
  883. },
  884. "user_input": null,
  885. "confidence": "Weak",
  886. "cwe_id": [
  887. 502
  888. ],
  889. "note": ""
  890. },
  891. {
  892. "warning_type": "Dangerous Eval",
  893. "warning_code": 13,
  894. "fingerprint": "f7980b20d0d9119e081ff8116bd049a42529a40e2ccbdd4a32e8d6146a8d39fe",
  895. "check_name": "Evaluation",
  896. "message": "Dynamic code evaluation",
  897. "file": "lib/background_services/service/process_scheduled_jobs/job_executor.rb",
  898. "line": 52,
  899. "link": "https://brakemanscanner.org/docs/warning_types/dangerous_eval/",
  900. "code": "eval(job.method)",
  901. "render_path": null,
  902. "location": {
  903. "type": "method",
  904. "class": "BackgroundServices::Service::ProcessScheduledJobs::JobExecutor",
  905. "method": "eval_job_method"
  906. },
  907. "user_input": null,
  908. "confidence": "Weak",
  909. "cwe_id": [
  910. 913,
  911. 95
  912. ],
  913. "note": ""
  914. },
  915. {
  916. "warning_type": "Remote Code Execution",
  917. "warning_code": 24,
  918. "fingerprint": "fc299f57cedf226dc79a25c6bca84ceb85d5896a86820648d49c0e59d865575a",
  919. "check_name": "UnsafeReflection",
  920. "message": "Unsafe reflection method `constantize` called on model attribute",
  921. "file": "app/graphql/gql/resolvers/belongs_to_resolver.rb",
  922. "line": 18,
  923. "link": "https://brakemanscanner.org/docs/warning_types/remote_code_execution/",
  924. "code": "ObjectLookup.by_id(object.send(field.through_key)).constantize",
  925. "render_path": null,
  926. "location": {
  927. "type": "method",
  928. "class": "Gql::Resolvers::BelongsToResolver",
  929. "method": "target_object_klass"
  930. },
  931. "user_input": "ObjectLookup.by_id(object.send(field.through_key))",
  932. "confidence": "Medium",
  933. "cwe_id": [
  934. 470
  935. ],
  936. "note": ""
  937. },
  938. {
  939. "warning_type": "SQL Injection",
  940. "warning_code": 0,
  941. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  942. "check_name": "SQL",
  943. "message": "Possible SQL injection",
  944. "file": "lib/models.rb",
  945. "line": 172,
  946. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  947. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  948. "render_path": null,
  949. "location": {
  950. "type": "method",
  951. "class": "Models",
  952. "method": "s(:self).references"
  953. },
  954. "user_input": "reflection_value.name",
  955. "confidence": "Weak",
  956. "cwe_id": [
  957. 89
  958. ],
  959. "note": "Reflections come from the models themselves and are thus safe to use."
  960. },
  961. {
  962. "warning_type": "SQL Injection",
  963. "warning_code": 0,
  964. "fingerprint": "fcad47a712a324ace0e97560767e5420500df03fd3de3057198800bdea5fd324",
  965. "check_name": "SQL",
  966. "message": "Possible SQL injection",
  967. "file": "lib/models.rb",
  968. "line": 185,
  969. "link": "https://brakemanscanner.org/docs/warning_types/sql_injection/",
  970. "code": "model_class.where(\"#{reflection_value.name}_id\" => object_id)",
  971. "render_path": null,
  972. "location": {
  973. "type": "method",
  974. "class": "Models",
  975. "method": "s(:self).references"
  976. },
  977. "user_input": "reflection_value.name",
  978. "confidence": "Weak",
  979. "cwe_id": [
  980. 89
  981. ],
  982. "note": "Reflections come from the models themselves and are thus safe to use."
  983. },
  984. {
  985. "warning_type": "Command Injection",
  986. "warning_code": 14,
  987. "fingerprint": "fe15417756eed2c518c355309ee042b57df5f88a5410858dce3fa9fe9c893b84",
  988. "check_name": "Execute",
  989. "message": "Possible command injection",
  990. "file": "lib/mysql_strategy.rb",
  991. "line": 54,
  992. "link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
  993. "code": "system(\"mysql #{mysql_arguments} < #{backup_file}\", :exception => true)",
  994. "render_path": null,
  995. "location": {
  996. "type": "method",
  997. "class": "MysqlStrategy",
  998. "method": "s(:self).rollback"
  999. },
  1000. "user_input": "mysql_arguments",
  1001. "confidence": "Medium",
  1002. "cwe_id": [
  1003. 77
  1004. ],
  1005. "note": "Mysql arguments are internal / from config."
  1006. }
  1007. ],
  1008. "brakeman_version": "7.0.0"
  1009. }