tracker
All repositories: gitoria
2.4 KB
// tests/seed-xss.hl — GATE FIXTURE for the security gate (tests/security.mjs): a movie, a person and a genre whose text is HTML /// script, in every field a page prints. The app is stopped while this runs. Self-assigned ids, one put() each.import { MPackDB } from 'hl:mpackdb'import { env } from 'hl:proc'storageDir = env('TRACKER_STORAGE')if (storageDir == null || !storageDir.startsWith('/')) { hlError('set TRACKER_STORAGE, absolute') }genresTable = new MPackDB(file = storageDir + '/genres.db', primaryKey = '@id', indexes = ['!oldId'])personsTable = new MPackDB(file = storageDir + '/persons.db', primaryKey = '@id', indexes = ['!oldId'])showsTable = new MPackDB(file = storageDir + '/shows.db', primaryKey = '@id', indexes = ['!oldId'])seasonsTable = new MPackDB(file = storageDir + '/seasons.db', primaryKey = '@id', indexes = ['!oldId'])episodesTable = new MPackDB(file = storageDir + '/episodes.db', primaryKey = '@id', indexes = ['!oldId'])evil = '</script><img src=x onerror=window.__xss=1>"\'<svg onload=window.__xss=2>'genresTable.put({ id = 'xssg00000000000g' name = 'G' + evil urlSegment = 'xss-genre' tmdbId = 99001 oldId = 'xssg' })personsTable.put({ id = 'xssp00000000000p' name = 'P' + evil urlSegment = 'xss-person' tmdbId = null oldId = 'xssp' bio = 'B' + evil })seasonsTable.put({ id = 'xsss00000000000s' seasonNumber = 1 title = 'S' + evil release = null summary = 'SS' + evil show = 'xsst00000000000t' episodes = ['xsse00000000000e'] oldId = 'xsss' })episodesTable.put({ id = 'xsse00000000000e' episodeNumber = 1 seasonNumber = 1 title = 'E' + evil summary = 'ES' + evil release = '2020-01-01' show = 'xsst00000000000t' season = 'xsss00000000000s' oldId = 'xsse' })showsTable.put({adult = false id = 'xsst00000000000t' title = 'T' + evil summary = 'M' + evil tmdbSummary = null tmdbId = nulllanguage = 'en' type = 'series' release = '2020-01-01' year = 2020 image = null urlSegment = 'xss-title'episodesCount = 1 homepage = 'javascript:window.__xss=3' imdbId = '"><img src=x onerror=window.__xss=4>' seasonsCount = 1 status = 'Ended' tagline = 'T' + eviltvdbId = null tvmzId = null genres = ['xssg00000000000g'] cast = [{ person = 'xssp00000000000p' character = 'C' + evil actor = 'A' + evil }]seasons = ['xsss00000000000s'] oldId = 'xsst' tmdbSync = 1})genresTable.persist()personsTable.persist()showsTable.persist()seasonsTable.persist()episodesTable.persist()console.log('seed-xss: 1 series, 1 person, 1 genre with HTML in every text field')
Branches
Latest commits
- a1a88bd4gc1: search skips the stale-key string while no entry is stale; /my/unwatched asks a kept id set instead of building a key string per episode rowmre
- cd830744gc1: dbSearch: no split / map / list copy per candidate (scores from the stored text, top list touched only when the hit can enter)mre
- 451db7cdgc1: show page and check clicks read the kept watched set instead of building one from a by-value copy of every watchmre
- ddb4127egc1: TRACKER_QSTATS=1 logs queue and cache sizes every 10 s (measurement only)mre
- da60547fstatus: GC1 done, backup bugmre
- e4171021log: GC1 result, backup hard-link bugmre
- f1597214deploy.sh backup: tar --hard-dereference (hot tar stored mpackdb sidecars as hard links to .sessions files)mre
- 6b58571elog: GC windowmre
- 5c8baa1fdeploy lock: hold only around deploy.shmre
- b8dac822log: hybriel#309mre
- bf676d9elog: GC1 startedmre
- c7828541mission GC1mre
- ef949994conductor: neutral ticket rulemre
- 89e91ef3log: RV39 livemre
- ee2b677alog: RV39 deployingmre
- c1c4178cMerge branch 'rv39'mre
- a016e9abReapply "Merge branch 'rv39'"mre
- f29e2502log: RV39 gate fixmre
- d9fce111browser gate #26: exact frame count incl. SL1 people step (hybriel#308)mre
- ad529ac1log: m572 verdictmre