GitHub:[https://github.com/google/code-prettify](https://github.com/google/code-prettify)
展示網址:[Gallery of themes for code prettify](https://rawgit.com/google/code-prettify/master/styles/index.html)
```html
```
```html
```
```html
```
```html
```
2017年11月1日 星期三
2017年5月11日 星期四
【PHP】X-Frame-Options 回應標頭
這幾天使用 Checkmarx 做白箱弱掃時,Javascript 的部份一直出現一個中度風險的項目:
```php header("X-Frame-Options: DENY") ``` 只允許同 Domain 來源的請求
```php header("X-Frame-Options: SAMEORIGIN") ``` 只允許某網址的請求
```php header("X-Frame-Options: ALLOW-FROM http://www.google.com") ```
雖然此方應該能有效避免【Client Cross Frame Scripting Attack】這類攻擊,
但在 Checkmarx 的白箱弱掃時,似乎還是會誤判為無效,待持續觀察 ...
【Client Cross Frame Scripting Attack】
Google 了一下似乎在 PHP 內的 header 加上 X-Frame-Options 相關設定就能解決此問題在 PHP 頁面中各別設定:
完全禁止任何 iframe 請求```php header("X-Frame-Options: DENY") ``` 只允許同 Domain 來源的請求
```php header("X-Frame-Options: SAMEORIGIN") ``` 只允許某網址的請求
```php header("X-Frame-Options: ALLOW-FROM http://www.google.com") ```
在 Apache 中設定:
```php Header always append X-Frame-Options DENY ```雖然此方應該能有效避免【Client Cross Frame Scripting Attack】這類攻擊,
但在 Checkmarx 的白箱弱掃時,似乎還是會誤判為無效,待持續觀察 ...
2017年4月24日 星期一
【Javascript】兩視窗資料傳遞的方法
這幾天遇到一個需求,必須另開視窗產生完超商代收的 barcode 資訊,
再回傳相關資訊給原本視窗,接下來再 POST 所有資訊到下一頁,
在這邊記錄一下問題的大致做法。
再回傳相關資訊給原本視窗,接下來再 POST 所有資訊到下一頁,
在這邊記錄一下問題的大致做法。
主流程: ```html <button type="button" onclick="genBarcode();>超商代收</button> ```
另開視窗頁面: ```html ```
訂閱:
文章 (Atom)