小编Kri*_*rma的帖子

Cookie 不包含“安全”和“HTTPOnly”属性

在正在开发的网站上运行 Qualys 漏洞扫描时,我发现了以下漏洞:

Cookie Does Not Contain The "HTTPOnly" Attribute

Cookie Does Not Contain The "secure" Attribute

我的应用程序运行ExpressJSNodeJSnginxWeb服务器。我正在使用express-sessioncsurf令牌。我已经设置了HTTPOnlysecureflag true。配置如下:

app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({extended: false, limit: '50mb'}));
app.use(cookieParser());

app.use(express.static(path.join(__dirname, "/../public")));

app.enable("trust proxy");
app.use(expressSession({
    store: new MongoStore({
        url: `session_db`
    }),
    secret: `session_secret`,
    resave: true,
    saveUninitialized: true,
    proxy: true,
    rolling: true,
    cookie: {
        secure: true,
        httpOnly: false,
        maxAge: (72 * 60 * 60 * 1000)
    },
    unset: "destroy"
})); …
Run Code Online (Sandbox Code Playgroud)

javascript nginx node.js express qualys

5
推荐指数
0
解决办法
1649
查看次数

标签 统计

express ×1

javascript ×1

nginx ×1

node.js ×1

qualys ×1