brakeman.ignore 32 KB

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