-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update #14
update #14
Conversation
4.70版本 heo主题封面比例、动画更改
…expand gitbook导航文件夹悬停自动展开
…expand gitbook 导航文件夹hover-expand适配移动端
…inline-config Fix/theme starter inline config
…optimise feat: 优化dockerfile,可使包体积从1.1G缩小至200M
…tn-css Fix starter submenu btn css
Release/4.7.11
…y-tag 修复分类和标签首页
…-cnpmjs CNPM有点不靠谱
if (item.querySelector('figcaption').textContent.trim() === value) { | ||
item.classList.add('active') | ||
if (iframe) { | ||
iframe.setAttribute('src', iframe.getAttribute('data-src')) |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that the value from the data-src
attribute is properly sanitized before being used as the src
attribute of an iframe
. One way to do this is to use a library like DOMPurify to sanitize the value. This will ensure that any potentially malicious content is removed before it is used.
- Import the DOMPurify library.
- Use DOMPurify to sanitize the value of the
data-src
attribute before setting it as thesrc
attribute of theiframe
.
-
Copy modified line R35 -
Copy modified lines R246-R247
@@ -34,2 +34,3 @@ | ||
import { Style } from './style' | ||
import DOMPurify from 'dompurify' | ||
|
||
@@ -244,3 +245,4 @@ | ||
if (iframe) { | ||
iframe.setAttribute('src', iframe.getAttribute('data-src')) | ||
const sanitizedSrc = DOMPurify.sanitize(iframe.getAttribute('data-src')) | ||
iframe.setAttribute('src', sanitizedSrc) | ||
} |
-
Copy modified lines R46-R47
@@ -45,3 +45,4 @@ | ||
"react-share": "^4.4.1", | ||
"react-tweet-embed": "~2.0.0" | ||
"react-tweet-embed": "~2.0.0", | ||
"dompurify": "^3.2.3" | ||
}, |
Package | Version | Security advisories |
dompurify (npm) | 3.2.3 | None |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
已知问题
解决方案
.env.local
迁移到package.json
package.json
读取版本号改动收益
package.json
读取具体改动
blog.config.js
测试确认