3
0
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:
snipe
2026-07-07 00:18:46 +01:00
parent 7002ebd1af
commit d151c8c5a0
2 changed files with 12 additions and 0 deletions

View File

@ -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',
];
});
}
}

View File

@ -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([
[