rav-xss 1.0.29 → 1.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/core/browser.js +61 -4
package/package.json
CHANGED
package/src/core/browser.js
CHANGED
|
@@ -20,6 +20,8 @@ try {
|
|
|
20
20
|
*
|
|
21
21
|
* Gerencia requisições HTTP via Axios (Modo Normal) e navegação
|
|
22
22
|
* via Playwright (Modo Navegador) com detecção automática de ambiente.
|
|
23
|
+
* Inicializa o navegador com sandbox rigoroso para mitigar riscos de
|
|
24
|
+
* páginas maliciosas e ataques de supply-chain.
|
|
23
25
|
*/
|
|
24
26
|
class BrowserManager {
|
|
25
27
|
constructor(config, args) {
|
|
@@ -124,7 +126,9 @@ class BrowserManager {
|
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
/**
|
|
127
|
-
* 🚀 Inicializa o navegador Playwright
|
|
129
|
+
* 🚀 Inicializa o navegador Playwright com sandbox reforçado.
|
|
130
|
+
* Desabilita credenciais de rede e barra downloads para isolar o ambiente
|
|
131
|
+
* de testes do sistema operacional real, prevenindo impactos de páginas maliciosas.
|
|
128
132
|
* @returns {Promise<Object>} Instância do navegador
|
|
129
133
|
*/
|
|
130
134
|
async launch() {
|
|
@@ -142,7 +146,49 @@ class BrowserManager {
|
|
|
142
146
|
args: [
|
|
143
147
|
'--no-sandbox',
|
|
144
148
|
'--disable-setuid-sandbox',
|
|
145
|
-
'--disable-dev-shm-usage'
|
|
149
|
+
'--disable-dev-shm-usage',
|
|
150
|
+
'--disable-web-security',
|
|
151
|
+
'--disable-features=VizDisplayCompositor',
|
|
152
|
+
'--disable-background-networking',
|
|
153
|
+
'--disable-sync',
|
|
154
|
+
'--disable-default-apps',
|
|
155
|
+
'--disable-translate',
|
|
156
|
+
'--disable-extensions',
|
|
157
|
+
'--disable-plugins',
|
|
158
|
+
'--disable-popup-blocking',
|
|
159
|
+
'--disable-prompt-on-repost',
|
|
160
|
+
'--disable-ipc-flooding-protection',
|
|
161
|
+
'--disable-hang-monitor',
|
|
162
|
+
'--disable-client-side-phishing-detection',
|
|
163
|
+
'--disable-component-update',
|
|
164
|
+
'--disable-domain-reliability',
|
|
165
|
+
'--disable-breakpad',
|
|
166
|
+
'--disable-background-timer-throttling',
|
|
167
|
+
'--disable-renderer-backgrounding',
|
|
168
|
+
'--disable-backgrounding-occluded-windows',
|
|
169
|
+
'--disable-field-trial-config',
|
|
170
|
+
'--disable-software-rasterizer',
|
|
171
|
+
'--disable-speech-api',
|
|
172
|
+
'--disable-print-preview',
|
|
173
|
+
'--disable-notifications',
|
|
174
|
+
'--no-default-browser-check',
|
|
175
|
+
'--no-first-run',
|
|
176
|
+
'--no-pings',
|
|
177
|
+
'--no-service-autorun',
|
|
178
|
+
'--media-cache-size=1',
|
|
179
|
+
'--disk-cache-size=1',
|
|
180
|
+
'--aggressive-cache-discard',
|
|
181
|
+
'--disable-accelerated-2d-canvas',
|
|
182
|
+
'--disable-gpu',
|
|
183
|
+
'--disable-reading-from-canvas',
|
|
184
|
+
'--disable-remote-fonts',
|
|
185
|
+
'--disable-partial-raster',
|
|
186
|
+
'--enable-features=NetworkService,NetworkServiceInProcess',
|
|
187
|
+
'--force-color-profile=srgb',
|
|
188
|
+
'--metrics-recording-only',
|
|
189
|
+
'--mute-audio',
|
|
190
|
+
'--no-experiments',
|
|
191
|
+
'--no-sandbox-and-elevated'
|
|
146
192
|
]
|
|
147
193
|
});
|
|
148
194
|
|
|
@@ -161,7 +207,9 @@ class BrowserManager {
|
|
|
161
207
|
}
|
|
162
208
|
|
|
163
209
|
/**
|
|
164
|
-
* 🌐 Cria um novo contexto de navegação
|
|
210
|
+
* 🌐 Cria um novo contexto de navegação estritamente isolado.
|
|
211
|
+
* Desabilita permissões sensíveis e ignora erros HTTPS para evitar
|
|
212
|
+
* vazamento de informações ou interações maliciosas com o sistema.
|
|
165
213
|
* @returns {Promise<Object>} Contexto do navegador
|
|
166
214
|
*/
|
|
167
215
|
async createContext() {
|
|
@@ -169,7 +217,16 @@ class BrowserManager {
|
|
|
169
217
|
|
|
170
218
|
return await this.browser.newContext({
|
|
171
219
|
userAgent: this.config.scanner.user_agent,
|
|
172
|
-
ignoreHTTPSErrors: true
|
|
220
|
+
ignoreHTTPSErrors: true,
|
|
221
|
+
permissions: [],
|
|
222
|
+
geolocation: undefined,
|
|
223
|
+
locale: 'en-US',
|
|
224
|
+
timezoneId: 'UTC',
|
|
225
|
+
acceptDownloads: false,
|
|
226
|
+
bypassCSP: false,
|
|
227
|
+
extraHTTPHeaders: {
|
|
228
|
+
'Accept-Language': 'en-US,en;q=0.9'
|
|
229
|
+
}
|
|
173
230
|
});
|
|
174
231
|
}
|
|
175
232
|
|