mirror of
https://github.com/snipe/snipe-it.git
synced 2026-08-18 11:15:42 +00:00
Added XSS seeder to check for BS tables vulns
This commit is contained in:
@ -165,4 +165,15 @@ class CustomFieldFactory extends Factory
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
public function xss()
|
||||
{
|
||||
return $this->state(function () {
|
||||
return [
|
||||
'name' => '<img src=x onerror=alert(1)>',
|
||||
'help_text' => 'This is an intentional XSS seeded field so we can easily check for BS tables slips in escaping.',
|
||||
'show_in_requestable_list' => '0',
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ class CustomFieldSeeder extends Seeder
|
||||
CustomField::factory()->count(1)->testCheckbox()->create();
|
||||
CustomField::factory()->count(1)->testRadio()->create();
|
||||
CustomField::factory()->count(1)->testMarkdownTextarea()->create();
|
||||
CustomField::factory()->count(1)->xss()->create();
|
||||
|
||||
DB::table('custom_field_custom_fieldset')->insert([
|
||||
[
|
||||
|
||||
Reference in New Issue
Block a user