Dataset Viewer
Auto-converted to Parquet
cve_id
stringlengths
13
16
hash
stringlengths
40
40
repo_url
stringlengths
25
73
cve_description
stringlengths
64
3.9k
cvss2_base_score
float64
1.2
10
cvss3_base_score
float64
2.2
10
published_date
stringdate
1999-06-23 04:00:00
2024-07-22 18:15:00
severity
stringclasses
4 values
cwe_id
stringclasses
269 values
cwe_name
stringclasses
269 values
cwe_description
stringclasses
268 values
commit_message
stringlengths
0
46.8k
commit_date
stringlengths
25
25
version_tag
stringlengths
3
36
repo_total_files
int64
1
169k
repo_total_commits
int64
2
1.4M
file_paths
listlengths
0
53.6k
language
stringclasses
27 values
diff_stats
stringlengths
2
4.23M
diff_with_context
stringlengths
0
654M
vulnerable_code
stringlengths
0
55.3M
fixed_code
stringlengths
0
622M
security_keywords
listlengths
0
5
CVE-2024-24746
d42a0ebe6632bd0c318560e4293a522634f60594
https://github.com/apache/mynewt-nimble
[{'lang': 'en', 'value': "Loop with Unreachable Exit Condition ('Infinite Loop') vulnerability in Apache NimBLE.\xa0\n\nSpecially crafted GATT operation can cause infinite loop in GATT server leading to denial of service in Bluetooth stack or device.\n\nThis issue affects Apache NimBLE: through 1.6.0.\nUsers are recommended to upgrade to version 1.7.0, which fixes the issue."}]
null
null
2024-04-06T12:15Z
nan
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')
The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
nimble/host: Fix disconnect on host connection timeout We don't need to have double loop and lock-unlock host lock when issuing disconnect. ble_gap_terminate_with_conn() can be used to disconnect and it can be called with already provided conn object under host lock.
2024-02-14 21:27:16 +0100
d42a0ebe
1,024
2
[ "nimble/host/src/ble_hs_conn.c" ]
C
{"nimble/host/src/ble_hs_conn.c": {"lines_added": 49, "lines_deleted": 62}}
diff --git a/nimble/host/src/ble_hs_conn.c b/nimble/host/src/ble_hs_conn.c index 9b7bdbb3..57ba16af 100644 --- a/nimble/host/src/ble_hs_conn.c +++ b/nimble/host/src/ble_hs_conn.c @@ -475,90 +475,77 @@ ble_hs_conn_timer(void) return BLE_HS_FOREVER; #endif struct ble_hs_conn *conn; - ble_npl_time_t now; - int32_t next_exp_in; + ble_npl_time_t now = ble_npl_time_get(); + int32_t next_exp_in = BLE_HS_FOREVER; + int32_t next_exp_in_new; + bool next_exp_in_updated; int32_t time_diff; - uint16_t conn_handle; - for (;;) { - conn_handle = BLE_HS_CONN_HANDLE_NONE; - next_exp_in = BLE_HS_FOREVER; - now = ble_npl_time_get(); + ble_hs_lock(); - ble_hs_lock(); - - /* This loop performs one of two tasks: - * 1. Determine if any connections need to be terminated due to timeout. - * If so, break out of the loop and terminate the connection. This - * function will need to be executed again. - * 2. Otherwise, determine when the next timeout will occur. - */ - SLIST_FOREACH(conn, &ble_hs_conns, bhc_next) { - if (!(conn->bhc_flags & BLE_HS_CONN_F_TERMINATING)) { + /* This loop performs one of two tasks: + * 1. Determine if any connections need to be terminated due to timeout. If + * so connection is disconnected. + * 2. Otherwise, determine when the next timeout will occur. + */ + SLIST_FOREACH(conn, &ble_hs_conns, bhc_next) { + if (!(conn->bhc_flags & BLE_HS_CONN_F_TERMINATING)) { + next_exp_in_updated = false; #if MYNEWT_VAL(BLE_L2CAP_RX_FRAG_TIMEOUT) != 0 - /* Check each connection's rx fragment timer. If too much time - * passes after a partial packet is received, the connection is - * terminated. - */ - if (conn->bhc_rx_chan != NULL) { - time_diff = conn->bhc_rx_timeout - now; - - if (time_diff <= 0) { - /* ACL reassembly has timed out. Remember the connection - * handle so it can be terminated after the mutex is - * unlocked. - */ - conn_handle = conn->bhc_handle; - break; - } - - /* Determine if this connection is the soonest to time out. */ - if (time_diff < next_exp_in) { - next_exp_in = time_diff; - } - } -#endif + /* Check each connection's rx fragment timer. If too much time + * passes after a partial packet is received, the connection is + * terminated. + */ + if (conn->bhc_rx_chan != NULL) { + time_diff = conn->bhc_rx_timeout - now; -#if BLE_HS_ATT_SVR_QUEUED_WRITE_TMO - /* Check each connection's rx queued write timer. If too much - * time passes after a prep write is received, the queue is - * cleared. - */ - time_diff = ble_att_svr_ticks_until_tmo(&conn->bhc_att_svr, now); if (time_diff <= 0) { - /* ACL reassembly has timed out. Remember the connection - * handle so it can be terminated after the mutex is - * unlocked. - */ - conn_handle = conn->bhc_handle; - break; + /* ACL reassembly has timed out.*/ + ble_gap_terminate_with_conn(conn, BLE_ERR_REM_USER_CONN_TERM); + continue; } /* Determine if this connection is the soonest to time out. */ if (time_diff < next_exp_in) { - next_exp_in = time_diff; + next_exp_in_new = time_diff; + next_exp_in_updated = true; } + } #endif + +#if BLE_HS_ATT_SVR_QUEUED_WRITE_TMO + /* Check each connection's rx queued write timer. If too much + * time passes after a prep write is received, the queue is + * cleared. + */ + time_diff = ble_att_svr_ticks_until_tmo(&conn->bhc_att_svr, now); + if (time_diff <= 0) { + /* Queued write has timed out.*/ + ble_gap_terminate_with_conn(conn, BLE_ERR_REM_USER_CONN_TERM); + continue; } - } - ble_hs_unlock(); + /* Determine if this connection is the soonest to time out. */ + if (time_diff < next_exp_in) { + next_exp_in_new = time_diff; + next_exp_in_updated = true; + } +#endif - /* If a connection has timed out, terminate it. We need to repeatedly - * call this function again to determine when the next timeout is. - */ - if (conn_handle != BLE_HS_CONN_HANDLE_NONE) { - ble_gap_terminate(conn_handle, BLE_ERR_REM_USER_CONN_TERM); - continue; + if (next_exp_in_updated) { + next_exp_in = next_exp_in_new; + } } - - return next_exp_in; } + + ble_hs_unlock(); + + return next_exp_in; } int ble_hs_conn_init(void) {
ble_npl_time_t now; int32_t next_exp_in; uint16_t conn_handle; for (;;) { conn_handle = BLE_HS_CONN_HANDLE_NONE; next_exp_in = BLE_HS_FOREVER; now = ble_npl_time_get(); ble_hs_lock(); /* This loop performs one of two tasks: * 1. Determine if any connections need to be terminated due to timeout. * If so, break out of the loop and terminate the connection. This * function will need to be executed again. * 2. Otherwise, determine when the next timeout will occur. */ SLIST_FOREACH(conn, &ble_hs_conns, bhc_next) { if (!(conn->bhc_flags & BLE_HS_CONN_F_TERMINATING)) { /* Check each connection's rx fragment timer. If too much time * passes after a partial packet is received, the connection is * terminated. */ if (conn->bhc_rx_chan != NULL) { time_diff = conn->bhc_rx_timeout - now; if (time_diff <= 0) { /* ACL reassembly has timed out. Remember the connection * handle so it can be terminated after the mutex is * unlocked. */ conn_handle = conn->bhc_handle; break; } /* Determine if this connection is the soonest to time out. */ if (time_diff < next_exp_in) { next_exp_in = time_diff; } } #endif #if BLE_HS_ATT_SVR_QUEUED_WRITE_TMO /* Check each connection's rx queued write timer. If too much * time passes after a prep write is received, the queue is * cleared. */ time_diff = ble_att_svr_ticks_until_tmo(&conn->bhc_att_svr, now); /* ACL reassembly has timed out. Remember the connection * handle so it can be terminated after the mutex is * unlocked. */ conn_handle = conn->bhc_handle; break; next_exp_in = time_diff; } ble_hs_unlock(); /* If a connection has timed out, terminate it. We need to repeatedly * call this function again to determine when the next timeout is. */ if (conn_handle != BLE_HS_CONN_HANDLE_NONE) { ble_gap_terminate(conn_handle, BLE_ERR_REM_USER_CONN_TERM); continue; return next_exp_in;
ble_npl_time_t now = ble_npl_time_get(); int32_t next_exp_in = BLE_HS_FOREVER; int32_t next_exp_in_new; bool next_exp_in_updated; ble_hs_lock(); /* This loop performs one of two tasks: * 1. Determine if any connections need to be terminated due to timeout. If * so connection is disconnected. * 2. Otherwise, determine when the next timeout will occur. */ SLIST_FOREACH(conn, &ble_hs_conns, bhc_next) { if (!(conn->bhc_flags & BLE_HS_CONN_F_TERMINATING)) { next_exp_in_updated = false; /* Check each connection's rx fragment timer. If too much time * passes after a partial packet is received, the connection is * terminated. */ if (conn->bhc_rx_chan != NULL) { time_diff = conn->bhc_rx_timeout - now; /* ACL reassembly has timed out.*/ ble_gap_terminate_with_conn(conn, BLE_ERR_REM_USER_CONN_TERM); continue; next_exp_in_new = time_diff; next_exp_in_updated = true; } #if BLE_HS_ATT_SVR_QUEUED_WRITE_TMO /* Check each connection's rx queued write timer. If too much * time passes after a prep write is received, the queue is * cleared. */ time_diff = ble_att_svr_ticks_until_tmo(&conn->bhc_att_svr, now); if (time_diff <= 0) { /* Queued write has timed out.*/ ble_gap_terminate_with_conn(conn, BLE_ERR_REM_USER_CONN_TERM); continue; /* Determine if this connection is the soonest to time out. */ if (time_diff < next_exp_in) { next_exp_in_new = time_diff; next_exp_in_updated = true; } #endif if (next_exp_in_updated) { next_exp_in = next_exp_in_new; } ble_hs_unlock(); return next_exp_in;
[]
CVE-2020-7763
b5d2da2639a49a95e0bdb3bc0c987cb6406b8259
https://github.com/pofider/phantom-html-to-pdf
[{'lang': 'en', 'value': 'This affects the package phantom-html-to-pdf before 0.6.1.'}]
5
7.5
2020-11-05T14:15Z
MEDIUM
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
fix access to files without protocol
2020-11-02 15:51:26 +0100
b5d2da2
20
2
[ "lib/scripts/conversionScriptPart.js", "test/test.js" ]
JavaScript
{"lib/scripts/conversionScriptPart.js": {"lines_added": 7, "lines_deleted": 7}, "test/test.js": {"lines_added": 33, "lines_deleted": 18}}
diff --git a/lib/scripts/conversionScriptPart.js b/lib/scripts/conversionScriptPart.js index 20c8f42..044ab07 100644 --- a/lib/scripts/conversionScriptPart.js +++ b/lib/scripts/conversionScriptPart.js @@ -17,23 +17,23 @@ if(body.cookies.length > 0) { page.onResourceRequested = function (request, networkRequest) { console.log('Request ' + request.url); if (request.url.lastIndexOf(body.url, 0) === 0) { return; - } - - //potentially dangerous request - if (request.url.lastIndexOf("file:///", 0) === 0 && !body.allowLocalFilesAccess) { - networkRequest.abort(); - return; - } + } //to support cdn like format //cdn.jquery... if (request.url.lastIndexOf("file://", 0) === 0 && request.url.lastIndexOf("file:///", 0) !== 0) { networkRequest.changeUrl(request.url.replace("file://", "http://")); } + //potentially dangerous request + if (request.url.lastIndexOf("http://", 0) !== 0 && request.url.lastIndexOf("https://", 0) && !body.allowLocalFilesAccess) { + networkRequest.abort(); + return; + } + if (body.waitForJS && request.url.lastIndexOf("http://intruct-javascript-ending", 0) === 0) { pageJSisDone = true; } }; diff --git a/test/test.js b/test/test.js index 2d74f19..3bc6a0d 100644 --- a/test/test.js +++ b/test/test.js @@ -1,8 +1,8 @@ -var should = require("should"), +var should = require("should"), path = require("path"), - fs = require("fs"), + fs = require("fs"), phantomjs = require("phantomjs"), phantomjs2 = require("phantomjs-prebuilt") tmpDir = path.join(__dirname, "temp"), conversion = require("../lib/conversion.js")({ timeout: 10000, @@ -93,25 +93,11 @@ describe("phantom html to pdf", function () { res.stream.should.have.property("readable"); done(); }); }); - }); - - it('should create a pdf file ignoring ssl errors', function(done) { - conversion({ - url: 'https://sygris.com' - }, function(err, res) { - if (err) { - return done(err); - } - - res.numberOfPages.should.be.eql(1); - res.stream.should.have.property("readable"); - done(); - }); - }); + }); it('should wait for page js execution', function(done) { conversion({ html: '<h1>aa</h1><script>window.PHANTOM_HTML_TO_PDF_READY = true;</script>', waitForJS: true @@ -199,11 +185,11 @@ describe("phantom html to pdf", function () { }, function(err, res) { if (err) { return done(err); } - JSON.stringify(res.logs).should.containEql('foo'); + ; done(); }); }); it('should trim logs for long base64 encoded images', function(done) { @@ -259,10 +245,39 @@ describe("phantom html to pdf", function () { return done(err); JSON.stringify(res.logs).should.containEql('test-cookie1=test-value1; test-cookie2=test-value2'); done(); }) }); + + it('should reject local files', function(done) { + conversion({ + html: `<script> + document.write(window.location='${__filename.replace(/\\/g, '/')}') + </script>` + }, function(err, res) { + if (err) { + return done(err); + } + JSON.stringify(res.logs).should.containEql('Unable to load resource') + done() + }); + }); + + it('should allow local files when allowLocalFilesAccess', function(done) { + conversion({ + allowLocalFilesAccess: true, + html: `<script> + document.write(window.location='${__filename.replace(/\\/g, '/')}') + </script>` + }, function(err, res) { + if (err) { + return done(err); + } + JSON.stringify(res.logs).should.not.containEql('Unable to load resource') + done() + }); + }); } rmDir = function (dirPath) { if (!fs.existsSync(dirPath)) fs.mkdirSync(dirPath);
} //potentially dangerous request if (request.url.lastIndexOf("file:///", 0) === 0 && !body.allowLocalFilesAccess) { networkRequest.abort(); return; } var should = require("should"), fs = require("fs"), }); it('should create a pdf file ignoring ssl errors', function(done) { conversion({ url: 'https://sygris.com' }, function(err, res) { if (err) { return done(err); } res.numberOfPages.should.be.eql(1); res.stream.should.have.property("readable"); done(); }); }); JSON.stringify(res.logs).should.containEql('foo');
} //potentially dangerous request if (request.url.lastIndexOf("http://", 0) !== 0 && request.url.lastIndexOf("https://", 0) && !body.allowLocalFilesAccess) { networkRequest.abort(); return; } var should = require("should"), fs = require("fs"), }); ; it('should reject local files', function(done) { conversion({ html: `<script> document.write(window.location='${__filename.replace(/\\/g, '/')}') </script>` }, function(err, res) { if (err) { return done(err); } JSON.stringify(res.logs).should.containEql('Unable to load resource') done() }); }); it('should allow local files when allowLocalFilesAccess', function(done) { conversion({ allowLocalFilesAccess: true, html: `<script> document.write(window.location='${__filename.replace(/\\/g, '/')}') </script>` }, function(err, res) { if (err) { return done(err); } JSON.stringify(res.logs).should.not.containEql('Unable to load resource') done() }); });
[]
CVE-2023-51665
728496010cbfcee5b7b54001c9f79e02ede30d82
https://github.com/advplyr/audiobookshelf
[{'lang': 'en', 'value': 'Audiobookshelf is a self-hosted audiobook and podcast server. Prior to 2.7.0, Audiobookshelf is vulnerable to unauthenticated blind server-side request (SSRF) vulnerability in Auth.js. This vulnerability has been addressed in version 2.7.0. There are no known workarounds for this vulnerability.\n\n'}]
null
7.5
2023-12-27T18:15Z
nan
CWE-918
Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
Update:/auth/openid/config API endpoint to require admin user and validate issuer URL
2023-12-17 10:41:39 -0600
72849601
934
2
[ "server/Auth.js" ]
JavaScript
{"server/Auth.js": {"lines_added": 27, "lines_deleted": 6}}
diff --git a/server/Auth.js b/server/Auth.js index 0a282c9c..d2334de2 100644 --- a/server/Auth.js +++ b/server/Auth.js @@ -294,11 +294,11 @@ class Auth { // We will allow if it is in the whitelist, by saving it into this.openIdAuthSession and setting the redirect uri to /auth/openid/mobile-redirect // where we will handle the redirect to it if (req.query.redirect_uri) { // Check if the redirect_uri is in the whitelist if (Database.serverSettings.authOpenIDMobileRedirectURIs.includes(req.query.redirect_uri) || - (Database.serverSettings.authOpenIDMobileRedirectURIs.length === 1 && Database.serverSettings.authOpenIDMobileRedirectURIs[0] === '*')) { + (Database.serverSettings.authOpenIDMobileRedirectURIs.length === 1 && Database.serverSettings.authOpenIDMobileRedirectURIs[0] === '*')) { oidcStrategy._params.redirect_uri = new URL(`${protocol}://${req.get('host')}/auth/openid/mobile-redirect`).toString() mobile_redirect_uri = req.query.redirect_uri } else { Logger.debug(`[Auth] Invalid redirect_uri=${req.query.redirect_uri} - not in whitelist`) return res.status(400).send('Invalid redirect_uri') @@ -379,11 +379,11 @@ class Auth { // It will redirect to an app-link like audiobookshelf://oauth router.get('/auth/openid/mobile-redirect', (req, res) => { try { // Extract the state parameter from the request const { state, code } = req.query - + // Check if the state provided is in our list if (!state || !this.openIdAuthSession.has(state)) { Logger.error('[Auth] /auth/openid/mobile-redirect route: State parameter mismatch') return res.status(400).send('State parameter mismatch') } @@ -467,21 +467,42 @@ class Auth { }, // on a successfull login: read the cookies and react like the client requested (callback or json) this.handleLoginSuccessBasedOnCookie.bind(this)) /** - * Used to auto-populate the openid URLs in config/authentication + * Helper route used to auto-populate the openid URLs in config/authentication + * Takes an issuer URL as a query param and requests the config data at "/.well-known/openid-configuration" + * + * @example /auth/openid/config?issuer=http://192.168.1.66:9000/application/o/audiobookshelf/ */ - router.get('/auth/openid/config', async (req, res) => { + router.get('/auth/openid/config', this.isAuthenticated, async (req, res) => { + if (!req.user.isAdminOrUp) { + Logger.error(`[Auth] Non-admin user "${req.user.username}" attempted to get issuer config`) + return res.sendStatus(403) + } + if (!req.query.issuer) { return res.status(400).send('Invalid request. Query param \'issuer\' is required') } + + // Strip trailing slash let issuerUrl = req.query.issuer if (issuerUrl.endsWith('/')) issuerUrl = issuerUrl.slice(0, -1) - const configUrl = `${issuerUrl}/.well-known/openid-configuration` - axios.get(configUrl).then(({ data }) => { + // Append config pathname and validate URL + let configUrl = null + try { + configUrl = new URL(`${issuerUrl}/.well-known/openid-configuration`) + if (!configUrl.pathname.endsWith('/.well-known/openid-configuration')) { + throw new Error('Invalid pathname') + } + } catch (error) { + Logger.error(`[Auth] Failed to get openid configuration. Invalid URL "${configUrl}"`, error) + return res.status(400).send('Invalid request. Query param \'issuer\' is invalid') + } + + axios.get(configUrl.toString()).then(({ data }) => { res.json({ issuer: data.issuer, authorization_endpoint: data.authorization_endpoint, token_endpoint: data.token_endpoint, userinfo_endpoint: data.userinfo_endpoint,
(Database.serverSettings.authOpenIDMobileRedirectURIs.length === 1 && Database.serverSettings.authOpenIDMobileRedirectURIs[0] === '*')) { * Used to auto-populate the openid URLs in config/authentication router.get('/auth/openid/config', async (req, res) => { const configUrl = `${issuerUrl}/.well-known/openid-configuration` axios.get(configUrl).then(({ data }) => {
(Database.serverSettings.authOpenIDMobileRedirectURIs.length === 1 && Database.serverSettings.authOpenIDMobileRedirectURIs[0] === '*')) { * Helper route used to auto-populate the openid URLs in config/authentication * Takes an issuer URL as a query param and requests the config data at "/.well-known/openid-configuration" * * @example /auth/openid/config?issuer=http://192.168.1.66:9000/application/o/audiobookshelf/ router.get('/auth/openid/config', this.isAuthenticated, async (req, res) => { if (!req.user.isAdminOrUp) { Logger.error(`[Auth] Non-admin user "${req.user.username}" attempted to get issuer config`) return res.sendStatus(403) } // Strip trailing slash // Append config pathname and validate URL let configUrl = null try { configUrl = new URL(`${issuerUrl}/.well-known/openid-configuration`) if (!configUrl.pathname.endsWith('/.well-known/openid-configuration')) { throw new Error('Invalid pathname') } } catch (error) { Logger.error(`[Auth] Failed to get openid configuration. Invalid URL "${configUrl}"`, error) return res.status(400).send('Invalid request. Query param \'issuer\' is invalid') } axios.get(configUrl.toString()).then(({ data }) => {
[ "validation", "authentication" ]
CVE-2023-51697
f2f2ea161ca0701e1405e737b0df0f96296e4f64
https://github.com/advplyr/audiobookshelf
[{'lang': 'en', 'value': 'Audiobookshelf is a self-hosted audiobook and podcast server. Prior to 2.7.0, Audiobookshelf is vulnerable to unauthenticated blind server-side request (SSRF) vulnerability in `podcastUtils.js`. This vulnerability has been addressed in version 2.7.0. There are no known workarounds for this vulnerability.\n\n'}]
null
7.5
2023-12-27T18:15Z
nan
CWE-918
Server-Side Request Forgery (SSRF)
The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination.
Update:API endpoint /podcasts/feed validates rssFeed URL and uses SSRF req filter
2023-12-17 12:00:11 -0600
f2f2ea16
934
2
[ "server/controllers/PodcastController.js", "server/utils/index.js", "server/utils/podcastUtils.js" ]
JavaScript
{"server/controllers/PodcastController.js": {"lines_added": 12, "lines_deleted": 2}, "server/utils/index.js": {"lines_added": 22, "lines_deleted": 6}, "server/utils/podcastUtils.js": {"lines_added": 23, "lines_deleted": 5}}
diff --git a/server/controllers/PodcastController.js b/server/controllers/PodcastController.js index 035f9152..e476efd5 100644 --- a/server/controllers/PodcastController.js +++ b/server/controllers/PodcastController.js @@ -4,10 +4,11 @@ const Database = require('../Database') const fs = require('../libs/fsExtra') const { getPodcastFeed, findMatchingEpisodes } = require('../utils/podcastUtils') const { getFileTimestampsWithIno, filePathToPOSIX } = require('../utils/fileUtils') +const { validateUrl } = require('../utils/index') const Scanner = require('../scanner/Scanner') const CoverManager = require('../managers/CoverManager') const LibraryItem = require('../objects/LibraryItem') @@ -100,19 +101,28 @@ class PodcastController { if (libraryItem.media.autoDownloadEpisodes) { this.cronManager.checkUpdatePodcastCron(libraryItem) } } + /** + * POST: /api/podcasts/feed + * + * @typedef getPodcastFeedReqBody + * @property {string} rssFeed + * + * @param {import('express').Request<{}, {}, getPodcastFeedReqBody, {}} req + * @param {import('express').Response} res + */ async getPodcastFeed(req, res) { if (!req.user.isAdminOrUp) { Logger.error(`[PodcastController] Non-admin user "${req.user.username}" attempted to get podcast feed`) return res.sendStatus(403) } - var url = req.body.rssFeed + const url = validateUrl(req.body.rssFeed) if (!url) { - return res.status(400).send('Bad request') + return res.status(400).send('Invalid request body. "rssFeed" must be a valid URL') } const podcast = await getPodcastFeed(url) if (!podcast) { return res.status(404).send('Podcast RSS feed request failed or invalid response data') diff --git a/server/utils/index.js b/server/utils/index.js index 0377b173..29a65885 100644 --- a/server/utils/index.js +++ b/server/utils/index.js @@ -9,28 +9,28 @@ const levenshteinDistance = (str1, str2, caseSensitive = false) => { if (!caseSensitive) { str1 = str1.toLowerCase() str2 = str2.toLowerCase() } const track = Array(str2.length + 1).fill(null).map(() => - Array(str1.length + 1).fill(null)); + Array(str1.length + 1).fill(null)) for (let i = 0; i <= str1.length; i += 1) { - track[0][i] = i; + track[0][i] = i } for (let j = 0; j <= str2.length; j += 1) { - track[j][0] = j; + track[j][0] = j } for (let j = 1; j <= str2.length; j += 1) { for (let i = 1; i <= str1.length; i += 1) { - const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1; + const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1 track[j][i] = Math.min( track[j][i - 1] + 1, // deletion track[j - 1][i] + 1, // insertion track[j - 1][i - 1] + indicator, // substitution - ); + ) } } - return track[str2.length][str1.length]; + return track[str2.length][str1.length] } module.exports.levenshteinDistance = levenshteinDistance module.exports.isObject = (val) => { return val !== null && typeof val === 'object' @@ -202,6 +202,22 @@ module.exports.asciiOnlyToLowerCase = (str) => { * @returns {string} */ module.exports.escapeRegExp = (str) => { if (typeof str !== 'string') return '' return str.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') +} + +/** + * Validate url string with URL class + * + * @param {string} rawUrl + * @returns {string} null if invalid + */ +module.exports.validateUrl = (rawUrl) => { + if (!rawUrl || typeof rawUrl !== 'string') return null + try { + return new URL(rawUrl).toString() + } catch (error) { + Logger.error(`Invalid URL "${rawUrl}"`, error) + return null + } } \ No newline at end of file diff --git a/server/utils/podcastUtils.js b/server/utils/podcastUtils.js index 87b080d7..819ec914 100644 --- a/server/utils/podcastUtils.js +++ b/server/utils/podcastUtils.js @@ -1,7 +1,8 @@ -const Logger = require('../Logger') const axios = require('axios') +const ssrfFilter = require('ssrf-req-filter') +const Logger = require('../Logger') const { xmlToJSON, levenshteinDistance } = require('./index') const htmlSanitizer = require('../utils/htmlSanitizer') function extractFirstArrayItem(json, key) { if (!json[key]?.length) return null @@ -214,13 +215,30 @@ module.exports.parsePodcastRssFeedXml = async (xml, excludeEpisodeMetadata = fal podcast } } } +/** + * Get podcast RSS feed as JSON + * Uses SSRF filter to prevent internal URLs + * + * @param {string} feedUrl + * @param {boolean} [excludeEpisodeMetadata=false] + * @returns {Promise} + */ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { Logger.debug(`[podcastUtils] getPodcastFeed for "${feedUrl}"`) - return axios.get(feedUrl, { timeout: 12000, responseType: 'arraybuffer', headers: { Accept: 'application/rss+xml' } }).then(async (data) => { + + return axios({ + url: feedUrl, + method: 'GET', + timeout: 12000, + responseType: 'arraybuffer', + headers: { Accept: 'application/rss+xml' }, + httpAgent: ssrfFilter(feedUrl), + httpsAgent: ssrfFilter(feedUrl) + }).then(async (data) => { // Adding support for ios-8859-1 encoded RSS feeds. // See: https://github.com/advplyr/audiobookshelf/issues/1489 const contentType = data.headers?.['content-type'] || '' // e.g. text/xml; charset=iso-8859-1 if (contentType.toLowerCase().includes('iso-8859-1')) { @@ -229,25 +247,25 @@ module.exports.getPodcastFeed = (feedUrl, excludeEpisodeMetadata = false) => { data.data = data.data.toString() } if (!data?.data) { Logger.error(`[podcastUtils] getPodcastFeed: Invalid podcast feed request response (${feedUrl})`) - return false + return null } Logger.debug(`[podcastUtils] getPodcastFeed for "${feedUrl}" success - parsing xml`) const payload = await this.parsePodcastRssFeedXml(data.data, excludeEpisodeMetadata) if (!payload) { - return false + return null } // RSS feed may be a private RSS feed payload.podcast.metadata.feedUrl = feedUrl return payload.podcast }).catch((error) => { Logger.error('[podcastUtils] getPodcastFeed Error', error) - return false + return null }) } // Return array of episodes ordered by closest match (Levenshtein distance of 6 or less) module.exports.findMatchingEpisodes = async (feedUrl, searchTitle) => {
var url = req.body.rssFeed return res.status(400).send('Bad request') Array(str1.length + 1).fill(null)); track[0][i] = i; track[j][0] = j; const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1; ); return track[str2.length][str1.length]; const Logger = require('../Logger') return axios.get(feedUrl, { timeout: 12000, responseType: 'arraybuffer', headers: { Accept: 'application/rss+xml' } }).then(async (data) => { return false return false return false
const { validateUrl } = require('../utils/index') /** * POST: /api/podcasts/feed * * @typedef getPodcastFeedReqBody * @property {string} rssFeed * * @param {import('express').Request<{}, {}, getPodcastFeedReqBody, {}} req * @param {import('express').Response} res */ const url = validateUrl(req.body.rssFeed) return res.status(400).send('Invalid request body. "rssFeed" must be a valid URL') Array(str1.length + 1).fill(null)) track[0][i] = i track[j][0] = j const indicator = str1[i - 1] === str2[j - 1] ? 0 : 1 ) return track[str2.length][str1.length] } /** * Validate url string with URL class * * @param {string} rawUrl * @returns {string} null if invalid */ module.exports.validateUrl = (rawUrl) => { if (!rawUrl || typeof rawUrl !== 'string') return null try { return new URL(rawUrl).toString() } catch (error) { Logger.error(`Invalid URL "${rawUrl}"`, error) return null } const ssrfFilter = require('ssrf-req-filter') const Logger = require('../Logger') /** * Get podcast RSS feed as JSON * Uses SSRF filter to prevent internal URLs * * @param {string} feedUrl * @param {boolean} [excludeEpisodeMetadata=false] * @returns {Promise} */ return axios({ url: feedUrl, method: 'GET', timeout: 12000, responseType: 'arraybuffer', headers: { Accept: 'application/rss+xml' }, httpAgent: ssrfFilter(feedUrl), httpsAgent: ssrfFilter(feedUrl) }).then(async (data) => { return null return null return null
[ "sanitization", "validation" ]
CVE-2024-35236
ce7f891b9b2cb57c6644aaf96f89a8bda6307664
https://github.com/advplyr/audiobookshelf
[{'lang': 'en', 'value': 'Audiobookshelf is a self-hosted audiobook and podcast server. Prior to version 2.10.0, opening an ebook with malicious scripts inside leads to code execution inside the browsing context. Attacking a user with high privileges (upload, creation of libraries) can lead to remote code execution (RCE) in the worst case. This was tested on version 2.9.0 on Windows, but an arbitrary file write is powerful enough as is and should easily lead to RCE on Linux, too. Version 2.10.0 contains a patch for the vulnerability.'}]
null
null
2024-05-27T17:15Z
nan
NVD-CWE-noinfo
Insufficient Information
There is insufficient information about the issue to classify it; details are unkown or unspecified.
Update:Disable epubs from running scripts by default, add library setting to enable it GHSA-7j99-76cj-q9pg
2024-05-26 16:01:08 -0500
ce7f891b9
934
2
[ "client/components/modals/libraries/LibrarySettings.vue", "client/components/readers/EpubReader.vue", "client/store/libraries.js", "client/strings/bg.json", "client/strings/bn.json", "client/strings/cs.json", "client/strings/da.json", "client/strings/de.json", "client/strings/en-us.json", "client/strings/es.json", "client/strings/et.json", "client/strings/fr.json", "client/strings/gu.json", "client/strings/he.json", "client/strings/hi.json", "client/strings/hr.json", "client/strings/hu.json", "client/strings/it.json", "client/strings/lt.json", "client/strings/nl.json", "client/strings/no.json", "client/strings/pl.json", "client/strings/pt-br.json", "client/strings/ru.json", "client/strings/sv.json", "client/strings/uk.json", "client/strings/vi-vn.json", "client/strings/zh-cn.json", "client/strings/zh-tw.json", "server/objects/settings/LibrarySettings.js" ]
JSON
{"client/components/modals/libraries/LibrarySettings.vue": {"lines_added": 15, "lines_deleted": 1}, "client/components/readers/EpubReader.vue": {"lines_added": 4, "lines_deleted": 1}, "client/store/libraries.js": {"lines_added": 29, "lines_deleted": 25}, "client/strings/bg.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/bn.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/cs.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/da.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/de.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/en-us.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/es.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/et.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/fr.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/gu.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/he.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/hi.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/hr.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/hu.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/it.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/lt.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/nl.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/no.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/pl.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/pt-br.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/ru.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/sv.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/uk.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/vi-vn.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/zh-cn.json": {"lines_added": 2, "lines_deleted": 0}, "client/strings/zh-tw.json": {"lines_added": 2, "lines_deleted": 0}, "server/objects/settings/LibrarySettings.js": {"lines_added": 4, "lines_deleted": 1}}
diff --git a/client/components/modals/libraries/LibrarySettings.vue b/client/components/modals/libraries/LibrarySettings.vue index 4183c4fe4..3808ed07b 100644 --- a/client/components/modals/libraries/LibrarySettings.vue +++ b/client/components/modals/libraries/LibrarySettings.vue @@ -58,10 +58,21 @@ <span class="material-icons icon-text text-sm">info_outlined</span> </p> </ui-tooltip> </div> </div> + <div v-if="isBookLibrary" class="py-3"> + <div class="flex items-center"> + <ui-toggle-switch v-model="epubsAllowScriptedContent" @input="formUpdated" /> + <ui-tooltip :text="$strings.LabelSettingsEpubsAllowScriptedContentHelp"> + <p class="pl-4 text-base"> + {{ $strings.LabelSettingsEpubsAllowScriptedContent }} + <span class="material-icons icon-text text-sm">info_outlined</span> + </p> + </ui-tooltip> + </div> + </div> <div v-if="isPodcastLibrary" class="py-3"> <ui-dropdown :label="$strings.LabelPodcastSearchRegion" v-model="podcastSearchRegion" :items="$podcastSearchRegionOptions" small class="max-w-72" menu-max-height="200px" @input="formUpdated" /> </div> </div> </template> @@ -81,10 +92,11 @@ export default { useSquareBookCovers: false, enableWatcher: false, skipMatchingMediaWithAsin: false, skipMatchingMediaWithIsbn: false, audiobooksOnly: false, + epubsAllowScriptedContent: false, hideSingleBookSeries: false, onlyShowLaterBooksInContinueSeries: false, podcastSearchRegion: 'us' } }, @@ -116,10 +128,11 @@ export default { coverAspectRatio: this.useSquareBookCovers ? this.$constants.BookCoverAspectRatio.SQUARE : this.$constants.BookCoverAspectRatio.STANDARD, disableWatcher: !this.enableWatcher, skipMatchingMediaWithAsin: !!this.skipMatchingMediaWithAsin, skipMatchingMediaWithIsbn: !!this.skipMatchingMediaWithIsbn, audiobooksOnly: !!this.audiobooksOnly, + epubsAllowScriptedContent: !!this.epubsAllowScriptedContent, hideSingleBookSeries: !!this.hideSingleBookSeries, onlyShowLaterBooksInContinueSeries: !!this.onlyShowLaterBooksInContinueSeries, podcastSearchRegion: this.podcastSearchRegion } } @@ -131,15 +144,16 @@ export default { this.useSquareBookCovers = this.librarySettings.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE this.enableWatcher = !this.librarySettings.disableWatcher this.skipMatchingMediaWithAsin = !!this.librarySettings.skipMatchingMediaWithAsin this.skipMatchingMediaWithIsbn = !!this.librarySettings.skipMatchingMediaWithIsbn this.audiobooksOnly = !!this.librarySettings.audiobooksOnly + this.epubsAllowScriptedContent = !!this.librarySettings.epubsAllowScriptedContent this.hideSingleBookSeries = !!this.librarySettings.hideSingleBookSeries this.onlyShowLaterBooksInContinueSeries = !!this.librarySettings.onlyShowLaterBooksInContinueSeries this.podcastSearchRegion = this.librarySettings.podcastSearchRegion || 'us' } }, mounted() { this.init() } } -</script> \ No newline at end of file +</script> diff --git a/client/components/readers/EpubReader.vue b/client/components/readers/EpubReader.vue index 3941c0d81..819f5beb1 100644 --- a/client/components/readers/EpubReader.vue +++ b/client/components/readers/EpubReader.vue @@ -61,10 +61,13 @@ export default { }, /** @returns {string} */ libraryItemId() { return this.libraryItem?.id }, + allowScriptedContent() { + return this.$store.getters['libraries/getLibraryEpubsAllowScriptedContent'] + }, hasPrev() { return !this.rendition?.location?.atStart }, hasNext() { return !this.rendition?.location?.atEnd @@ -314,11 +317,11 @@ export default { /** @type {ePub.Rendition} */ reader.rendition = reader.book.renderTo('viewer', { width: this.readerWidth, height: this.readerHeight * 0.8, - allowScriptedContent: true, + allowScriptedContent: this.allowScriptedContent, spread: 'auto', snap: true, manager: 'continuous', flow: 'paginated' }) diff --git a/client/store/libraries.js b/client/store/libraries.js index 1d13d6322..f56bdad67 100644 --- a/client/store/libraries.js +++ b/client/store/libraries.js @@ -14,27 +14,27 @@ export const state = () => ({ userPlaylists: [], ereaderDevices: [] }) export const getters = { - getCurrentLibrary: state => { - return state.libraries.find(lib => lib.id === state.currentLibraryId) + getCurrentLibrary: (state) => { + return state.libraries.find((lib) => lib.id === state.currentLibraryId) }, getCurrentLibraryName: (state, getters) => { var currentLibrary = getters.getCurrentLibrary if (!currentLibrary) return '' return currentLibrary.name }, getCurrentLibraryMediaType: (state, getters) => { if (!getters.getCurrentLibrary) return null return getters.getCurrentLibrary.mediaType }, - getSortedLibraries: state => () => { - return state.libraries.map(lib => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder) + getSortedLibraries: (state) => () => { + return state.libraries.map((lib) => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder) }, - getLibraryProvider: state => libraryId => { - var library = state.libraries.find(l => l.id === libraryId) + getLibraryProvider: (state) => (libraryId) => { + var library = state.libraries.find((l) => l.id === libraryId) if (!library) return null return library.provider }, getNextAccessibleLibrary: (state, getters, rootState, rootGetters) => { var librariesSorted = getters['getSortedLibraries']() @@ -58,26 +58,30 @@ export const getters = { return getters.getCurrentLibrarySettings.coverAspectRatio === Constants.BookCoverAspectRatio.STANDARD ? 1.6 : 1 }, getLibraryIsAudiobooksOnly: (state, getters) => { return !!getters.getCurrentLibrarySettings?.audiobooksOnly }, - getCollection: state => id => { - return state.collections.find(c => c.id === id) + getLibraryEpubsAllowScriptedContent: (state, getters) => { + return !!getters.getCurrentLibrarySettings?.epubsAllowScriptedContent }, - getPlaylist: state => id => { - return state.userPlaylists.find(p => p.id === id) + getCollection: (state) => (id) => { + return state.collections.find((c) => c.id === id) + }, + getPlaylist: (state) => (id) => { + return state.userPlaylists.find((p) => p.id === id) } } export const actions = { requestLibraryScan({ state, commit }, { libraryId, force }) { return this.$axios.$post(`/api/libraries/${libraryId}/scan?force=${force ? 1 : 0}`) }, loadFolders({ state, commit }) { if (state.folders.length) { const lastCheck = Date.now() - state.folderLastUpdate - if (lastCheck < 1000 * 5) { // 5 seconds + if (lastCheck < 1000 * 5) { + // 5 seconds // Folders up to date return state.folders } } commit('setFoldersLastUpdate') @@ -202,11 +206,11 @@ export const mutations = { state.listeners.forEach((listener) => { listener.meth() }) }, addUpdate(state, library) { - var index = state.libraries.findIndex(a => a.id === library.id) + var index = state.libraries.findIndex((a) => a.id === library.id) if (index >= 0) { state.libraries.splice(index, 1, library) } else { state.libraries.push(library) } @@ -214,33 +218,33 @@ export const mutations = { state.listeners.forEach((listener) => { listener.meth() }) }, remove(state, library) { - state.libraries = state.libraries.filter(a => a.id !== library.id) + state.libraries = state.libraries.filter((a) => a.id !== library.id) state.listeners.forEach((listener) => { listener.meth() }) }, addListener(state, listener) { - var index = state.listeners.findIndex(l => l.id === listener.id) + var index = state.listeners.findIndex((l) => l.id === listener.id) if (index >= 0) state.listeners.splice(index, 1, listener) else state.listeners.push(listener) }, removeListener(state, listenerId) { - state.listeners = state.listeners.filter(l => l.id !== listenerId) + state.listeners = state.listeners.filter((l) => l.id !== listenerId) }, setLibraryFilterData(state, filterData) { state.filterData = filterData }, setNumUserPlaylists(state, numUserPlaylists) { state.numUserPlaylists = numUserPlaylists }, removeSeriesFromFilterData(state, seriesId) { if (!seriesId || !state.filterData) return - state.filterData.series = state.filterData.series.filter(se => se.id !== seriesId) + state.filterData.series = state.filterData.series.filter((se) => se.id !== seriesId) }, updateFilterDataWithItem(state, libraryItem) { if (!libraryItem || !state.filterData) return if (state.currentLibraryId !== libraryItem.libraryId) return /* @@ -258,29 +262,29 @@ export const mutations = { const mediaMetadata = libraryItem.media.metadata // Add/update book authors if (mediaMetadata.authors?.length) { mediaMetadata.authors.forEach((author) => { - const indexOf = state.filterData.authors.findIndex(au => au.id === author.id) + const indexOf = state.filterData.authors.findIndex((au) => au.id === author.id) if (indexOf >= 0) { state.filterData.authors.splice(indexOf, 1, author) } else { state.filterData.authors.push(author) - state.filterData.authors.sort((a, b) => (a.name || '').localeCompare((b.name || ''))) + state.filterData.authors.sort((a, b) => (a.name || '').localeCompare(b.name || '')) } }) } // Add/update series if (mediaMetadata.series?.length) { mediaMetadata.series.forEach((series) => { - const indexOf = state.filterData.series.findIndex(se => se.id === series.id) + const indexOf = state.filterData.series.findIndex((se) => se.id === series.id) if (indexOf >= 0) { state.filterData.series.splice(indexOf, 1, { id: series.id, name: series.name }) } else { state.filterData.series.push({ id: series.id, name: series.name }) - state.filterData.series.sort((a, b) => (a.name || '').localeCompare((b.name || ''))) + state.filterData.series.sort((a, b) => (a.name || '').localeCompare(b.name || '')) } }) } // Add genres @@ -327,36 +331,36 @@ export const mutations = { }, setCollections(state, collections) { state.collections = collections }, addUpdateCollection(state, collection) { - var index = state.collections.findIndex(c => c.id === collection.id) + var index = state.collections.findIndex((c) => c.id === collection.id) if (index >= 0) { state.collections.splice(index, 1, collection) } else { state.collections.push(collection) } }, removeCollection(state, collection) { - state.collections = state.collections.filter(c => c.id !== collection.id) + state.collections = state.collections.filter((c) => c.id !== collection.id) }, setUserPlaylists(state, playlists) { state.userPlaylists = playlists state.numUserPlaylists = playlists.length }, addUpdateUserPlaylist(state, playlist) { - const index = state.userPlaylists.findIndex(p => p.id === playlist.id) + const index = state.userPlaylists.findIndex((p) => p.id === playlist.id) if (index >= 0) { state.userPlaylists.splice(index, 1, playlist) } else { state.userPlaylists.push(playlist) state.numUserPlaylists++ } }, removeUserPlaylist(state, playlist) { - state.userPlaylists = state.userPlaylists.filter(p => p.id !== playlist.id) + state.userPlaylists = state.userPlaylists.filter((p) => p.id !== playlist.id) state.numUserPlaylists = state.userPlaylists.length }, setEReaderDevices(state, ereaderDevices) { state.ereaderDevices = ereaderDevices } -} \ No newline at end of file +} diff --git a/client/strings/bg.json b/client/strings/bg.json index f8c9c5948..0858856e4 100644 --- a/client/strings/bg.json +++ b/client/strings/bg.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Изключи наблюдателя за библиотека", "LabelSettingsDisableWatcherHelp": "Изключва автоматичното добавяне/обновяване на елементи, когато се открият промени във файловете. *Изисква рестарт на сървъра", "LabelSettingsEnableWatcher": "Включи наблюдателя", "LabelSettingsEnableWatcherForLibrary": "Включи наблюдателя за библиотека", "LabelSettingsEnableWatcherHelp": "Включва автоматичното добавяне/обновяване на елементи, когато се открият промени във файловете. *Изисква рестарт на сървъра", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Експериментални Функции", "LabelSettingsExperimentalFeaturesHelp": "Функции в разработка, които могат да изискват вашето мнение и помощ за тестване. Кликнете за да отворите дискусия в github.", "LabelSettingsFindCovers": "Намери Корици", "LabelSettingsFindCoversHelp": "Ако аудиокнигата ви няма вградена корица или изображение на корицата в папката, скенерът ще опита да намери корица.<br>Забележка: Това ще удължи времето за сканиране", "LabelSettingsHideSingleBookSeries": "Скрий серии с една книга", diff --git a/client/strings/bn.json b/client/strings/bn.json index 07e226a8b..89fe78fef 100644 --- a/client/strings/bn.json +++ b/client/strings/bn.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "লাইব্রেরির জন্য ফোল্ডার প্রহরী নিষ্ক্রিয় করুন", "LabelSettingsDisableWatcherHelp": "ফাইলের পরিবর্তন শনাক্ত হলে স্বয়ংক্রিয়ভাবে আইটেম যোগ/আপডেট করা অক্ষম করবে। *সার্ভার পুনরায় চালু করতে হবে", "LabelSettingsEnableWatcher": "প্রহরী সক্ষম করুন", "LabelSettingsEnableWatcherForLibrary": "লাইব্রেরির জন্য ফোল্ডার প্রহরী সক্ষম করুন", "LabelSettingsEnableWatcherHelp": "ফাইলের পরিবর্তন শনাক্ত হলে আইটেমগুলির স্বয়ংক্রিয় যোগ/আপডেট সক্ষম করবে। *সার্ভার পুনরায় চালু করতে হবে", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "পরীক্ষামূলক বৈশিষ্ট্য", "LabelSettingsExperimentalFeaturesHelp": "ফিচারের বৈশিষ্ট্য যা আপনার প্রতিক্রিয়া ব্যবহার করতে পারে এবং পরীক্ষায় সহায়তা করতে পারে। গিটহাব আলোচনা খুলতে ক্লিক করুন।", "LabelSettingsFindCovers": "কভার খুঁজুন", "LabelSettingsFindCoversHelp": "যদি আপনার অডিওবইয়ের ফোল্ডারের ভিতরে একটি এমবেডেড কভার বা কভার ইমেজ না থাকে, তাহলে স্ক্যানার একটি কভার খোঁজার চেষ্টা করবে৷<br>দ্রষ্টব্য: এটি স্ক্যানের সময় বাড়িয়ে দেবে", "LabelSettingsHideSingleBookSeries": "একক বই সিরিজ লুকান", diff --git a/client/strings/cs.json b/client/strings/cs.json index f7aeda3a3..b326996d1 100644 --- a/client/strings/cs.json +++ b/client/strings/cs.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Zakázat sledování složky pro knihovnu", "LabelSettingsDisableWatcherHelp": "Zakáže automatické přidávání/aktualizaci položek při zjištění změn v souboru. *Vyžaduje restart serveru", "LabelSettingsEnableWatcher": "Povolit sledování", "LabelSettingsEnableWatcherForLibrary": "Povolit sledování složky pro knihovnu", "LabelSettingsEnableWatcherHelp": "Povoluje automatické přidávání/aktualizaci položek, když jsou zjištěny změny souborů. *Vyžaduje restart serveru", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimentální funkce", "LabelSettingsExperimentalFeaturesHelp": "Funkce ve vývoji, které by mohly využít vaši zpětnou vazbu a pomoc s testováním. Kliknutím otevřete diskuzi na githubu.", "LabelSettingsFindCovers": "Najít obálky", "LabelSettingsFindCoversHelp": "Pokud vaše audiokniha nemá vloženou obálku nebo obrázek obálky uvnitř složky, skener se pokusí obálku najít.<br>Poznámka: Tím se prodlouží doba prohledávání", "LabelSettingsHideSingleBookSeries": "Skrýt sérii s jedinou knihou", diff --git a/client/strings/da.json b/client/strings/da.json index 080d61d52..96a0d04b2 100644 --- a/client/strings/da.json +++ b/client/strings/da.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Deaktiver mappeovervågning for bibliotek", "LabelSettingsDisableWatcherHelp": "Deaktiverer automatisk tilføjelse/opdatering af elementer, når der registreres filændringer. *Kræver servergenstart", "LabelSettingsEnableWatcher": "Aktiver overvågning", "LabelSettingsEnableWatcherForLibrary": "Aktiver mappeovervågning for bibliotek", "LabelSettingsEnableWatcherHelp": "Aktiverer automatisk tilføjelse/opdatering af elementer, når filændringer registreres. *Kræver servergenstart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Eksperimentelle funktioner", "LabelSettingsExperimentalFeaturesHelp": "Funktioner under udvikling, der kunne bruge din feedback og hjælp til test. Klik for at åbne Github-diskussionen.", "LabelSettingsFindCovers": "Find omslag", "LabelSettingsFindCoversHelp": "Hvis din lydbog ikke har et indlejret omslag eller et omslagsbillede i mappen, vil skanneren forsøge at finde et omslag.<br>Bemærk: Dette vil forlænge scanntiden", "LabelSettingsHideSingleBookSeries": "Skjul enkeltbogsserier", diff --git a/client/strings/de.json b/client/strings/de.json index dcf23084a..4ce822ddd 100644 --- a/client/strings/de.json +++ b/client/strings/de.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Ordnerüberwachung für die Bibliothek deaktivieren", "LabelSettingsDisableWatcherHelp": "Deaktiviert das automatische Hinzufügen/Aktualisieren von Elementen, wenn Dateiänderungen erkannt werden. *Erfordert einen Server-Neustart", "LabelSettingsEnableWatcher": "Überwachung aktivieren", "LabelSettingsEnableWatcherForLibrary": "Ordnerüberwachung für die Bibliothek aktivieren", "LabelSettingsEnableWatcherHelp": "Aktiviert das automatische Hinzufügen/Aktualisieren von Elementen, wenn Dateiänderungen erkannt werden. *Erfordert einen Server-Neustart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimentelle Funktionen", "LabelSettingsExperimentalFeaturesHelp": "Funktionen welche sich in der Entwicklung befinden, benötigen dein Feedback und deine Hilfe beim Testen. Klicke hier, um die Github-Diskussion zu öffnen.", "LabelSettingsFindCovers": "Suche Titelbilder", "LabelSettingsFindCoversHelp": "Wenn dein Medium kein eingebettetes Titelbild oder kein Titelbild im Ordner hat, versucht der Scanner, ein Titelbild online zu finden.<br>Hinweis: Dies verlängert die Scandauer", "LabelSettingsHideSingleBookSeries": "Ausblenden einzelner Bücher", diff --git a/client/strings/en-us.json b/client/strings/en-us.json index 7828f5f9f..2a390b5fa 100644 --- a/client/strings/en-us.json +++ b/client/strings/en-us.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Disable folder watcher for library", "LabelSettingsDisableWatcherHelp": "Disables the automatic adding/updating of items when file changes are detected. *Requires server restart", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimental features", "LabelSettingsExperimentalFeaturesHelp": "Features in development that could use your feedback and help testing. Click to open github discussion.", "LabelSettingsFindCovers": "Find covers", "LabelSettingsFindCoversHelp": "If your audiobook does not have an embedded cover or a cover image inside the folder, the scanner will attempt to find a cover.<br>Note: This will extend scan time", "LabelSettingsHideSingleBookSeries": "Hide single book series", diff --git a/client/strings/es.json b/client/strings/es.json index 0b1279674..cead84e25 100644 --- a/client/strings/es.json +++ b/client/strings/es.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Deshabilitar Watcher de Carpetas para esta biblioteca", "LabelSettingsDisableWatcherHelp": "Deshabilitar la función de agregar/actualizar elementos automáticamente cuando se detectan cambios en los archivos. *Require Reiniciar el Servidor", "LabelSettingsEnableWatcher": "Habilitar Watcher", "LabelSettingsEnableWatcherForLibrary": "Habilitar Watcher para la carpeta de esta biblioteca", "LabelSettingsEnableWatcherHelp": "Permite agregar/actualizar elementos automáticamente cuando se detectan cambios en los archivos. *Requiere reiniciar el servidor", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Funciones Experimentales", "LabelSettingsExperimentalFeaturesHelp": "Funciones en desarrollo que se beneficiarían de sus comentarios y experiencias de prueba. Haga click aquí para abrir una conversación en Github.", "LabelSettingsFindCovers": "Buscar Portadas", "LabelSettingsFindCoversHelp": "Si tu audiolibro no tiene una portada incluída, o la portada no esta dentro de la carpeta, el escaneador tratará de encontrar una portada.<br>Nota: Esto extenderá el tiempo de escaneo", "LabelSettingsHideSingleBookSeries": "Esconder series con un solo libro", diff --git a/client/strings/et.json b/client/strings/et.json index 9944fca13..fcf7c4ce2 100644 --- a/client/strings/et.json +++ b/client/strings/et.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Keela kaustavaatamine raamatukogu jaoks", "LabelSettingsDisableWatcherHelp": "Keelab automaatse lisamise/uuendamise, kui failimuudatusi tuvastatakse. *Nõuab serveri taaskäivitamist", "LabelSettingsEnableWatcher": "Luba vaatamine", "LabelSettingsEnableWatcherForLibrary": "Luba kaustavaatamine raamatukogu jaoks", "LabelSettingsEnableWatcherHelp": "Lubab automaatset lisamist/uuendamist, kui tuvastatakse failimuudatused. *Nõuab serveri taaskäivitamist", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Eksperimentaalsed funktsioonid", "LabelSettingsExperimentalFeaturesHelp": "Arengus olevad funktsioonid, mis vajavad teie tagasisidet ja abi testimisel. Klõpsake GitHubi arutelu avamiseks.", "LabelSettingsFindCovers": "Leia ümbrised", "LabelSettingsFindCoversHelp": "Kui teie heliraamatul pole sisseehitatud ümbrist ega ümbrise pilti kaustas, proovib skanner leida ümbrist.<br>Märkus: see pikendab skaneerimisaega", "LabelSettingsHideSingleBookSeries": "Peida üksikute raamatute seeriad", diff --git a/client/strings/fr.json b/client/strings/fr.json index 053de0d38..ae7f60f3b 100644 --- a/client/strings/fr.json +++ b/client/strings/fr.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Désactiver la surveillance des dossiers pour la bibliothèque", "LabelSettingsDisableWatcherHelp": "Désactive la mise à jour automatique lorsque des modifications de fichiers sont détectées. * nécessite le redémarrage du serveur", "LabelSettingsEnableWatcher": "Activer la veille", "LabelSettingsEnableWatcherForLibrary": "Activer la surveillance des dossiers pour la bibliothèque", "LabelSettingsEnableWatcherHelp": "Active la mise à jour automatique automatique lorsque des modifications de fichiers sont détectées. * nécessite le redémarrage du serveur", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Fonctionnalités expérimentales", "LabelSettingsExperimentalFeaturesHelp": "Fonctionnalités en cours de développement sur lesquelles nous attendons votre retour et expérience. Cliquez pour ouvrir la discussion GitHub.", "LabelSettingsFindCovers": "Chercher des couvertures de livre", "LabelSettingsFindCoversHelp": "Si votre livre audio ne possède pas de couverture intégrée ou une image de couverture dans le dossier, l’analyseur tentera de récupérer une couverture.<br>Attention, cela peut augmenter le temps d’analyse.", "LabelSettingsHideSingleBookSeries": "Masquer les séries de livres uniques", diff --git a/client/strings/gu.json b/client/strings/gu.json index 2f7be4d01..11c475043 100644 --- a/client/strings/gu.json +++ b/client/strings/gu.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Disable folder watcher for library", "LabelSettingsDisableWatcherHelp": "Disables the automatic adding/updating of items when file changes are detected. *Requires server restart", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimental features", "LabelSettingsExperimentalFeaturesHelp": "Features in development that could use your feedback and help testing. Click to open github discussion.", "LabelSettingsFindCovers": "Find covers", "LabelSettingsFindCoversHelp": "If your audiobook does not have an embedded cover or a cover image inside the folder, the scanner will attempt to find a cover.<br>Note: This will extend scan time", "LabelSettingsHideSingleBookSeries": "Hide single book series", diff --git a/client/strings/he.json b/client/strings/he.json index 9ddf2d5fd..7d17a2a88 100644 --- a/client/strings/he.json +++ b/client/strings/he.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "השבת עוקב תיקייה עבור ספרייה", "LabelSettingsDisableWatcherHelp": "מבטל את הוספת/עדכון אוטומטי של פריטים כאשר שינויי קבצים זוהים. *דורש איתחול שרת", "LabelSettingsEnableWatcher": "הפעל עוקב", "LabelSettingsEnableWatcherForLibrary": "הפעל עוקב תיקייה עבור ספרייה", "LabelSettingsEnableWatcherHelp": "מאפשר הוספת/עדכון אוטומטי של פריטים כאשר שינויי קבצים זוהים. *דורש איתחול שרת", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "תכונות ניסיוניות", "LabelSettingsExperimentalFeaturesHelp": "תכונות בפיתוח שדורשות משובך ובדיקה. לחץ לפתיחת דיון ב-GitHub.", "LabelSettingsFindCovers": "מצא כריכות", "LabelSettingsFindCoversHelp": "אם לספר הקולי שלך אין כריכה מוטמעת או תמונת כריכה בתיקייה, הסורק ינסה למצוא תמונת כריכה.<br>שים לב: זה יאריך את זמן הסריקה", "LabelSettingsHideSingleBookSeries": "הסתר סדרות עם ספר אחד", diff --git a/client/strings/hi.json b/client/strings/hi.json index df09699f1..83b7f011a 100644 --- a/client/strings/hi.json +++ b/client/strings/hi.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Disable folder watcher for library", "LabelSettingsDisableWatcherHelp": "Disables the automatic adding/updating of items when file changes are detected. *Requires server restart", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimental features", "LabelSettingsExperimentalFeaturesHelp": "Features in development that could use your feedback and help testing. Click to open github discussion.", "LabelSettingsFindCovers": "Find covers", "LabelSettingsFindCoversHelp": "If your audiobook does not have an embedded cover or a cover image inside the folder, the scanner will attempt to find a cover.<br>Note: This will extend scan time", "LabelSettingsHideSingleBookSeries": "Hide single book series", diff --git a/client/strings/hr.json b/client/strings/hr.json index f1c47bd22..a3a88e9ce 100644 --- a/client/strings/hr.json +++ b/client/strings/hr.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Isključi folder watchera za biblioteku", "LabelSettingsDisableWatcherHelp": "Isključi automatsko dodavanje/aktualiziranje stavci ako su promjene prepoznate. *Potreban restart servera", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Eksperimentalni features", "LabelSettingsExperimentalFeaturesHelp": "Features u razvoju trebaju vaš feedback i pomoć pri testiranju. Klikni da odeš to Github discussionsa.", "LabelSettingsFindCovers": "Pronađi covers", "LabelSettingsFindCoversHelp": "Ako audiobook nema embedani cover or a cover sliku unutar foldera, skener će probati pronaći cover.<br>Bilješka: Ovo će produžiti trjanje skeniranja", "LabelSettingsHideSingleBookSeries": "Hide single book series", diff --git a/client/strings/hu.json b/client/strings/hu.json index 8cdb4566d..971c45fc8 100644 --- a/client/strings/hu.json +++ b/client/strings/hu.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Mappafigyelő letiltása a könyvtárban", "LabelSettingsDisableWatcherHelp": "Letiltja az automatikus elem hozzáadás/frissítés funkciót, amikor fájlváltozásokat észlel. *Szerver újraindítása szükséges", "LabelSettingsEnableWatcher": "Figyelő engedélyezése", "LabelSettingsEnableWatcherForLibrary": "Mappafigyelő engedélyezése a könyvtárban", "LabelSettingsEnableWatcherHelp": "Engedélyezi az automatikus elem hozzáadás/frissítés funkciót, amikor fájlváltozásokat észlel. *Szerver újraindítása szükséges", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Kísérleti funkciók", "LabelSettingsExperimentalFeaturesHelp": "Fejlesztés alatt álló funkciók, amelyek visszajelzésre és tesztelésre szorulnak. Kattintson a github megbeszélés megnyitásához.", "LabelSettingsFindCovers": "Borítók keresése", "LabelSettingsFindCoversHelp": "Ha a hangoskönyvnek nincs beágyazott borítója vagy borítóképe a mappában, a szkenner megpróbálja megtalálni a borítót.<br>Megjegyzés: Ez meghosszabbítja a szkennelési időt", "LabelSettingsHideSingleBookSeries": "Egykönyves sorozatok elrejtése", diff --git a/client/strings/it.json b/client/strings/it.json index f2295d2b1..549ea94d4 100644 --- a/client/strings/it.json +++ b/client/strings/it.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Disattiva Watcher per le librerie", "LabelSettingsDisableWatcherHelp": "Disattiva il controllo automatico libri nelle cartelle delle librerie. *Richiede il Riavvio del Server", "LabelSettingsEnableWatcher": "Abilita Watcher", "LabelSettingsEnableWatcherForLibrary": "Abilita il controllo cartelle per la libreria", "LabelSettingsEnableWatcherHelp": "Abilita l'aggiunta/aggiornamento automatico degli elementi quando vengono rilevate modifiche ai file. *Richiede il riavvio del Server", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Opzioni Sperimentali", "LabelSettingsExperimentalFeaturesHelp": "Funzionalità in fase di sviluppo che potrebbero utilizzare i tuoi feedback e aiutare i test. Fare clic per aprire la discussione github.", "LabelSettingsFindCovers": "Trova covers", "LabelSettingsFindCoversHelp": "Se il tuo audiolibro non ha una copertina incorporata o un'immagine di copertina all'interno della cartella, questa funzione tenterà di trovare una copertina.<br>Nota: aumenta il tempo di scansione", "LabelSettingsHideSingleBookSeries": "Nascondi una singola serie di libri", diff --git a/client/strings/lt.json b/client/strings/lt.json index 8c904e1f1..5bd42bdf2 100644 --- a/client/strings/lt.json +++ b/client/strings/lt.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Išjungti aplankų stebėtoją bibliotekai", "LabelSettingsDisableWatcherHelp": "Išjungia automatinį elementų pridėjimą/atnaujinimą, jei pastebėti failų pokyčiai. *Reikalingas serverio paleidimas iš naujo", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Eksperimentiniai funkcionalumai", "LabelSettingsExperimentalFeaturesHelp": "Funkcijos, kurios yra kuriamos ir laukiami jūsų komentarai. Spustelėkite, kad atidarytumėte „GitHub“ diskusiją.", "LabelSettingsFindCovers": "Rasti viršelius", "LabelSettingsFindCoversHelp": "Jei jūsų audioknyga neturi įterpto viršelio arba viršelio paveikslėlio aplanko, skeneris bandys rasti viršelį.<br>Pastaba: Tai padidins skenavimo trukmę.", "LabelSettingsHideSingleBookSeries": "Slėpti serijas, turinčias tik vieną knygą", diff --git a/client/strings/nl.json b/client/strings/nl.json index 84f4d0543..28c3ada1c 100644 --- a/client/strings/nl.json +++ b/client/strings/nl.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Map-watcher voor bibliotheek uitschakelen", "LabelSettingsDisableWatcherHelp": "Schakelt het automatisch toevoegen/bijwerken van onderdelen wanneer bestandswijzigingen gedetecteerd zijn uit. *Vereist herstart server", "LabelSettingsEnableWatcher": "Watcher inschakelen", "LabelSettingsEnableWatcherForLibrary": "Map-watcher voor bibliotheek inschakelen", "LabelSettingsEnableWatcherHelp": "Zorgt voor het automatisch toevoegen/bijwerken van onderdelen als bestandswijzigingen worden gedetecteerd. *Vereist herstarten van server", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimentele functies", "LabelSettingsExperimentalFeaturesHelp": "Functies in ontwikkeling die je feedback en testing kunnen gebruiken. Klik om de Github-discussie te openen.", "LabelSettingsFindCovers": "Zoek covers", "LabelSettingsFindCoversHelp": "Als je audioboek geen ingesloten cover of cover in de map heeft, zal de scanner proberen een cover te vinden.<br>Opmerking: Dit zal de scan-duur verlengen", "LabelSettingsHideSingleBookSeries": "Verberg series met een enkel boek", diff --git a/client/strings/no.json b/client/strings/no.json index 95d9d8563..4c4be82fa 100644 --- a/client/strings/no.json +++ b/client/strings/no.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Deaktiver mappe overvåker for bibliotek", "LabelSettingsDisableWatcherHelp": "Deaktiverer automatisk opprettelse/oppdatering av enheter når filendringer er oppdaget. *Krever restart av server*", "LabelSettingsEnableWatcher": "Aktiver overvåker", "LabelSettingsEnableWatcherForLibrary": "Aktiver mappe overvåker for bibliotek", "LabelSettingsEnableWatcherHelp": "Aktiverer automatisk opprettelse/oppdatering av enheter når filendringer er oppdaget. *Krever restart av server*", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Eksperimentelle funksjoner", "LabelSettingsExperimentalFeaturesHelp": "Funksjoner under utvikling som kan trenge din tilbakemelding og hjelp med testing. Klikk for å åpne GitHub diskusjon.", "LabelSettingsFindCovers": "Finn omslag", "LabelSettingsFindCoversHelp": "Hvis lydboken ikke har innbakt omslag eller ett omslagsbilde i mappen, vil skanneren prøve å finne ett.<br>Notis: Dette vil øke søketiden", "LabelSettingsHideSingleBookSeries": "Gjem bokserie med en bok", diff --git a/client/strings/pl.json b/client/strings/pl.json index 0fa5ee328..ce0109d9e 100644 --- a/client/strings/pl.json +++ b/client/strings/pl.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Wyłącz monitorowanie folderów dla biblioteki", "LabelSettingsDisableWatcherHelp": "Wyłącz automatyczne dodawanie/aktualizowanie elementów po wykryciu zmian w plikach. *Wymaga restartu serwera", "LabelSettingsEnableWatcher": "Enable Watcher", "LabelSettingsEnableWatcherForLibrary": "Enable folder watcher for library", "LabelSettingsEnableWatcherHelp": "Enables the automatic adding/updating of items when file changes are detected. *Requires server restart", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Funkcje eksperymentalne", "LabelSettingsExperimentalFeaturesHelp": "Funkcje w trakcie rozwoju, które mogą zyskanć na Twojej opinii i pomocy w testowaniu. Kliknij, aby otworzyć dyskusję na githubie.", "LabelSettingsFindCovers": "Szukanie okładek", "LabelSettingsFindCoversHelp": "Jeśli audiobook nie posiada zintegrowanej okładki albo w folderze nie zostanie znaleziony plik okładki, skaner podejmie próbę pobrania okładki z sieci. <br>Uwaga: może to wydłuzyć proces skanowania", "LabelSettingsHideSingleBookSeries": "Hide single book series", diff --git a/client/strings/pt-br.json b/client/strings/pt-br.json index 4e2368510..f88f6a5e7 100644 --- a/client/strings/pt-br.json +++ b/client/strings/pt-br.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Desativa o monitoramento de pastas para a biblioteca", "LabelSettingsDisableWatcherHelp": "Desativa o acréscimo/atualização de itens quando forem detectadas mudanças no arquivo. *Requer reiniciar o servidor", "LabelSettingsEnableWatcher": "Ativar Monitoramento", "LabelSettingsEnableWatcherForLibrary": "Ativa o monitoramento de pastas para a biblioteca", "LabelSettingsEnableWatcherHelp": "Ativa o acréscimo/atualização de itens quando forem detectadas mudanças no arquivo. *Requer reiniciar o servidor", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Funcionalidade experimentais", "LabelSettingsExperimentalFeaturesHelp": "Funcionalidade em desenvolvimento que se beneficiairam dos seus comentários e da sua ajuda para testar. Clique para abrir a discussão no github.", "LabelSettingsFindCovers": "Localizar capas", "LabelSettingsFindCoversHelp": "Se o seu audiobook não tiver uma capa incluída ou uma imagem de capa na pasta, o verificador tentará localizar uma capa.<br>Atenção: Isso irá estender o tempo de análise", "LabelSettingsHideSingleBookSeries": "Ocultar séries com um só livro", diff --git a/client/strings/ru.json b/client/strings/ru.json index 243d96a09..7b6e9c7c1 100644 --- a/client/strings/ru.json +++ b/client/strings/ru.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Отключить отслеживание для библиотеки", "LabelSettingsDisableWatcherHelp": "Отключает автоматическое добавление/обновление элементов, когда обнаружено изменение файлов. *Требуется перезапуск сервера", "LabelSettingsEnableWatcher": "Включить отслеживание", "LabelSettingsEnableWatcherForLibrary": "Включить отслеживание за папками библиотеки", "LabelSettingsEnableWatcherHelp": "Включает автоматическое добавление/обновление элементов при обнаружении изменений файлов. *Требуется перезапуск сервера", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Экспериментальные функции", "LabelSettingsExperimentalFeaturesHelp": "Функционал в разработке на который Вы могли бы дать отзыв или помочь в тестировании. Нажмите для открытия обсуждения на github.", "LabelSettingsFindCovers": "Найти обложки", "LabelSettingsFindCoversHelp": "Если у Ваших аудиокниг нет встроенной обложки или файла обложки в папке книги, то сканер попробует найти обложку.<br>Примечание: Это увеличит время сканирования", "LabelSettingsHideSingleBookSeries": "Скрыть серии с одной книгой", diff --git a/client/strings/sv.json b/client/strings/sv.json index dbff38750..fd8c6e692 100644 --- a/client/strings/sv.json +++ b/client/strings/sv.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Inaktivera mappbevakning för bibliotek", "LabelSettingsDisableWatcherHelp": "Inaktiverar automatiskt lägga till/uppdatera objekt när filändringar upptäcks. *Kräver omstart av servern", "LabelSettingsEnableWatcher": "Aktivera Watcher", "LabelSettingsEnableWatcherForLibrary": "Aktivera mappbevakning för bibliotek", "LabelSettingsEnableWatcherHelp": "Aktiverar automatiskt lägga till/uppdatera objekt när filändringar upptäcks. *Kräver omstart av servern", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Experimentella funktioner", "LabelSettingsExperimentalFeaturesHelp": "Funktioner under utveckling som behöver din feedback och hjälp med testning. Klicka för att öppna diskussionen på GitHub.", "LabelSettingsFindCovers": "Hitta omslag", "LabelSettingsFindCoversHelp": "Om din ljudbok inte har ett inbäddat omslag eller en omslagsbild i mappen kommer skannern att försöka hitta ett omslag.<br>Observera: Detta kommer att förlänga skannningstiden", "LabelSettingsHideSingleBookSeries": "Dölj enboksserier", diff --git a/client/strings/uk.json b/client/strings/uk.json index e32ac69e0..6d8c311ca 100644 --- a/client/strings/uk.json +++ b/client/strings/uk.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Вимкнути спостерігання тек бібліотеки", "LabelSettingsDisableWatcherHelp": "Вимикає автоматичне додавання/оновлення елементів, коли спостерігаються зміни файлів. *Потребує перезавантаження сервера", "LabelSettingsEnableWatcher": "Увімкнути спостерігача", "LabelSettingsEnableWatcherForLibrary": "Увімкнути спостерігання тек бібліотеки", "LabelSettingsEnableWatcherHelp": "Вмикає автоматичне додавання/оновлення елементів, коли спостерігаються зміни файлів. *Потребує перезавантаження сервера", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Експериментальні функції", "LabelSettingsExperimentalFeaturesHelp": "Функції в розробці, які потребують вашого відгуку та допомоги в тестуванні. Натисніть, щоб відкрити обговорення на Github.", "LabelSettingsFindCovers": "Пошук обкладинок", "LabelSettingsFindCoversHelp": "Якщо ваша аудіокнига не містить вбудованої обкладинки або зображення у теці, сканувальник спробує знайти обкладинку.<br>Примітка: Це збільшить час сканування", "LabelSettingsHideSingleBookSeries": "Сховати серії з однією книгою", diff --git a/client/strings/vi-vn.json b/client/strings/vi-vn.json index e3e5fa313..7c6d09b05 100644 --- a/client/strings/vi-vn.json +++ b/client/strings/vi-vn.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "Tắt watcher thư mục cho thư viện", "LabelSettingsDisableWatcherHelp": "Tắt chức năng tự động thêm/cập nhật các mục khi phát hiện thay đổi tập tin. *Yêu cầu khởi động lại máy chủ", "LabelSettingsEnableWatcher": "Bật Watcher", "LabelSettingsEnableWatcherForLibrary": "Bật watcher thư mục cho thư viện", "LabelSettingsEnableWatcherHelp": "Bật chức năng tự động thêm/cập nhật các mục khi phát hiện thay đổi tập tin. *Yêu cầu khởi động lại máy chủ", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "Tính năng thử nghiệm", "LabelSettingsExperimentalFeaturesHelp": "Các tính năng đang phát triển có thể cần phản hồi của bạn và sự giúp đỡ trong thử nghiệm. Nhấp để mở thảo luận trên github.", "LabelSettingsFindCovers": "Tìm ảnh bìa", "LabelSettingsFindCoversHelp": "Nếu sách nói của bạn không có ảnh bìa nhúng hoặc ảnh bìa trong thư mục, trình quét sẽ cố gắng tìm ảnh bìa.<br>Lưu ý: Điều này sẽ kéo dài thời gian quét", "LabelSettingsHideSingleBookSeries": "Ẩn loạt sách đơn lẻ", diff --git a/client/strings/zh-cn.json b/client/strings/zh-cn.json index 654411fe4..fb375aec1 100644 --- a/client/strings/zh-cn.json +++ b/client/strings/zh-cn.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "禁用媒体库的文件夹监视程序", "LabelSettingsDisableWatcherHelp": "检测到文件更改时禁用自动添加和更新项目. *需要重启服务器", "LabelSettingsEnableWatcher": "启用监视程序", "LabelSettingsEnableWatcherForLibrary": "为库启用文件夹监视程序", "LabelSettingsEnableWatcherHelp": "当检测到文件更改时, 启用项目的自动添加/更新. *需要重新启动服务器", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "实验功能", "LabelSettingsExperimentalFeaturesHelp": "开发中的功能需要你的反馈并帮助测试. 点击打开 github 讨论.", "LabelSettingsFindCovers": "查找封面", "LabelSettingsFindCoversHelp": "如果你的有声读物在文件夹中没有嵌入封面或封面图像, 扫描将尝试查找封面.<br>注意: 这将延长扫描时间", "LabelSettingsHideSingleBookSeries": "隐藏单书系列", diff --git a/client/strings/zh-tw.json b/client/strings/zh-tw.json index bf3a625b7..54e7849b4 100644 --- a/client/strings/zh-tw.json +++ b/client/strings/zh-tw.json @@ -469,10 +469,12 @@ "LabelSettingsDisableWatcherForLibrary": "禁用媒體庫的資料夾監視程序", "LabelSettingsDisableWatcherHelp": "檢測到檔案更改時禁用自動新增和更新項目. *需要重啟伺服器", "LabelSettingsEnableWatcher": "啟用監視程序", "LabelSettingsEnableWatcherForLibrary": "為庫啟用資料夾監視程序", "LabelSettingsEnableWatcherHelp": "當檢測到檔案更改時, 啟用項目的自動新增/更新. *需要重新啟動伺服器", + "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", + "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsExperimentalFeatures": "實驗功能", "LabelSettingsExperimentalFeaturesHelp": "開發中的功能需要你的反饋並幫助測試. 點擊打開 github 討論.", "LabelSettingsFindCovers": "查找封面", "LabelSettingsFindCoversHelp": "如果你的有聲書在資料夾中沒有嵌入封面或封面圖像, 掃描將嘗試查找封面.<br>注意: 這將延長掃描時間", "LabelSettingsHideSingleBookSeries": "隱藏單書系列", diff --git a/server/objects/settings/LibrarySettings.js b/server/objects/settings/LibrarySettings.js index a9885c791..4369c0ff5 100644 --- a/server/objects/settings/LibrarySettings.js +++ b/server/objects/settings/LibrarySettings.js @@ -6,10 +6,11 @@ class LibrarySettings { this.disableWatcher = false this.skipMatchingMediaWithAsin = false this.skipMatchingMediaWithIsbn = false this.autoScanCronExpression = null this.audiobooksOnly = false + this.epubsAllowScriptedContent = false this.hideSingleBookSeries = false // Do not show series that only have 1 book this.onlyShowLaterBooksInContinueSeries = false // Skip showing books that are earlier than the max sequence read this.metadataPrecedence = ['folderStructure', 'audioMetatags', 'nfoFile', 'txtFiles', 'opfFile', 'absMetadata'] this.podcastSearchRegion = 'us' @@ -23,10 +24,11 @@ class LibrarySettings { this.disableWatcher = !!settings.disableWatcher this.skipMatchingMediaWithAsin = !!settings.skipMatchingMediaWithAsin this.skipMatchingMediaWithIsbn = !!settings.skipMatchingMediaWithIsbn this.autoScanCronExpression = settings.autoScanCronExpression || null this.audiobooksOnly = !!settings.audiobooksOnly + this.epubsAllowScriptedContent = !!settings.epubsAllowScriptedContent this.hideSingleBookSeries = !!settings.hideSingleBookSeries this.onlyShowLaterBooksInContinueSeries = !!settings.onlyShowLaterBooksInContinueSeries if (settings.metadataPrecedence) { this.metadataPrecedence = [...settings.metadataPrecedence] } else { @@ -42,10 +44,11 @@ class LibrarySettings { disableWatcher: this.disableWatcher, skipMatchingMediaWithAsin: this.skipMatchingMediaWithAsin, skipMatchingMediaWithIsbn: this.skipMatchingMediaWithIsbn, autoScanCronExpression: this.autoScanCronExpression, audiobooksOnly: this.audiobooksOnly, + epubsAllowScriptedContent: this.epubsAllowScriptedContent, hideSingleBookSeries: this.hideSingleBookSeries, onlyShowLaterBooksInContinueSeries: this.onlyShowLaterBooksInContinueSeries, metadataPrecedence: [...this.metadataPrecedence], podcastSearchRegion: this.podcastSearchRegion } @@ -65,6 +68,6 @@ class LibrarySettings { } } return hasUpdates } } -module.exports = LibrarySettings \ No newline at end of file +module.exports = LibrarySettings
</script> allowScriptedContent: true, getCurrentLibrary: state => { return state.libraries.find(lib => lib.id === state.currentLibraryId) getSortedLibraries: state => () => { return state.libraries.map(lib => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder) getLibraryProvider: state => libraryId => { var library = state.libraries.find(l => l.id === libraryId) getCollection: state => id => { return state.collections.find(c => c.id === id) getPlaylist: state => id => { return state.userPlaylists.find(p => p.id === id) if (lastCheck < 1000 * 5) { // 5 seconds var index = state.libraries.findIndex(a => a.id === library.id) state.libraries = state.libraries.filter(a => a.id !== library.id) var index = state.listeners.findIndex(l => l.id === listener.id) state.listeners = state.listeners.filter(l => l.id !== listenerId) state.filterData.series = state.filterData.series.filter(se => se.id !== seriesId) const indexOf = state.filterData.authors.findIndex(au => au.id === author.id) state.filterData.authors.sort((a, b) => (a.name || '').localeCompare((b.name || ''))) const indexOf = state.filterData.series.findIndex(se => se.id === series.id) state.filterData.series.sort((a, b) => (a.name || '').localeCompare((b.name || ''))) var index = state.collections.findIndex(c => c.id === collection.id) state.collections = state.collections.filter(c => c.id !== collection.id) const index = state.userPlaylists.findIndex(p => p.id === playlist.id) state.userPlaylists = state.userPlaylists.filter(p => p.id !== playlist.id) } module.exports = LibrarySettings
<div v-if="isBookLibrary" class="py-3"> <div class="flex items-center"> <ui-toggle-switch v-model="epubsAllowScriptedContent" @input="formUpdated" /> <ui-tooltip :text="$strings.LabelSettingsEpubsAllowScriptedContentHelp"> <p class="pl-4 text-base"> {{ $strings.LabelSettingsEpubsAllowScriptedContent }} <span class="material-icons icon-text text-sm">info_outlined</span> </p> </ui-tooltip> </div> </div> epubsAllowScriptedContent: false, epubsAllowScriptedContent: !!this.epubsAllowScriptedContent, this.epubsAllowScriptedContent = !!this.librarySettings.epubsAllowScriptedContent </script> allowScriptedContent() { return this.$store.getters['libraries/getLibraryEpubsAllowScriptedContent'] }, allowScriptedContent: this.allowScriptedContent, getCurrentLibrary: (state) => { return state.libraries.find((lib) => lib.id === state.currentLibraryId) getSortedLibraries: (state) => () => { return state.libraries.map((lib) => ({ ...lib })).sort((a, b) => a.displayOrder - b.displayOrder) getLibraryProvider: (state) => (libraryId) => { var library = state.libraries.find((l) => l.id === libraryId) getLibraryEpubsAllowScriptedContent: (state, getters) => { return !!getters.getCurrentLibrarySettings?.epubsAllowScriptedContent getCollection: (state) => (id) => { return state.collections.find((c) => c.id === id) }, getPlaylist: (state) => (id) => { return state.userPlaylists.find((p) => p.id === id) if (lastCheck < 1000 * 5) { // 5 seconds var index = state.libraries.findIndex((a) => a.id === library.id) state.libraries = state.libraries.filter((a) => a.id !== library.id) var index = state.listeners.findIndex((l) => l.id === listener.id) state.listeners = state.listeners.filter((l) => l.id !== listenerId) state.filterData.series = state.filterData.series.filter((se) => se.id !== seriesId) const indexOf = state.filterData.authors.findIndex((au) => au.id === author.id) state.filterData.authors.sort((a, b) => (a.name || '').localeCompare(b.name || '')) const indexOf = state.filterData.series.findIndex((se) => se.id === series.id) state.filterData.series.sort((a, b) => (a.name || '').localeCompare(b.name || '')) var index = state.collections.findIndex((c) => c.id === collection.id) state.collections = state.collections.filter((c) => c.id !== collection.id) const index = state.userPlaylists.findIndex((p) => p.id === playlist.id) state.userPlaylists = state.userPlaylists.filter((p) => p.id !== playlist.id) } "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", "LabelSettingsEpubsAllowScriptedContent": "Allow scripted content in epubs", "LabelSettingsEpubsAllowScriptedContentHelp": "Allow epub files to execute scripts. It is recommended to keep this setting disabled unless you trust the source of the epub files.", this.epubsAllowScriptedContent = false this.epubsAllowScriptedContent = !!settings.epubsAllowScriptedContent epubsAllowScriptedContent: this.epubsAllowScriptedContent, module.exports = LibrarySettings
[]
CVE-2021-4265
924d16008cfcc09356c87db01848e45290cb58ca
https://github.com/siwapp/siwapp-ror
[{'lang': 'en', 'value': 'A vulnerability was found in siwapp-ror. It has been rated as problematic. This issue affects some unknown processing. The manipulation leads to cross site scripting. The attack may be initiated remotely. The name of the patch is 924d16008cfcc09356c87db01848e45290cb58ca. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-216467.'}]
null
6.1
2022-12-21T19:15Z
nan
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Fix possible XSS issues (#365) * some fixes for old migrations, that allows new migrations * force ssl default true unless env var * check address no html tags
2021-10-19 11:07:49 +0200
924d160
334
2
[ "app/models/common.rb", "app/models/customer.rb", "config/environments/production.rb", "db/migrate/20160907152236_default_for_enabled.rb", "db/migrate/20160908093323_add_indexes_on_deleted_column.rb", "db/migrate/20160913081503_remove_status_from_commons.rb", "db/migrate/20160915000824_add_active_to_customer.rb", "db/migrate/20160915094942_add_failed_to_commons.rb", "db/migrate/20160923100618_series_first_number.rb", "db/migrate/20160929124104_email_and_print_template_to_common.rb", "db/migrate/20160929133954_email_and_print_default_templates_to_template.rb", "db/migrate/20161025134552_change_customer_index.rb", "db/migrate/20161026092553_add_template_subject.rb", "db/migrate/20161028103504_add_invoice_number_unique_number.rb", "db/migrate/20161207184222_remove_tax_amount.rb", "db/migrate/20161208171651_remove_commons_amounts.rb", "db/migrate/20170112115658_remove_invoice_unique_number.rb", "db/migrate/20170209101048_remove_customers_unique_name.rb", "db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb", "db/migrate/20170217120023_add_deleted_number_to_commons.rb", "db/migrate/20170223101022_add_commons_customer_id_not_null.rb", "db/migrate/20170608155530_add_currency_to_commons.rb" ]
Ruby
{"app/models/common.rb": {"lines_added": 4, "lines_deleted": 0}, "app/models/customer.rb": {"lines_added": 4, "lines_deleted": 0}, "config/environments/production.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160907152236_default_for_enabled.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160908093323_add_indexes_on_deleted_column.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160913081503_remove_status_from_commons.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160915000824_add_active_to_customer.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160915094942_add_failed_to_commons.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160923100618_series_first_number.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160929124104_email_and_print_template_to_common.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20160929133954_email_and_print_default_templates_to_template.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20161025134552_change_customer_index.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20161026092553_add_template_subject.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20161028103504_add_invoice_number_unique_number.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20161207184222_remove_tax_amount.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20161208171651_remove_commons_amounts.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170112115658_remove_invoice_unique_number.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170209101048_remove_customers_unique_name.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170217120023_add_deleted_number_to_commons.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170223101022_add_commons_customer_id_not_null.rb": {"lines_added": 1, "lines_deleted": 1}, "db/migrate/20170608155530_add_currency_to_commons.rb": {"lines_added": 1, "lines_deleted": 1}}
diff --git a/app/models/common.rb b/app/models/common.rb index 0c70c1d..388d781 100644 --- a/app/models/common.rb +++ b/app/models/common.rb @@ -29,10 +29,14 @@ class Common < ActiveRecord::Base validates :series, presence: true # from https://emailregex.com/ validates :email, format: {with: /\A([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,})\z/i, message: "Only valid emails"}, allow_blank: true + validates :invoicing_address, format: { without: /<(.*)>.*?|<(.*) \/>/, + message: "wrong format" } + validates :shipping_address, format: { without: /<(.*)>.*?|<(.*) \/>/, + message: "wrong format" } # Events after_save :purge_items after_save :update_amounts after_initialize :init diff --git a/app/models/customer.rb b/app/models/customer.rb index 2d6f8e5..78640a3 100644 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -9,10 +9,14 @@ class Customer < ActiveRecord::Base has_many :recurring_invoices # Validation validate :valid_customer_identification validates_uniqueness_of :name, scope: :identification + validates :invoicing_address, format: { without: /<(.*)>.*?|<(.*) \/>/, + message: "Wrong address format" } + validates :shipping_address, format: { without: /<(.*)>.*?|<(.*) \/>/, + message: "Wrong address format" } # Behaviors acts_as_taggable before_destroy :check_invoices diff --git a/config/environments/production.rb b/config/environments/production.rb index 6bd81a6..ca506e7 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -45,11 +45,11 @@ Rails.application.configure do # config.action_cable.mount_path = nil # config.action_cable.url = 'wss://example.com/cable' # config.action_cable.allowed_request_origins = [ 'http://example.com', /http:\/\/example.*/ ] # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies. - # config.force_ssl = true + config.force_ssl = ENV['NO_FORCE_SSL'].present? ? false : true # Use the lowest log level to ensure availability of diagnostic information # when problems arise. config.log_level = :debug diff --git a/db/migrate/20160907152236_default_for_enabled.rb b/db/migrate/20160907152236_default_for_enabled.rb index 648734d..d60244d 100644 --- a/db/migrate/20160907152236_default_for_enabled.rb +++ b/db/migrate/20160907152236_default_for_enabled.rb @@ -1,6 +1,6 @@ -class DefaultForEnabled < ActiveRecord::Migration +class DefaultForEnabled < ActiveRecord::Migration[4.2] def change change_column_default(:commons, :enabled, true) change_column_default(:commons, :draft, false) end end diff --git a/db/migrate/20160908093323_add_indexes_on_deleted_column.rb b/db/migrate/20160908093323_add_indexes_on_deleted_column.rb index 2a9c5c2..60667c1 100644 --- a/db/migrate/20160908093323_add_indexes_on_deleted_column.rb +++ b/db/migrate/20160908093323_add_indexes_on_deleted_column.rb @@ -1,6 +1,6 @@ -class AddIndexesOnDeletedColumn < ActiveRecord::Migration +class AddIndexesOnDeletedColumn < ActiveRecord::Migration[4.2] def change add_index :commons, :deleted_at add_index :customers, :deleted_at add_index :items, :deleted_at add_index :payments, :deleted_at diff --git a/db/migrate/20160913081503_remove_status_from_commons.rb b/db/migrate/20160913081503_remove_status_from_commons.rb index 5a755b6..ecf1b42 100644 --- a/db/migrate/20160913081503_remove_status_from_commons.rb +++ b/db/migrate/20160913081503_remove_status_from_commons.rb @@ -1,5 +1,5 @@ -class RemoveStatusFromCommons < ActiveRecord::Migration +class RemoveStatusFromCommons < ActiveRecord::Migration[4.2] def change remove_column :commons, :status end end diff --git a/db/migrate/20160915000824_add_active_to_customer.rb b/db/migrate/20160915000824_add_active_to_customer.rb index c5602cb..4999ec6 100644 --- a/db/migrate/20160915000824_add_active_to_customer.rb +++ b/db/migrate/20160915000824_add_active_to_customer.rb @@ -1,6 +1,6 @@ -class AddActiveToCustomer < ActiveRecord::Migration +class AddActiveToCustomer < ActiveRecord::Migration[4.2] def up add_column :customers, :active, :boolean, default: true Customer.update_all ["active = ?", true] end diff --git a/db/migrate/20160915094942_add_failed_to_commons.rb b/db/migrate/20160915094942_add_failed_to_commons.rb index 458edc1..c6d1b36 100644 --- a/db/migrate/20160915094942_add_failed_to_commons.rb +++ b/db/migrate/20160915094942_add_failed_to_commons.rb @@ -1,5 +1,5 @@ -class AddFailedToCommons < ActiveRecord::Migration +class AddFailedToCommons < ActiveRecord::Migration[4.2] def change add_column :commons, :failed, :boolean, default: false end end diff --git a/db/migrate/20160923100618_series_first_number.rb b/db/migrate/20160923100618_series_first_number.rb index 27c6493..5432762 100644 --- a/db/migrate/20160923100618_series_first_number.rb +++ b/db/migrate/20160923100618_series_first_number.rb @@ -1,6 +1,6 @@ -class SeriesFirstNumber < ActiveRecord::Migration +class SeriesFirstNumber < ActiveRecord::Migration[4.2] def change add_column :series, :first_number, :integer, default: 1 remove_column :series, :next_number end end diff --git a/db/migrate/20160929124104_email_and_print_template_to_common.rb b/db/migrate/20160929124104_email_and_print_template_to_common.rb index 91b7d30..f399d69 100644 --- a/db/migrate/20160929124104_email_and_print_template_to_common.rb +++ b/db/migrate/20160929124104_email_and_print_template_to_common.rb @@ -1,6 +1,6 @@ -class EmailAndPrintTemplateToCommon < ActiveRecord::Migration +class EmailAndPrintTemplateToCommon < ActiveRecord::Migration[4.2] def change rename_column :commons, :template_id, :print_template_id add_column :commons, :email_template_id, :integer end end diff --git a/db/migrate/20160929133954_email_and_print_default_templates_to_template.rb b/db/migrate/20160929133954_email_and_print_default_templates_to_template.rb index c84dcc1..b2b7512 100644 --- a/db/migrate/20160929133954_email_and_print_default_templates_to_template.rb +++ b/db/migrate/20160929133954_email_and_print_default_templates_to_template.rb @@ -1,6 +1,6 @@ -class EmailAndPrintDefaultTemplatesToTemplate < ActiveRecord::Migration +class EmailAndPrintDefaultTemplatesToTemplate < ActiveRecord::Migration[4.2] def change rename_column :templates, :default, :print_default add_column :templates, :email_default, :boolean, default: false end end diff --git a/db/migrate/20161025134552_change_customer_index.rb b/db/migrate/20161025134552_change_customer_index.rb index 8427ef8..8059c0e 100644 --- a/db/migrate/20161025134552_change_customer_index.rb +++ b/db/migrate/20161025134552_change_customer_index.rb @@ -1,6 +1,6 @@ -class ChangeCustomerIndex < ActiveRecord::Migration +class ChangeCustomerIndex < ActiveRecord::Migration[4.2] def change remove_index "customers", name: "cstm_idx" add_index "customers", ["name", "identification"], name: "cstm_idx", unique: true, using: :btree end end diff --git a/db/migrate/20161026092553_add_template_subject.rb b/db/migrate/20161026092553_add_template_subject.rb index 08b35aa..3f97020 100644 --- a/db/migrate/20161026092553_add_template_subject.rb +++ b/db/migrate/20161026092553_add_template_subject.rb @@ -1,5 +1,5 @@ -class AddTemplateSubject < ActiveRecord::Migration +class AddTemplateSubject < ActiveRecord::Migration[4.2] def change add_column :templates, :subject, :string, limit: 200 end end diff --git a/db/migrate/20161028103504_add_invoice_number_unique_number.rb b/db/migrate/20161028103504_add_invoice_number_unique_number.rb index 27f3b05..12f09d5 100644 --- a/db/migrate/20161028103504_add_invoice_number_unique_number.rb +++ b/db/migrate/20161028103504_add_invoice_number_unique_number.rb @@ -1,5 +1,5 @@ -class AddInvoiceNumberUniqueNumber < ActiveRecord::Migration +class AddInvoiceNumberUniqueNumber < ActiveRecord::Migration[4.2] def change add_index "commons", ["number", "series_id"], name: "common_unique_number_idx", unique: true, using: :btree end end diff --git a/db/migrate/20161207184222_remove_tax_amount.rb b/db/migrate/20161207184222_remove_tax_amount.rb index 27bc371..130d313 100644 --- a/db/migrate/20161207184222_remove_tax_amount.rb +++ b/db/migrate/20161207184222_remove_tax_amount.rb @@ -1,5 +1,5 @@ -class RemoveTaxAmount < ActiveRecord::Migration +class RemoveTaxAmount < ActiveRecord::Migration[4.2] def change remove_column :commons, :tax_amount end end diff --git a/db/migrate/20161208171651_remove_commons_amounts.rb b/db/migrate/20161208171651_remove_commons_amounts.rb index 22f9500..dba0a63 100644 --- a/db/migrate/20161208171651_remove_commons_amounts.rb +++ b/db/migrate/20161208171651_remove_commons_amounts.rb @@ -1,6 +1,6 @@ -class RemoveCommonsAmounts < ActiveRecord::Migration +class RemoveCommonsAmounts < ActiveRecord::Migration[4.2] def change remove_column :commons, :discount_amount remove_column :commons, :base_amount end end diff --git a/db/migrate/20170112115658_remove_invoice_unique_number.rb b/db/migrate/20170112115658_remove_invoice_unique_number.rb index 3ffa062..24c698d 100644 --- a/db/migrate/20170112115658_remove_invoice_unique_number.rb +++ b/db/migrate/20170112115658_remove_invoice_unique_number.rb @@ -1,5 +1,5 @@ -class RemoveInvoiceUniqueNumber < ActiveRecord::Migration +class RemoveInvoiceUniqueNumber < ActiveRecord::Migration[4.2] def change remove_index "commons", name: "common_unique_number_idx" end end diff --git a/db/migrate/20170209101048_remove_customers_unique_name.rb b/db/migrate/20170209101048_remove_customers_unique_name.rb index 6f9adaf..b7c1512 100644 --- a/db/migrate/20170209101048_remove_customers_unique_name.rb +++ b/db/migrate/20170209101048_remove_customers_unique_name.rb @@ -1,5 +1,5 @@ -class RemoveCustomersUniqueName < ActiveRecord::Migration +class RemoveCustomersUniqueName < ActiveRecord::Migration[4.2] def change remove_index "customers", name: "cstm_idx" end end diff --git a/db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb b/db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb index 9e64d24..2d48686 100644 --- a/db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb +++ b/db/migrate/20170216122053_add_unique_index_to_invoice_series_and_number.rb @@ -1,5 +1,5 @@ -class AddUniqueIndexToInvoiceSeriesAndNumber < ActiveRecord::Migration +class AddUniqueIndexToInvoiceSeriesAndNumber < ActiveRecord::Migration[4.2] def change add_index "commons", ["series_id", "number"], name: "common_unique_number_idx", unique: true, using: :btree end end diff --git a/db/migrate/20170217120023_add_deleted_number_to_commons.rb b/db/migrate/20170217120023_add_deleted_number_to_commons.rb index 8c860aa..d4ce1ba 100644 --- a/db/migrate/20170217120023_add_deleted_number_to_commons.rb +++ b/db/migrate/20170217120023_add_deleted_number_to_commons.rb @@ -1,6 +1,6 @@ -class AddDeletedNumberToCommons < ActiveRecord::Migration +class AddDeletedNumberToCommons < ActiveRecord::Migration[4.2] def change add_column :commons, :deleted_number, :integer, default: nil add_index "commons", ["series_id", "deleted_number"], name: "common_deleted_number_idx", using: :btree end end diff --git a/db/migrate/20170223101022_add_commons_customer_id_not_null.rb b/db/migrate/20170223101022_add_commons_customer_id_not_null.rb index 62e7b53..b7baeb9 100644 --- a/db/migrate/20170223101022_add_commons_customer_id_not_null.rb +++ b/db/migrate/20170223101022_add_commons_customer_id_not_null.rb @@ -1,5 +1,5 @@ -class AddCommonsCustomerIdNotNull < ActiveRecord::Migration +class AddCommonsCustomerIdNotNull < ActiveRecord::Migration[4.2] def change change_column :commons, :customer_id, :integer, :null => false end end diff --git a/db/migrate/20170608155530_add_currency_to_commons.rb b/db/migrate/20170608155530_add_currency_to_commons.rb index cfdef37..62c1b5c 100644 --- a/db/migrate/20170608155530_add_currency_to_commons.rb +++ b/db/migrate/20170608155530_add_currency_to_commons.rb @@ -1,6 +1,6 @@ -class AddCurrencyToCommons < ActiveRecord::Migration +class AddCurrencyToCommons < ActiveRecord::Migration[4.2] def up add_column :commons, :currency, :string, limit: 3 currency = Settings.currency Common.find_each do |common| common.currency = currency
# config.force_ssl = true class DefaultForEnabled < ActiveRecord::Migration class AddIndexesOnDeletedColumn < ActiveRecord::Migration class RemoveStatusFromCommons < ActiveRecord::Migration class AddActiveToCustomer < ActiveRecord::Migration class AddFailedToCommons < ActiveRecord::Migration class SeriesFirstNumber < ActiveRecord::Migration class EmailAndPrintTemplateToCommon < ActiveRecord::Migration class EmailAndPrintDefaultTemplatesToTemplate < ActiveRecord::Migration class ChangeCustomerIndex < ActiveRecord::Migration class AddTemplateSubject < ActiveRecord::Migration class AddInvoiceNumberUniqueNumber < ActiveRecord::Migration class RemoveTaxAmount < ActiveRecord::Migration class RemoveCommonsAmounts < ActiveRecord::Migration class RemoveInvoiceUniqueNumber < ActiveRecord::Migration class RemoveCustomersUniqueName < ActiveRecord::Migration class AddUniqueIndexToInvoiceSeriesAndNumber < ActiveRecord::Migration class AddDeletedNumberToCommons < ActiveRecord::Migration class AddCommonsCustomerIdNotNull < ActiveRecord::Migration class AddCurrencyToCommons < ActiveRecord::Migration
validates :invoicing_address, format: { without: /<(.*)>.*?|<(.*) \/>/, message: "wrong format" } validates :shipping_address, format: { without: /<(.*)>.*?|<(.*) \/>/, message: "wrong format" } validates :invoicing_address, format: { without: /<(.*)>.*?|<(.*) \/>/, message: "Wrong address format" } validates :shipping_address, format: { without: /<(.*)>.*?|<(.*) \/>/, message: "Wrong address format" } config.force_ssl = ENV['NO_FORCE_SSL'].present? ? false : true class DefaultForEnabled < ActiveRecord::Migration[4.2] class AddIndexesOnDeletedColumn < ActiveRecord::Migration[4.2] class RemoveStatusFromCommons < ActiveRecord::Migration[4.2] class AddActiveToCustomer < ActiveRecord::Migration[4.2] class AddFailedToCommons < ActiveRecord::Migration[4.2] class SeriesFirstNumber < ActiveRecord::Migration[4.2] class EmailAndPrintTemplateToCommon < ActiveRecord::Migration[4.2] class EmailAndPrintDefaultTemplatesToTemplate < ActiveRecord::Migration[4.2] class ChangeCustomerIndex < ActiveRecord::Migration[4.2] class AddTemplateSubject < ActiveRecord::Migration[4.2] class AddInvoiceNumberUniqueNumber < ActiveRecord::Migration[4.2] class RemoveTaxAmount < ActiveRecord::Migration[4.2] class RemoveCommonsAmounts < ActiveRecord::Migration[4.2] class RemoveInvoiceUniqueNumber < ActiveRecord::Migration[4.2] class RemoveCustomersUniqueName < ActiveRecord::Migration[4.2] class AddUniqueIndexToInvoiceSeriesAndNumber < ActiveRecord::Migration[4.2] class AddDeletedNumberToCommons < ActiveRecord::Migration[4.2] class AddCommonsCustomerIdNotNull < ActiveRecord::Migration[4.2] class AddCurrencyToCommons < ActiveRecord::Migration[4.2]
[ "validation" ]
CVE-2017-16876
5f06d724bc05580e7f203db2d4a4905fc1127f98
https://github.com/lepture/mistune
[{'lang': 'en', 'value': 'Cross-site scripting (XSS) vulnerability in the _keyify function in mistune.py in Mistune before 0.8.1 allows remote attackers to inject arbitrary web script or HTML by leveraging failure to escape the "key" argument.'}]
4.3
6.1
2017-12-29T15:29Z
MEDIUM
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Fix CVE-2017-16876
2017-11-21 00:15:09 +0900
5f06d72
127
3
[ "mistune.py" ]
Python
{"mistune.py": {"lines_added": 5, "lines_deleted": 3}}
diff --git a/mistune.py b/mistune.py index d6ecf7e..5b05fcb 100644 --- a/mistune.py +++ b/mistune.py @@ -9,11 +9,11 @@ """ import re import inspect -__version__ = '0.8' +__version__ = '0.8.1' __author__ = 'Hsiaoming Yang <[email protected]>' __all__ = [ 'BlockGrammar', 'BlockLexer', 'InlineGrammar', 'InlineLexer', 'Renderer', 'Markdown', @@ -46,11 +46,12 @@ def _pure_pattern(regex): pattern = pattern[1:] return pattern def _keyify(key): - return _key_pattern.sub(' ', key.lower()) + key = escape(key.lower(), quote=True) + return _key_pattern.sub(' ', key) def escape(text, quote=False, smart_amp=True): """Replace special characters "&", "<" and ">" to HTML-safe sequences. @@ -443,11 +444,12 @@ class InlineGrammar(object): escape = re.compile(r'^\\([\\`*{}\[\]()#+\-.!_>~|])') # \* \+ \! .... inline_html = re.compile( r'^(?:%s|%s|%s)' % ( r'<!--[\s\S]*?-->', - r'<(\w+%s)((?:%s)*?)\s*>([\s\S]*?)<\/\1>' % (_valid_end, _valid_attr), + r'<(\w+%s)((?:%s)*?)\s*>([\s\S]*?)<\/\1>' % ( + _valid_end, _valid_attr), r'<\w+%s(?:%s)*?\s*\/?>' % (_valid_end, _valid_attr), ) ) autolink = re.compile(r'^<([^ >]+(@|:)[^ >]+)>') link = re.compile(
__version__ = '0.8' return _key_pattern.sub(' ', key.lower()) r'<(\w+%s)((?:%s)*?)\s*>([\s\S]*?)<\/\1>' % (_valid_end, _valid_attr),
__version__ = '0.8.1' key = escape(key.lower(), quote=True) return _key_pattern.sub(' ', key) r'<(\w+%s)((?:%s)*?)\s*>([\s\S]*?)<\/\1>' % ( _valid_end, _valid_attr),
[]
CVE-2022-21159
cfa94cbf10302bedc779703f874ee2e8387a0721
https://github.com/mz-automation/libiec61850
[{'lang': 'en', 'value': 'A denial of service vulnerability exists in the parseNormalModeParameters functionality of MZ Automation GmbH libiec61850 1.5.0. A specially-crafted series of network requests can lead to denial of service. An attacker can send a sequence of malformed iec61850 messages to trigger this vulnerability.'}]
5
7.5
2022-04-15T16:15Z
MEDIUM
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')
The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
- fixed - Bug in presentation layer parser can cause infinite loop (LIB61850-302)
2022-02-25 18:21:45 +0100
cfa94cb
896
3
[ "src/mms/iso_presentation/iso_presentation.c" ]
C
{"src/mms/iso_presentation/iso_presentation.c": {"lines_added": 4, "lines_deleted": 0}}
diff --git a/src/mms/iso_presentation/iso_presentation.c b/src/mms/iso_presentation/iso_presentation.c index 96fd8a3..e2ee12a 100644 --- a/src/mms/iso_presentation/iso_presentation.c +++ b/src/mms/iso_presentation/iso_presentation.c @@ -467,10 +467,14 @@ parseNormalModeParameters(IsoPresentation* self, uint8_t* buffer, int totalLengt case 0xa4: /* presentation-context-definition list */ if (DEBUG_PRES) printf("PRES: pcd list\n"); bufPos = parsePresentationContextDefinitionList(self, buffer, len, bufPos); + + if (bufPos < 0) + return -1; + break; case 0xa5: /* context-definition-result-list */ bufPos += len;
if (bufPos < 0) return -1;
[]
CVE-2022-3976
10622ba36bb3910c151348f1569f039ecdd8786f
https://github.com/mz-automation/libiec61850
[{'lang': 'en', 'value': 'A vulnerability has been found in MZ Automation libiec61850 up to 1.4 and classified as critical. This vulnerability affects unknown code of the file src/mms/iso_mms/client/mms_client_files.c of the component MMS File Services. The manipulation of the argument filename leads to path traversal. Upgrading to version 1.5 is able to address this issue. The name of the patch is 10622ba36bb3910c151348f1569f039ecdd8786f. It is recommended to upgrade the affected component. The identifier of this vulnerability is VDB-213556.'}]
null
8.8
2022-11-13T14:15Z
nan
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
- fixed path traversal vulnerability in MMS file services (LIB61850-357)
2022-10-07 17:09:11 +0100
10622ba3
896
3
[ "hal/filesystem/linux/file_provider_linux.c", "src/mms/inc_private/mms_common_internal.h", "src/mms/iso_mms/client/mms_client_files.c", "src/mms/iso_mms/common/mms_common_msg.c", "src/mms/iso_mms/server/mms_file_service.c" ]
C
{"hal/filesystem/linux/file_provider_linux.c": {"lines_added": 0, "lines_deleted": 1}, "src/mms/inc_private/mms_common_internal.h": {"lines_added": 3, "lines_deleted": 0}, "src/mms/iso_mms/client/mms_client_files.c": {"lines_added": 30, "lines_deleted": 21}, "src/mms/iso_mms/common/mms_common_msg.c": {"lines_added": 19, "lines_deleted": 1}, "src/mms/iso_mms/server/mms_file_service.c": {"lines_added": 51, "lines_deleted": 2}}
diff --git a/hal/filesystem/linux/file_provider_linux.c b/hal/filesystem/linux/file_provider_linux.c index dc869d96..7b501f00 100644 --- a/hal/filesystem/linux/file_provider_linux.c +++ b/hal/filesystem/linux/file_provider_linux.c @@ -35,11 +35,10 @@ struct sDirectoryHandle { DIR* handle; }; - FileHandle FileSystem_openFile(char* fileName, bool readWrite) { FileHandle newHandle = NULL; diff --git a/src/mms/inc_private/mms_common_internal.h b/src/mms/inc_private/mms_common_internal.h index 6ce05aeb..f096e7bc 100644 --- a/src/mms/inc_private/mms_common_internal.h +++ b/src/mms/inc_private/mms_common_internal.h @@ -80,10 +80,13 @@ LIB61850_INTERNAL void mmsMsg_createExtendedFilename(const char* basepath, int bufSize, char* extendedFileName, char* fileName); LIB61850_INTERNAL FileHandle mmsMsg_openFile(const char* basepath, char* fileName, bool readWrite); +LIB61850_INTERNAL bool +mmsMsg_isFilenameSave(const char* filename); + #endif /* (MMS_FILE_SERVICE == 1) */ typedef struct sMmsServiceError { int errorClass; diff --git a/src/mms/iso_mms/client/mms_client_files.c b/src/mms/iso_mms/client/mms_client_files.c index eda9bb1f..4fca418e 100644 --- a/src/mms/iso_mms/client/mms_client_files.c +++ b/src/mms/iso_mms/client/mms_client_files.c @@ -69,11 +69,10 @@ getFrsm(MmsConnection connection, int32_t frsmId) } return frsm; } - static int32_t getNextFrsmId(MmsConnection connection) { uint32_t nextFrsmId = connection->nextFrsmId; connection->nextFrsmId++; @@ -123,42 +122,52 @@ mmsClient_handleFileOpenRequest( } } if (hasFileName) { - MmsFileReadStateMachine* frsm = getFreeFrsm(connection); + if (mmsMsg_isFilenameSave(filename) == false) { + /* potential attack */ - if (frsm != NULL) { + if (DEBUG_MMS_CLIENT) + printf("MMS_CLIENT: client provided unsave filename -> rejected\n"); - MmsOutstandingCall obtainFileCall = mmsClient_getMatchingObtainFileRequest(connection, filename); + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); + } + else { + MmsFileReadStateMachine* frsm = getFreeFrsm(connection); - if (obtainFileCall) { + if (frsm != NULL) { - if (DEBUG_MMS_CLIENT) - printf("MMS_CLIENT: file open is matching obtain file request for file %s\n", filename); + MmsOutstandingCall obtainFileCall = mmsClient_getMatchingObtainFileRequest(connection, filename); - obtainFileCall->timeout = Hal_getTimeInMs() + connection->requestTimeout; - } + if (obtainFileCall) { - FileHandle fileHandle = mmsMsg_openFile(MmsConnection_getFilestoreBasepath(connection), filename, false); + if (DEBUG_MMS_CLIENT) + printf("MMS_CLIENT: file open is matching obtain file request for file %s\n", filename); - if (fileHandle != NULL) { + obtainFileCall->timeout = Hal_getTimeInMs() + connection->requestTimeout; + } - frsm->fileHandle = fileHandle; - frsm->readPosition = filePosition; - frsm->frsmId = getNextFrsmId(connection); - frsm->obtainRequest = obtainFileCall; + FileHandle fileHandle = mmsMsg_openFile(MmsConnection_getFilestoreBasepath(connection), filename, false); + + if (fileHandle != NULL) { + + frsm->fileHandle = fileHandle; + frsm->readPosition = filePosition; + frsm->frsmId = getNextFrsmId(connection); + frsm->obtainRequest = obtainFileCall; + + mmsMsg_createFileOpenResponse(MmsConnection_getFilestoreBasepath(connection), + invokeId, response, filename, frsm); + } + else + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); - mmsMsg_createFileOpenResponse(MmsConnection_getFilestoreBasepath(connection), - invokeId, response, filename, frsm); } else - mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); - + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_RESOURCE_OTHER); } - else - mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_RESOURCE_OTHER); } else goto exit_invalid_parameter; return; diff --git a/src/mms/iso_mms/common/mms_common_msg.c b/src/mms/iso_mms/common/mms_common_msg.c index 7555f0c0..76657334 100644 --- a/src/mms/iso_mms/common/mms_common_msg.c +++ b/src/mms/iso_mms/common/mms_common_msg.c @@ -568,10 +568,28 @@ mmsMsg_createExtendedFilename(const char* basepath, int bufSize, char* extendedF #else StringUtils_concatString(extendedFileName, bufSize, CONFIG_VIRTUAL_FILESTORE_BASEPATH, fileName); #endif } +bool +mmsMsg_isFilenameSave(const char* filename) +{ + if (filename) + { + if (strstr(filename, "..")) + return false; + + if (strstr(filename, "./")) + return false; + + return true; + } + else { + return false; + } +} + FileHandle mmsMsg_openFile(const char* basepath, char* fileName, bool readWrite) { #if (CONFIG_SET_FILESTORE_BASEPATH_AT_RUNTIME == 1) char extendedFileName[512]; @@ -618,11 +636,11 @@ mmsMsg_parseFileName(char* filename, uint8_t* buffer, int* bufPos, int maxBufPos /* Check if path contains invalid characters (prevent escaping the virtual filestore by using "..") * TODO this may be platform dependent. Also depending of the platform there might be other evil * characters. */ if (strstr(filename, "..") != NULL) { - mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILENAME_SYNTAX_ERROR); + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); return false; } return true; } diff --git a/src/mms/iso_mms/server/mms_file_service.c b/src/mms/iso_mms/server/mms_file_service.c index 2a0b18ad..e4ae154b 100644 --- a/src/mms/iso_mms/server/mms_file_service.c +++ b/src/mms/iso_mms/server/mms_file_service.c @@ -233,12 +233,10 @@ mmsMsg_createFileOpenResponse(const char* basepath, uint32_t invokeId, ByteBuffe bufPos = encodeFileAttributes(0xa1, frsm->fileSize, gtString, buffer, bufPos); response->size = bufPos; } - - void mmsServer_handleFileDeleteRequest( MmsServerConnection connection, uint8_t* buffer, int bufPos, int maxBufPos, uint32_t invokeId, @@ -264,10 +262,20 @@ mmsServer_handleFileDeleteRequest( filename[length] = 0; if (DEBUG_MMS_SERVER) printf("MMS_SERVER: mms_file_service.c: Delete file (%s)\n", filename); + if (mmsMsg_isFilenameSave(filename) == false) + { + if (DEBUG_MMS_SERVER) + printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); + + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); + + return; + } + if (connection->server->fileAccessHandler != NULL) { MmsError access = connection->server->fileAccessHandler(connection->server->fileAccessHandlerParameter, connection, MMS_FILE_ACCESS_TYPE_DELETE, filename, NULL); if (access != MMS_ERROR_NONE) { @@ -342,10 +350,21 @@ mmsServer_handleFileOpenRequest( } } if (hasFileName) { + if (mmsMsg_isFilenameSave(filename) == false) { + /* potential attack */ + + if (DEBUG_MMS_CLIENT) + printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); + + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); + + return; + } + if (connection->server->fileAccessHandler != NULL) { MmsError access = connection->server->fileAccessHandler(connection->server->fileAccessHandlerParameter, connection, MMS_FILE_ACCESS_TYPE_OPEN, filename, NULL); if (access != MMS_ERROR_NONE) { @@ -688,10 +707,19 @@ mmsServer_handleObtainFileRequest( } } if (hasSourceFileName && hasDestinationFilename) { + if (mmsMsg_isFilenameSave(destinationFilename) == false) { + /* potential attack */ + + if (DEBUG_MMS_SERVER) + printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); + + goto exit_invalid_parameter; + } + /* Call user to check if access is allowed */ if (connection->server->fileAccessHandler != NULL) { MmsError access = connection->server->fileAccessHandler(connection->server->fileAccessHandlerParameter, connection, MMS_FILE_ACCESS_TYPE_OBTAIN, destinationFilename, sourceFilename); @@ -1021,10 +1049,21 @@ createFileDirectoryResponse(const char* basepath, uint32_t invokeId, ByteBuffer* if (continueAfterFileName != NULL) { if (strlen(continueAfterFileName) == 0) continueAfterFileName = NULL; } + if ((directoryName && mmsMsg_isFilenameSave(directoryName) == false) || + (continueAfterFileName && mmsMsg_isFilenameSave(continueAfterFileName) == false)) + { + if (DEBUG_MMS_SERVER) + printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); + + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); + + return; + } + tempCurPos = addFileEntriesToResponse(basepath, buffer, tempCurPos, maxSize, directoryName, &continueAfterFileName, &moreFollows); if (tempCurPos < 0) { if (DEBUG_MMS_SERVER) @@ -1126,10 +1165,20 @@ mmsServer_handleFileRenameRequest( } } if ((strlen(currentFileName) != 0) && (strlen(newFileName) != 0)) { + if ((mmsMsg_isFilenameSave(currentFileName) == false) || (mmsMsg_isFilenameSave(newFileName) == false)) + { + if (DEBUG_MMS_SERVER) + printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); + + mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); + + return; + } + /* Call user to check if access is allowed */ if (connection->server->fileAccessHandler != NULL) { MmsError access = connection->server->fileAccessHandler(connection->server->fileAccessHandlerParameter, connection, MMS_FILE_ACCESS_TYPE_RENAME, currentFileName, newFileName);
MmsFileReadStateMachine* frsm = getFreeFrsm(connection); if (frsm != NULL) { MmsOutstandingCall obtainFileCall = mmsClient_getMatchingObtainFileRequest(connection, filename); if (obtainFileCall) { if (DEBUG_MMS_CLIENT) printf("MMS_CLIENT: file open is matching obtain file request for file %s\n", filename); obtainFileCall->timeout = Hal_getTimeInMs() + connection->requestTimeout; } FileHandle fileHandle = mmsMsg_openFile(MmsConnection_getFilestoreBasepath(connection), filename, false); if (fileHandle != NULL) { frsm->fileHandle = fileHandle; frsm->readPosition = filePosition; frsm->frsmId = getNextFrsmId(connection); frsm->obtainRequest = obtainFileCall; mmsMsg_createFileOpenResponse(MmsConnection_getFilestoreBasepath(connection), invokeId, response, filename, frsm); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); else mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_RESOURCE_OTHER); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILENAME_SYNTAX_ERROR);
LIB61850_INTERNAL bool mmsMsg_isFilenameSave(const char* filename); if (mmsMsg_isFilenameSave(filename) == false) { /* potential attack */ if (DEBUG_MMS_CLIENT) printf("MMS_CLIENT: client provided unsave filename -> rejected\n"); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); } else { MmsFileReadStateMachine* frsm = getFreeFrsm(connection); if (frsm != NULL) { MmsOutstandingCall obtainFileCall = mmsClient_getMatchingObtainFileRequest(connection, filename); if (obtainFileCall) { if (DEBUG_MMS_CLIENT) printf("MMS_CLIENT: file open is matching obtain file request for file %s\n", filename); obtainFileCall->timeout = Hal_getTimeInMs() + connection->requestTimeout; } FileHandle fileHandle = mmsMsg_openFile(MmsConnection_getFilestoreBasepath(connection), filename, false); if (fileHandle != NULL) { frsm->fileHandle = fileHandle; frsm->readPosition = filePosition; frsm->frsmId = getNextFrsmId(connection); frsm->obtainRequest = obtainFileCall; mmsMsg_createFileOpenResponse(MmsConnection_getFilestoreBasepath(connection), invokeId, response, filename, frsm); } else mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_RESOURCE_OTHER); bool mmsMsg_isFilenameSave(const char* filename) { if (filename) { if (strstr(filename, "..")) return false; if (strstr(filename, "./")) return false; return true; } else { return false; } } mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); if (mmsMsg_isFilenameSave(filename) == false) { if (DEBUG_MMS_SERVER) printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); return; } if (mmsMsg_isFilenameSave(filename) == false) { /* potential attack */ if (DEBUG_MMS_CLIENT) printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); return; } if (mmsMsg_isFilenameSave(destinationFilename) == false) { /* potential attack */ if (DEBUG_MMS_SERVER) printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); goto exit_invalid_parameter; } if ((directoryName && mmsMsg_isFilenameSave(directoryName) == false) || (continueAfterFileName && mmsMsg_isFilenameSave(continueAfterFileName) == false)) { if (DEBUG_MMS_SERVER) printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); return; } if ((mmsMsg_isFilenameSave(currentFileName) == false) || (mmsMsg_isFilenameSave(newFileName) == false)) { if (DEBUG_MMS_SERVER) printf("MMS_SERVER: remote provided unsave filename -> rejected\n"); mmsMsg_createServiceErrorPdu(invokeId, response, MMS_ERROR_FILE_FILE_NON_EXISTENT); return; }
[]
CVE-2023-27772
79a8eaf26070e02044afc4b2ffbfe777dfdf3e0b
https://github.com/mz-automation/libiec61850
[{'lang': 'en', 'value': 'libiec61850 v1.5.1 was discovered to contain a segmentation violation via the function ControlObjectClient_setOrigin() at /client/client_control.c.'}]
null
7.5
2023-04-13T18:15Z
nan
CWE-754
Improper Check for Unusual or Exceptional Conditions
The product does not check or incorrectly checks for unusual or exceptional conditions that are not expected to occur frequently during day to day operation of the product.
- added missing checks in iec61850_client_example_control (#442)
2023-02-24 11:07:09 +0000
79a8eaf2
896
3
[ "examples/iec61850_client_example_control/client_example_control.c" ]
C
{"examples/iec61850_client_example_control/client_example_control.c": {"lines_added": 106, "lines_deleted": 77}}
diff --git a/examples/iec61850_client_example_control/client_example_control.c b/examples/iec61850_client_example_control/client_example_control.c index 33da635a..37d6b6bc 100644 --- a/examples/iec61850_client_example_control/client_example_control.c +++ b/examples/iec61850_client_example_control/client_example_control.c @@ -43,171 +43,200 @@ int main(int argc, char** argv) { IedConnection con = IedConnection_create(); IedConnection_connect(con, &error, hostname, tcpPort); - if (error == IED_ERROR_OK) { - + if (error == IED_ERROR_OK) + { + MmsValue* ctlVal = NULL; + MmsValue* stVal = NULL; /************************ * Direct control ***********************/ ControlObjectClient control = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO1", con); - MmsValue* ctlVal = MmsValue_newBoolean(true); + if (control) + { + ctlVal = MmsValue_newBoolean(true); - ControlObjectClient_setOrigin(control, NULL, 3); + ControlObjectClient_setOrigin(control, NULL, 3); - if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { - printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n"); - } - else { - printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO1\n"); - } + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { + printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n"); + } + else { + printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO1\n"); + } + + MmsValue_delete(ctlVal); - MmsValue_delete(ctlVal); + ControlObjectClient_destroy(control); - ControlObjectClient_destroy(control); + /* Check if status value has changed */ - /* Check if status value has changed */ + stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1.stVal", IEC61850_FC_ST); - MmsValue* stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1.stVal", IEC61850_FC_ST); + if (error == IED_ERROR_OK) { + bool state = MmsValue_getBoolean(stVal); + MmsValue_delete(stVal); - if (error == IED_ERROR_OK) { - bool state = MmsValue_getBoolean(stVal); - MmsValue_delete(stVal); + printf("New status of simpleIOGenericIO/GGIO1.SPCSO1.stVal: %i\n", state); + } + else { + printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO1 failed!\n"); + } - printf("New status of simpleIOGenericIO/GGIO1.SPCSO1.stVal: %i\n", state); } else { - printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO1 failed!\n"); + printf("Control object simpleIOGenericIO/GGIO1.SPCSO1 not found in server\n"); } - /************************ * Select before operate ***********************/ control = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO2", con); - if (ControlObjectClient_select(control)) { + if (control) + { + if (ControlObjectClient_select(control)) { - ctlVal = MmsValue_newBoolean(true); + ctlVal = MmsValue_newBoolean(true); - if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { - printf("simpleIOGenericIO/GGIO1.SPCSO2 operated successfully\n"); + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { + printf("simpleIOGenericIO/GGIO1.SPCSO2 operated successfully\n"); + } + else { + printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO2!\n"); + } + + MmsValue_delete(ctlVal); } else { - printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO2!\n"); + printf("failed to select simpleIOGenericIO/GGIO1.SPCSO2!\n"); } - MmsValue_delete(ctlVal); + ControlObjectClient_destroy(control); } else { - printf("failed to select simpleIOGenericIO/GGIO1.SPCSO2!\n"); + printf("Control object simpleIOGenericIO/GGIO1.SPCSO2 not found in server\n"); } - ControlObjectClient_destroy(control); - - /**************************************** * Direct control with enhanced security ****************************************/ control = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO3", con); - ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); + if (control) + { + ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); - ctlVal = MmsValue_newBoolean(true); + ctlVal = MmsValue_newBoolean(true); - if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { - printf("simpleIOGenericIO/GGIO1.SPCSO3 operated successfully\n"); - } - else { - printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO3\n"); - } + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { + printf("simpleIOGenericIO/GGIO1.SPCSO3 operated successfully\n"); + } + else { + printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO3\n"); + } - MmsValue_delete(ctlVal); + MmsValue_delete(ctlVal); - /* Wait for command termination message */ - Thread_sleep(1000); + /* Wait for command termination message */ + Thread_sleep(1000); - ControlObjectClient_destroy(control); + ControlObjectClient_destroy(control); - /* Check if status value has changed */ + /* Check if status value has changed */ - stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO3.stVal", IEC61850_FC_ST); + stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO3.stVal", IEC61850_FC_ST); - if (error == IED_ERROR_OK) { - bool state = MmsValue_getBoolean(stVal); + if (error == IED_ERROR_OK) { + bool state = MmsValue_getBoolean(stVal); - printf("New status of simpleIOGenericIO/GGIO1.SPCSO3.stVal: %i\n", state); + printf("New status of simpleIOGenericIO/GGIO1.SPCSO3.stVal: %i\n", state); - MmsValue_delete(stVal); + MmsValue_delete(stVal); + } + else { + printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO3 failed!\n"); + } } else { - printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO3 failed!\n"); + printf("Control object simpleIOGenericIO/GGIO1.SPCSO3 not found in server\n"); } /*********************************************** * Select before operate with enhanced security ***********************************************/ control = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO4", con); - ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); + if (control) + { + ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); - ctlVal = MmsValue_newBoolean(true); + ctlVal = MmsValue_newBoolean(true); - if (ControlObjectClient_selectWithValue(control, ctlVal)) { + if (ControlObjectClient_selectWithValue(control, ctlVal)) { + + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { + printf("simpleIOGenericIO/GGIO1.SPCSO4 operated successfully\n"); + } + else { + printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO4!\n"); + } - if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { - printf("simpleIOGenericIO/GGIO1.SPCSO4 operated successfully\n"); } else { - printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO4!\n"); + printf("failed to select simpleIOGenericIO/GGIO1.SPCSO4!\n"); } + MmsValue_delete(ctlVal); + + /* Wait for command termination message */ + Thread_sleep(1000); + + ControlObjectClient_destroy(control); } else { - printf("failed to select simpleIOGenericIO/GGIO1.SPCSO4!\n"); + printf("Control object simpleIOGenericIO/GGIO1.SPCSO4 not found in server\n"); } - MmsValue_delete(ctlVal); - - /* Wait for command termination message */ - Thread_sleep(1000); - - ControlObjectClient_destroy(control); - - /********************************************************************* * Direct control with enhanced security (expect CommandTermination-) *********************************************************************/ control = ControlObjectClient_create("simpleIOGenericIO/GGIO1.SPCSO9", con); - ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); - - ctlVal = MmsValue_newBoolean(true); + if (control) + { + ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); - if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { - printf("simpleIOGenericIO/GGIO1.SPCSO9 operated successfully\n"); - } - else { - printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO9\n"); - } + ctlVal = MmsValue_newBoolean(true); - MmsValue_delete(ctlVal); + if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { + printf("simpleIOGenericIO/GGIO1.SPCSO9 operated successfully\n"); + } + else { + printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO9\n"); + } - /* Wait for command termination message */ - Thread_sleep(1000); + MmsValue_delete(ctlVal); - ControlObjectClient_destroy(control); + /* Wait for command termination message */ + Thread_sleep(1000); + ControlObjectClient_destroy(control); + } + else { + printf("Control object simpleIOGenericIO/GGIO1.SPCSO9 not found in server\n"); + } IedConnection_close(con); } else { printf("Connection failed!\n");
if (error == IED_ERROR_OK) { MmsValue* ctlVal = MmsValue_newBoolean(true); ControlObjectClient_setOrigin(control, NULL, 3); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO1\n"); } MmsValue_delete(ctlVal); ControlObjectClient_destroy(control); /* Check if status value has changed */ MmsValue* stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1.stVal", IEC61850_FC_ST); if (error == IED_ERROR_OK) { bool state = MmsValue_getBoolean(stVal); MmsValue_delete(stVal); printf("New status of simpleIOGenericIO/GGIO1.SPCSO1.stVal: %i\n", state); printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO1 failed!\n"); if (ControlObjectClient_select(control)) { ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO2 operated successfully\n"); printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO2!\n"); MmsValue_delete(ctlVal); printf("failed to select simpleIOGenericIO/GGIO1.SPCSO2!\n"); ControlObjectClient_destroy(control); ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO3 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO3\n"); } MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control); /* Check if status value has changed */ stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO3.stVal", IEC61850_FC_ST); if (error == IED_ERROR_OK) { bool state = MmsValue_getBoolean(stVal); printf("New status of simpleIOGenericIO/GGIO1.SPCSO3.stVal: %i\n", state); MmsValue_delete(stVal); printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO3 failed!\n"); ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_selectWithValue(control, ctlVal)) { if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO4 operated successfully\n"); printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO4!\n"); printf("failed to select simpleIOGenericIO/GGIO1.SPCSO4!\n"); MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control); ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO9 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO9\n"); } MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control);
if (error == IED_ERROR_OK) { MmsValue* ctlVal = NULL; MmsValue* stVal = NULL; if (control) { ctlVal = MmsValue_newBoolean(true); ControlObjectClient_setOrigin(control, NULL, 3); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO1 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO1\n"); } MmsValue_delete(ctlVal); ControlObjectClient_destroy(control); /* Check if status value has changed */ stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO1.stVal", IEC61850_FC_ST); if (error == IED_ERROR_OK) { bool state = MmsValue_getBoolean(stVal); MmsValue_delete(stVal); printf("New status of simpleIOGenericIO/GGIO1.SPCSO1.stVal: %i\n", state); } else { printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO1 failed!\n"); } printf("Control object simpleIOGenericIO/GGIO1.SPCSO1 not found in server\n"); if (control) { if (ControlObjectClient_select(control)) { ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO2 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO2!\n"); } MmsValue_delete(ctlVal); printf("failed to select simpleIOGenericIO/GGIO1.SPCSO2!\n"); ControlObjectClient_destroy(control); printf("Control object simpleIOGenericIO/GGIO1.SPCSO2 not found in server\n"); if (control) { ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO3 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO3\n"); } MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control); /* Check if status value has changed */ stVal = IedConnection_readObject(con, &error, "simpleIOGenericIO/GGIO1.SPCSO3.stVal", IEC61850_FC_ST); if (error == IED_ERROR_OK) { bool state = MmsValue_getBoolean(stVal); printf("New status of simpleIOGenericIO/GGIO1.SPCSO3.stVal: %i\n", state); MmsValue_delete(stVal); } else { printf("Reading status for simpleIOGenericIO/GGIO1.SPCSO3 failed!\n"); } printf("Control object simpleIOGenericIO/GGIO1.SPCSO3 not found in server\n"); if (control) { ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_selectWithValue(control, ctlVal)) { if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO4 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO4!\n"); } printf("failed to select simpleIOGenericIO/GGIO1.SPCSO4!\n"); MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control); printf("Control object simpleIOGenericIO/GGIO1.SPCSO4 not found in server\n"); if (control) { ControlObjectClient_setCommandTerminationHandler(control, commandTerminationHandler, NULL); ctlVal = MmsValue_newBoolean(true); if (ControlObjectClient_operate(control, ctlVal, 0 /* operate now */)) { printf("simpleIOGenericIO/GGIO1.SPCSO9 operated successfully\n"); } else { printf("failed to operate simpleIOGenericIO/GGIO1.SPCSO9\n"); } MmsValue_delete(ctlVal); /* Wait for command termination message */ Thread_sleep(1000); ControlObjectClient_destroy(control); } else { printf("Control object simpleIOGenericIO/GGIO1.SPCSO9 not found in server\n"); }
[ "validation" ]
CVE-2019-25087
1a0de56e4dafff9c2f9c8f6b130a764f7a50df52
https://github.com/RamseyK/httpserver
[{'lang': 'en', 'value': "A vulnerability was found in RamseyK httpserver. It has been rated as critical. This issue affects the function ResourceHost::getResource of the file src/ResourceHost.cpp of the component URI Handler. The manipulation of the argument uri leads to path traversal: '../filedir'. The attack may be initiated remotely. The name of the patch is 1a0de56e4dafff9c2f9c8f6b130a764f7a50df52. It is recommended to apply a patch to fix this issue. The associated identifier of this vulnerability is VDB-216863."}]
null
7.5
2022-12-27T09:15Z
nan
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
Deny any directory traversal paths. README update
2019-09-08 11:23:20 -0500
1a0de56
26
2
[ "README.md", "src/HTTPServer.cpp", "src/ResourceHost.cpp" ]
C++
{"README.md": {"lines_added": 4, "lines_deleted": 1}, "src/HTTPServer.cpp": {"lines_added": 1, "lines_deleted": 1}, "src/ResourceHost.cpp": {"lines_added": 3, "lines_deleted": 0}}
diff --git a/README.md b/README.md index ec0ba22..db89830 100755 --- a/README.md +++ b/README.md @@ -1,15 +1,18 @@ # HTTP Server Ramsey Kant https://github.com/RamseyK/httpserver -A high performance, single threaded, HTTP server written in C++ to serve as a kqueue socket management and HTTP protocol learning tool +A high performance, single threaded, HTTP server written in C++ to serve as a kqueue socket management and HTTP protocol learning tool on BSD systems ## Features * Clean, documented code * Efficient socket management with kqueue * Easy to understand HTTP protocol parser (from my ByteBuffer project) * Tested on FreeBSD and MacOS +## Compiling Notes +* On FreeBSD, compile with gmake + ## License See LICENSE.TXT diff --git a/src/HTTPServer.cpp b/src/HTTPServer.cpp index 75900bc..41fa33d 100755 --- a/src/HTTPServer.cpp +++ b/src/HTTPServer.cpp @@ -438,11 +438,11 @@ void HTTPServer::handleRequest(Client *cl, HTTPRequest* req) { } std::cout << "[" << cl->getClientIP() << "] " << req->methodIntToStr(req->getMethod()) << " " << req->getRequestUri() << std::endl; /*std::cout << "Headers:" << std::endl; for(int i = 0; i < req->getNumHeaders(); i++) { - std::cout << req->getHeaderStr(i) << std::endl; + std::cout << "\t" << req->getHeaderStr(i) << std::endl; } std::cout << std::endl;*/ // Determine the appropriate vhost ResourceHost* resHost = NULL; diff --git a/src/ResourceHost.cpp b/src/ResourceHost.cpp index ab65d41..013221c 100755 --- a/src/ResourceHost.cpp +++ b/src/ResourceHost.cpp @@ -181,10 +181,13 @@ std::string ResourceHost::generateDirList(std::string path) { */ Resource* ResourceHost::getResource(std::string uri) { if (uri.length() > 255 || uri.empty()) return NULL; + if (uri.find("../") != std::string::npos) + return NULL; + std::string path = baseDiskPath + uri; Resource* res = NULL; // Gather info about the resource with stat: determine if it's a directory or file, check if its owned by group/user, modify times struct stat sb;
A high performance, single threaded, HTTP server written in C++ to serve as a kqueue socket management and HTTP protocol learning tool std::cout << req->getHeaderStr(i) << std::endl;
A high performance, single threaded, HTTP server written in C++ to serve as a kqueue socket management and HTTP protocol learning tool on BSD systems ## Compiling Notes * On FreeBSD, compile with gmake std::cout << "\t" << req->getHeaderStr(i) << std::endl; if (uri.find("../") != std::string::npos) return NULL;
[]
CVE-2014-2829
586d96cc12ef218243a3466354b4d208b5472a6c
https://github.com/esl/MongooseIM
[{'lang': 'en', 'value': 'Erlang Solutions MongooseIM through 1.3.1 rev. 2 does not properly restrict the processing of compressed XML elements, which allows remote attackers to cause a denial of service (resource consumption) via a crafted XMPP stream, aka an "xmppbomb" attack.'}]
7.8
null
2014-04-11T01:55Z
HIGH
CWE-264
Permissions, Privileges, and Access Controls
Weaknesses in this category are related to the management of permissions, privileges, and other security features that are used to perform access control.
Merge pull request #167 from esl/zlib_cwe400_fix Add zlib inflated data size limit
2014-04-09 15:05:37 +0200
586d96cc
1,451
3
[]
Unknown
{"apps/ejabberd/c_src/ejabberd_zlib_drv.c": {"lines_added": 79, "lines_deleted": 72}, "apps/ejabberd/src/ejabberd_c2s.erl": {"lines_added": 20, "lines_deleted": 18}, "apps/ejabberd/src/ejabberd_receiver.erl": {"lines_added": 10, "lines_deleted": 2}, "apps/ejabberd/src/ejabberd_socket.erl": {"lines_added": 4, "lines_deleted": 3}, "apps/ejabberd/src/ejabberd_zlib.erl": {"lines_added": 11, "lines_deleted": 8}, "apps/ejabberd/src/mod_bosh_socket.erl": {"lines_added": 3, "lines_deleted": 3}, "apps/ejabberd/src/mod_websockets.erl": {"lines_added": 3, "lines_deleted": 3}, "apps/ejabberd/src/xml_stream.erl": {"lines_added": 1, "lines_deleted": 1}, "rel/files/ejabberd.cfg": {"lines_added": 2, "lines_deleted": 0}, "rel/reltool_vars/node1_vars.config": {"lines_added": 7, "lines_deleted": 0}, "rel/vars.config": {"lines_added": 1, "lines_deleted": 1}}
[]
CVE-2020-15084
7ecab5f8f0cab5297c2b863596566eb0c019cdef
https://github.com/auth0/express-jwt
[{'lang': 'en', 'value': 'In express-jwt (NPM package) up and including version 5.3.3, the algorithms entry to be specified in the configuration is not being enforced. When algorithms is not specified in the configuration, with the combination of jwks-rsa, it may lead to authorization bypass. You are affected by this vulnerability if all of the following conditions apply: - You are using express-jwt - You do not have **algorithms** configured in your express-jwt configuration. - You are using libraries such as jwks-rsa as the **secret**. You can fix this by specifying **algorithms** in the express-jwt configuration. See linked GHSA for example. This is also fixed in version 6.0.0.'}]
4.3
9.1
2020-06-30T16:15Z
MEDIUM
CWE-863
Incorrect Authorization
The product performs an authorization check when an actor attempts to access a resource or perform an action, but it does not correctly perform the check. This allows attackers to bypass intended access restrictions.
Merge pull request from GHSA-6g6m-m6h5-w9gf Made algorithms mandatory
2020-06-29 16:36:49 -0300
7ecab5f
20
3
[]
Unknown
{"lib/index.js": {"lines_added": 3, "lines_deleted": 0}, "package.json": {"lines_added": 1, "lines_deleted": 1}, "test/jwt.test.js": {"lines_added": 46, "lines_deleted": 29}, "test/multitenancy.test.js": {"lines_added": 4, "lines_deleted": 2}, "test/revocation.test.js": {"lines_added": 2, "lines_deleted": 0}, "test/string_token.test.js": {"lines_added": 1, "lines_deleted": 1}}
[]
CVE-2016-7149
9a4ab85439d1b838ee7b8eeebbf59174bb787811
https://github.com/b2evolution/b2evolution
[{'lang': 'en', 'value': 'Cross-site scripting (XSS) vulnerability in b2evolution 6.7.5 and earlier allows remote attackers to inject arbitrary web script or HTML via vectors related to the autolink function.'}]
4.3
6.1
2017-01-18T17:59Z
MEDIUM
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Fix autolink function to avoid XSS issue
2016-08-12 18:11:18 +0300
9a4ab8543
2,948
3
[ "_tests/blogs/evocore/misc.funcs.simpletest.php", "inc/_core/_misc.funcs.php" ]
PHP
{"_tests/blogs/evocore/misc.funcs.simpletest.php": {"lines_added": 3, "lines_deleted": 0}, "inc/_core/_misc.funcs.php": {"lines_added": 4, "lines_deleted": 4}}
diff --git a/_tests/blogs/evocore/misc.funcs.simpletest.php b/_tests/blogs/evocore/misc.funcs.simpletest.php index cd2fe71cb..a58d5b943 100644 --- a/_tests/blogs/evocore/misc.funcs.simpletest.php +++ b/_tests/blogs/evocore/misc.funcs.simpletest.php @@ -52,10 +52,13 @@ class MiscFuncsTestCase extends EvoUnitTestCase 'wanna chat? icq:878787.' => 'wanna chat? <a href="http://wwp.icq.com/scripts/search.dll?to=878787">878787</a>.', '<img src="http://example.com/" />' => '<img src="http://example.com/" />', '<img src=http://example.com/ />' => '<img src=http://example.com/ />', '<div>http://example.com/</div>' => '<div><a href="http://example.com/">http://example.com/</a></div>', + + // XSS sample: + 'text http://test_url.test"onmouseover="alert(1)"onerror=1 "text' => 'text <a href="http://test_url.test">http://test_url.test</a>"onmouseover="alert(1)"onerror=1 "text', ) as $lText => $lExpected ) { $this->assertEqual( make_clickable($lText), $lExpected ); } } diff --git a/inc/_core/_misc.funcs.php b/inc/_core/_misc.funcs.php index c487df914..0f716268c 100644 --- a/inc/_core/_misc.funcs.php +++ b/inc/_core/_misc.funcs.php @@ -1319,15 +1319,15 @@ function make_clickable_callback( $text, $moredelim = '&amp;', $additional_attrs $pattern_domain = '([\p{L}0-9\-]+\.[\p{L}0-9\-.\~]+)'; // a domain name (not very strict) $text = preg_replace( /* Tblue> I removed the double quotes from the first RegExp because it made URLs in tag attributes clickable. See http://forums.b2evolution.net/viewtopic.php?p=92073 */ - array( '#(^|[\s>\(]|\[url=)(https?|mailto)://([^<>{}\s]+[^.,:;!\?<>{}\s\]\)])#i', - '#(^|[\s>\(]|\[url=)aim:([^,<\s\]\)]+)#i', + array( '#(^|[\s>\(]|\[url=)(https?|mailto)://([^"<>{}\s]+[^".,:;!\?<>{}\s\]\)])#i', + '#(^|[\s>\(]|\[url=)aim:([^",<\s\]\)]+)#i', '#(^|[\s>\(]|\[url=)icq:(\d+)#i', - '#(^|[\s>\(]|\[url=)www\.'.$pattern_domain.'([^<>{}\s]*[^.,:;!\?\s\]\)])#i', - '#(^|[\s>\(]|\[url=)([a-z0-9\-_.]+?)@'.$pattern_domain.'([^.,:;!\?<\s\]\)]+)#i', ), + '#(^|[\s>\(]|\[url=)www\.'.$pattern_domain.'([^"<>{}\s]*[^".,:;!\?\s\]\)])#i', + '#(^|[\s>\(]|\[url=)([a-z0-9\-_.]+?)@'.$pattern_domain.'([^".,:;!\?<\s\]\)]+)#i', ), array( '$1<a href="$2://$3"'.$additional_attrs.'>$2://$3</a>', '$1<a href="aim:goim?screenname=$2$3'.$moredelim.'message='.rawurlencode(T_('Hello')).'"'.$additional_attrs.'>$2$3</a>', '$1<a href="http://wwp.icq.com/scripts/search.dll?to=$2"'.$additional_attrs.'>$2</a>', '$1<a href="http://www.$2$3$4"'.$additional_attrs.'>www.$2$3$4</a>', '$1<a href="mailto:$2@$3$4"'.$additional_attrs.'>$2@$3$4</a>', ),
array( '#(^|[\s>\(]|\[url=)(https?|mailto)://([^<>{}\s]+[^.,:;!\?<>{}\s\]\)])#i', '#(^|[\s>\(]|\[url=)aim:([^,<\s\]\)]+)#i', '#(^|[\s>\(]|\[url=)www\.'.$pattern_domain.'([^<>{}\s]*[^.,:;!\?\s\]\)])#i', '#(^|[\s>\(]|\[url=)([a-z0-9\-_.]+?)@'.$pattern_domain.'([^.,:;!\?<\s\]\)]+)#i', ),
// XSS sample: 'text http://test_url.test"onmouseover="alert(1)"onerror=1 "text' => 'text <a href="http://test_url.test">http://test_url.test</a>"onmouseover="alert(1)"onerror=1 "text', array( '#(^|[\s>\(]|\[url=)(https?|mailto)://([^"<>{}\s]+[^".,:;!\?<>{}\s\]\)])#i', '#(^|[\s>\(]|\[url=)aim:([^",<\s\]\)]+)#i', '#(^|[\s>\(]|\[url=)www\.'.$pattern_domain.'([^"<>{}\s]*[^".,:;!\?\s\]\)])#i', '#(^|[\s>\(]|\[url=)([a-z0-9\-_.]+?)@'.$pattern_domain.'([^".,:;!\?<\s\]\)]+)#i', ),
[]
CVE-2016-7150
dd975fff7fce81bf12f9c59edb1a99475747c83c
https://github.com/b2evolution/b2evolution
[{'lang': 'en', 'value': 'Cross-site scripting (XSS) vulnerability in b2evolution 6.7.5 and earlier allows remote authenticated users to inject arbitrary web script or HTML via the site name.'}]
3.5
5.4
2017-01-18T17:59Z
LOW
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.
Fix XSS vulnerability on "site name"
2016-08-12 18:24:55 +0300
dd975fff7f
2,948
3
[ "skins_site/_site_body_header.inc.php" ]
PHP
{"skins_site/_site_body_header.inc.php": {"lines_added": 2, "lines_deleted": 2}}
diff --git a/skins_site/_site_body_header.inc.php b/skins_site/_site_body_header.inc.php index 70e3c21796..99e63b9a90 100644 --- a/skins_site/_site_body_header.inc.php +++ b/skins_site/_site_body_header.inc.php @@ -15,12 +15,12 @@ global $baseurl, $Settings; <nav class="sitewide_header"> <?php if( $Settings->get( 'notification_logo' ) != '' ) { - $site_title = $Settings->get( 'notification_long_name' ) != '' ? ' title="'.$Settings->get( 'notification_long_name' ).'"' : ''; - $site_name_text = '<img src="'.$Settings->get( 'notification_logo' ).'" alt="'.$Settings->get( 'notification_short_name' ).'"'.$site_title.' />'; + $site_title = $Settings->get( 'notification_long_name' ) != '' ? ' title="'.format_to_output( $Settings->get( 'notification_long_name' ), 'htmlattr' ).'"' : ''; + $site_name_text = '<img src="'.$Settings->get( 'notification_logo' ).'" alt="'.format_to_output( $Settings->get( 'notification_short_name' ), 'htmlattr' ).'"'.$site_title.' />'; $site_title_class = ' swhead_logo'; } else { $site_name_text = $Settings->get( 'notification_short_name' );
$site_title = $Settings->get( 'notification_long_name' ) != '' ? ' title="'.$Settings->get( 'notification_long_name' ).'"' : ''; $site_name_text = '<img src="'.$Settings->get( 'notification_logo' ).'" alt="'.$Settings->get( 'notification_short_name' ).'"'.$site_title.' />';
$site_title = $Settings->get( 'notification_long_name' ) != '' ? ' title="'.format_to_output( $Settings->get( 'notification_long_name' ), 'htmlattr' ).'"' : ''; $site_name_text = '<img src="'.$Settings->get( 'notification_logo' ).'" alt="'.format_to_output( $Settings->get( 'notification_short_name' ), 'htmlattr' ).'"'.$site_title.' />';
[]
End of preview. Expand in Data Studio

CVEfixes Security Vulnerabilities Dataset

Security vulnerability data from CVEfixes v1.0.8 with 12,987 vulnerability fix records across 11,726 unique CVEs and 4,205 repositories.

Contains CVE metadata (descriptions, CVSS scores, CWE classifications), git commit data, and code diffs showing vulnerable vs fixed code.

Usage

from datasets import load_dataset

dataset = load_dataset("hitoshura25/cvefixes")

Citation

If you use this dataset, please cite the original CVEfixes paper:

@inproceedings{bhandari2021cvefixes,
  title={CVEfixes: Automated Collection of Vulnerabilities and Their Fixes from Open-Source Software},
  author={Bhandari, Guru and Naseer, Amara and Moonen, Leon},
  booktitle={Proceedings of the 17th International Conference on Predictive Models and Data Analytics in Software Engineering},
  pages={30--39},
  year={2021}
}

License

Apache License 2.0 - Derived from CVEfixes

Downloads last month
110