code
stringlengths
12
2.05k
label
int64
0
1
programming_language
stringclasses
9 values
cwe_id
stringlengths
6
14
cwe_name
stringlengths
5
103
description
stringlengths
36
1.23k
url
stringlengths
36
48
label_name
stringclasses
2 values
final void addObject(CharSequence name, Iterable<?> values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); for (Object v : values) { requireNonNullElement(values, v); addObject(normalizedName, v); } }
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
public boolean isCorsAccessAllowed(String pOrigin) { return isAllowed; }
0
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
vulnerable
public void handle(HttpExchange pExchange) throws IOException { if (requestHandler == null) { throw new IllegalStateException("Handler not yet started"); } JSONAware json = null; URI uri = pExchange.getRequestURI(); ParsedUri parsedUri = new ParsedUri(uri,context...
1
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
private RDFDescription parseAsResource(Node node) { // See: http://www.w3.org/TR/REC-rdf-syntax/#section-Syntax-parsetype-resource List<Entry> entries = new ArrayList<Entry>(); for (Node child : asIterable(node.getChildNodes())) { if (child.getNodeType() != Node.ELEMENT_NODE) { ...
0
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
vulnerable
public void cors() { InputStream is = getClass().getResourceAsStream("/allow-origin4.xml"); PolicyRestrictor restrictor = new PolicyRestrictor(is); for (boolean strict : new boolean[] {true, false}) { assertTrue(restrictor.isOriginAllowed("http://bla.com", strict)); ...
1
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
public void handle(HttpServletRequest request, final HttpServletResponse response) throws Exception { // We're sending an XML response, so set the response content type to text/xml response.setContentType("text/xml"); // Parse the incoming request as XML SAXReader xmlReader = new SAXReader();...
0
Java
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.
https://cwe.mitre.org/data/definitions/264.html
vulnerable
public OldIESwithCipher(BlockCipher baseCipher) { super(new OldIESEngine(new DHBasicAgreement(), new KDF2BytesGenerator(new SHA1Digest()), new HMac(new SHA1Digest()), new PaddedBufferedBlockCipher(baseCipher))); }
0
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
public void create_withThreadPool() throws Exception { final QueuedThreadPool threadPool = new QueuedThreadPool(100); final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class); final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class); ...
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
protected int addFileNames(String[] file) { // This appears to only be used by unit tests for (int i = 0; file != null && i < file.length; i++) { workUnitList.add(new WorkUnit(file[i])); } return size(); }
0
Java
CWE-502
Deserialization of Untrusted Data
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
void sendResetPasswordEmailRequest() throws Exception { when(this.referenceSerializer.serialize(this.userReference)).thenReturn("user:Foobar"); when(this.userProperties.getFirstName()).thenReturn("Foo"); when(this.userProperties.getLastName()).thenReturn("Bar"); AuthenticationRe...
0
Java
CWE-640
Weak Password Recovery Mechanism for Forgotten Password
The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.
https://cwe.mitre.org/data/definitions/640.html
vulnerable
public JpaSort andUnsafe(Direction direction, String... properties) { Assert.notEmpty(properties, "Properties must not be null!"); List<Order> orders = new ArrayList<Order>(); for (Order order : this) { orders.add(order); } for (String property : properties) { orders.add(new JpaOrder(direction, pro...
1
Java
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
protected abstract void store(ConfidentialKey key, byte[] payload) throws IOException; /** * Reverse operation of {@link #store(ConfidentialKey, byte[])} * * @return * null the data has not been previously persisted, or if the data was tampered. */ protected abstract @CheckFor...
0
Java
NVD-CWE-noinfo
null
null
null
vulnerable
private void populateAuthCacheInAllPeers(AuthorizationContext authContext) throws Throwable { // send a GET request to the ExampleService factory to populate auth cache on each peer. // since factory is not OWNER_SELECTION service, request goes to the specified node. for (VerificationHost p...
0
Java
CWE-732
Incorrect Permission Assignment for Critical Resource
The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.
https://cwe.mitre.org/data/definitions/732.html
vulnerable
public Response attachTaskFile(@PathParam("courseId") Long courseId, @PathParam("nodeId") String nodeId, @Context HttpServletRequest request) { ICourse course = CoursesWebService.loadCourse(courseId); CourseEditorTreeNode parentNode = getParentNode(course, nodeId); if(course == null) { return Response.ser...
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
public GCM() { super(new GCMBlockCipher(new AESFastEngine())); }
0
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
public void testAddSelf() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add(headers); }
0
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public boolean isDone() { return done.isOn(); }
1
Java
NVD-CWE-noinfo
null
null
null
safe
public static Object readObject(XStream xStream, InputStream is) { try(InputStreamReader isr = new InputStreamReader(is, ENCODING);) { return xStream.fromXML(isr); } catch (Exception e) { throw new OLATRuntimeException(XStreamHelper.class, "could not read Object from inputstream: " + is, e); } }
0
Java
CWE-91
XML Injection (aka Blind XPath Injection)
The software does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.
https://cwe.mitre.org/data/definitions/91.html
vulnerable
parse_io(ThreadContext context, IRubyObject klazz, IRubyObject data, IRubyObject enc) { //int encoding = (int)enc.convertToInteger().getLongValue(); final Ruby runtime = context.runtime; XmlSaxParserContext ctx = newInstance(runtime, (RubyClass) klazz); ctx.initializ...
0
Java
CWE-241
Improper Handling of Unexpected Data Type
The software does not handle or incorrectly handles when a particular element is not the expected type, e.g. it expects a digit (0-9) but is provided with a letter (A-Z).
https://cwe.mitre.org/data/definitions/241.html
vulnerable
public WorkflowSearcher(Map<String, Object> map, User user) { schemeId = getStringValue("schemeId", map); assignedTo = getStringValue("assignedTo", map); createdBy = getStringValue("createdBy", map); stepId = getStringValue("stepId", map); keywords = getStringValue("keywords", map); orderBy = getStringVal...
1
Java
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
private void store_pubkey(File dbPath, String serverName, String pk) { ArrayList<String> lines = new ArrayList<String>(); File vncDir = new File(FileUtils.getVncHomeDir()); try { if (dbPath.exists()) { FileReader db = new FileReader(dbPath); BufferedReader dbBuf = n...
1
Java
CWE-295
Improper Certificate Validation
The software does not validate, or incorrectly validates, a certificate.
https://cwe.mitre.org/data/definitions/295.html
safe
private ModelAndView addGroup(HttpServletRequest request, HttpServletResponse response) throws Exception { String groupName = request.getParameter("groupName"); String groupComment = request.getParameter("groupComment"); if (groupComment == null) { groupComme...
1
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
public void testGetAndRemove() { final HttpHeadersBase headers = newEmptyHeaders(); headers.add("name1", "value1"); headers.add("name2", "value2", "value3"); headers.add("name3", "value4", "value5", "value6"); assertThat(headers.getAndRemove("name1", "defaultvalue")).isEqual...
0
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public SpotProtocolDecoder(Protocol protocol) { super(protocol); try { DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance(); builderFactory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); builderFactory.setFeature(...
1
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
safe
public MultiMap add(String name, String value) { HttpUtils.validateHeader(name, value); headers.add(toLowerCase(name), value); return this; }
1
Java
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
safe
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (keySpec == null) { ...
0
Java
CWE-787
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
https://cwe.mitre.org/data/definitions/787.html
vulnerable
public AbstractXmlConfigRootTagRecognizer(String expectedRootNode) throws Exception { this.expectedRootNode = expectedRootNode; SAXParserFactory factory = SAXParserFactory.newInstance(); saxParser = factory.newSAXParser(); }
0
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
vulnerable
public String getEncryptedValue() { try { Cipher cipher = getCipher("AES"); cipher.init(Cipher.ENCRYPT_MODE, getKey()); // add the magic suffix which works like a check sum. return new String(Base64.encode(cipher.doFinal((value+MAGIC).getBytes("UTF-8")))); ...
0
Java
NVD-CWE-noinfo
null
null
null
vulnerable
public void setProperty(String name, Object value) throws SAXException { getXMLReader().setProperty(name, value); }
1
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
safe
public Document read(InputStream in) throws DocumentException { InputSource source = new InputSource(in); if (this.encoding != null) { source.setEncoding(this.encoding); } return read(source); }
0
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
vulnerable
private String getLocalePrefix(FacesContext context) { String localePrefix = null; localePrefix = context.getExternalContext().getRequestParameterMap().get("loc"); if(localePrefix != null && !nameContainsForbiddenSequence(localePrefix)){ return localePrefix; ...
1
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
private static void assertQueryStringAllowed(String rawPath, String expectedQuery) { final PathAndQuery res = parse(rawPath); assertThat(res) .as("parse(\"%s\") must return non-null.", rawPath) .isNotNull(); assertThat(res.query()) .as("parse(\...
1
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
public void translate(MobEquipmentPacket packet, GeyserSession session) { if (!session.isSpawned() || packet.getHotbarSlot() > 8 || packet.getContainerId() != ContainerId.INVENTORY || session.getPlayerInventory().getHeldItemSlot() == packet.getHotbarSlot()) { // For the last cond...
0
Java
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
vulnerable
public AuthorizationCodeRequestUrl newAuthorizationUrl() { return new AuthorizationCodeRequestUrl(authorizationServerEncodedUrl, clientId).setScopes( scopes); }
0
Java
CWE-863
Incorrect Authorization
The software 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.
https://cwe.mitre.org/data/definitions/863.html
vulnerable
protected void init(final Form< ? > form) { this.form = form; csrfTokenHandler = new CsrfTokenHandler(form); mainSubContainer.add(form); form.add(gridContentContainer); form.add(buttonBarContainer); if (showCancelButton == true) { final SingleButtonPanel cancelButton = appendNewAjaxAct...
1
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
public void translate(ServerPlayerSetExperiencePacket packet, GeyserSession session) { SessionPlayerEntity entity = session.getPlayerEntity(); AttributeData experience = GeyserAttributeType.EXPERIENCE.getAttribute(packet.getExperience()); entity.getAttributes().put(GeyserAttributeType.EXPER...
0
Java
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
vulnerable
public static String getAttachedFilePath(String inputStudyOid) { // Using a standard library to validate/Sanitize user inputs which will be used in path expression to prevent from path traversal String studyOid = FilenameUtils.getName(inputStudyOid); String attachedFilePath = CoreResources.getFie...
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
private void add0(int h, int i, AsciiString name, String value) { validateValue(value); // Update the hash table. entries[i] = new HeaderEntry(h, name, value, entries[i]); ++size; }
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
public void emptyHeadersShouldBeEqual() { final HttpHeadersBase headers1 = newEmptyHeaders(); final HttpHeadersBase headers2 = newEmptyHeaders(); assertThat(headers2).isEqualTo(headers1); assertThat(headers2.hashCode()).isEqualTo(headers1.hashCode()); }
0
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public void testSetContentFromFile() throws Exception { TestHttpData test = new TestHttpData("test", UTF_8, 0); try { File tmpFile = File.createTempFile(UUID.randomUUID().toString(), ".tmp"); tmpFile.deleteOnExit(); FileOutputStream fos = new FileOutputStream(tmpF...
0
Java
CWE-379
Creation of Temporary File in Directory with Insecure Permissions
The software creates a temporary file in a directory whose permissions allow unintended actors to determine the file's existence or otherwise access that file.
https://cwe.mitre.org/data/definitions/379.html
vulnerable
protected Key engineDoPhase( Key key, boolean lastPhase) throws InvalidKeyException, IllegalStateException { if (x == null) { throw new IllegalStateException("Diffie-Hellman not initialised."); } if (!(key instanceof DHPublicKey)) ...
1
Java
CWE-320
Key Management Errors
Weaknesses in this category are related to errors in the management of cryptographic keys.
https://cwe.mitre.org/data/definitions/320.html
safe
public XssHttpServletRequestWrapper(HttpServletRequest request) { super(request); }
0
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
public byte[] toByteArray() { /* index || secretKeySeed || secretKeyPRF || publicSeed || root */ int n = params.getDigestSize(); int indexSize = (params.getHeight() + 7) / 8; int secretKeySize = n; int secretKeyPRFSize = n; int publicSeedSize = n; int rootSize =...
0
Java
CWE-502
Deserialization of Untrusted Data
The application deserializes untrusted data without sufficiently verifying that the resulting data will be valid.
https://cwe.mitre.org/data/definitions/502.html
vulnerable
private File getFileFor(ConfidentialKey key) { return new File(rootDir, key.getId()); }
1
Java
NVD-CWE-noinfo
null
null
null
safe
public void test_notLike_startsWith() { Entity from = from(Entity.class); where(from.getCode()).notLike().startsWith("test"); Query<Entity> select = select(from); assertEquals("select entity_0 from Entity entity_0 where entity_0.code not like :code_1", select.getQuery()); assertEquals("test%", select.getPar...
1
Java
NVD-CWE-noinfo
null
null
null
safe
public void translate(CommandRequestPacket packet, GeyserSession session) { String command = packet.getCommand().replace("/", ""); CommandManager commandManager = GeyserConnector.getInstance().getCommandManager(); if (session.getConnector().getPlatformType() == PlatformType.STANDALONE && com...
0
Java
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
vulnerable
public boolean isResetPasswordSent() { // If there is no form and we see an info box, then the request was sent. return !getDriver().hasElementWithoutWaiting(By.cssSelector("#resetPasswordForm")) && messageBox.getText().contains("An e-mail was sent to"); }
0
Java
CWE-640
Weak Password Recovery Mechanism for Forgotten Password
The software contains a mechanism for users to recover or change their passwords without knowing the original password, but the mechanism is weak.
https://cwe.mitre.org/data/definitions/640.html
vulnerable
public void testHeaderNameStartsWithControlChar1d() { testHeaderNameStartsWithControlChar(0x1d); }
1
Java
CWE-444
Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by ...
https://cwe.mitre.org/data/definitions/444.html
safe
void emptyHeadersShouldBeEqual() { final HttpHeadersBase headers1 = newEmptyHeaders(); final HttpHeadersBase headers2 = newEmptyHeaders(); assertThat(headers2).isEqualTo(headers1); assertThat(headers2.hashCode()).isEqualTo(headers1.hashCode()); }
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
public PBEWithSHA1AESCBC192() { super(new CBCBlockCipher(new AESEngine()), PKCS12, SHA1, 192, 16); }
1
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
safe
public void subValidateFail(ViolationCollector col) { col.addViolation(FAILED+"subclass"); }
0
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public String getPasswordValue(Object o) { if (o==null) return null; if (o instanceof Secret) return ((Secret)o).getEncryptedValue(); if (getIsUnitTest()) { throw new SecurityException("attempted to render plaintext ‘" + o + "’ in password field; use a getter of type Secret...
1
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
safe
protected String getCorsDomain(String referer, String userAgent) { String dom = null; if (referer != null && referer.toLowerCase() .matches("https?://([a-z0-9,-]+[.])*draw[.]io/.*")) { dom = referer.toLowerCase().substring(0, referer.indexOf(".draw.io/") + 8); } else if (referer != null && refe...
0
Java
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.
https://cwe.mitre.org/data/definitions/918.html
vulnerable
public byte[] decrypt(final JWEHeader header, final Base64URL encryptedKey, final Base64URL iv, final Base64URL cipherText, final Base64URL authTag) throws JOSEException { final JWEAlgorithm alg = header.getAlgorithm(); final ECDH.AlgorithmMode algMode = ECDH.resolveAlgorithm...
0
Java
CWE-347
Improper Verification of Cryptographic Signature
The software does not verify, or incorrectly verifies, the cryptographic signature for data.
https://cwe.mitre.org/data/definitions/347.html
vulnerable
public void checkAccess(Thread t) { if (RobocodeProperties.isSecurityOff()) { return; } Thread c = Thread.currentThread(); if (isSafeThread(c)) { return; } super.checkAccess(t); // Threads belonging to other thread groups is not allowed to access threads belonging to other thread groups // Bug ...
1
Java
CWE-862
Missing Authorization
The software does not perform an authorization check when an actor attempts to access a resource or perform an action.
https://cwe.mitre.org/data/definitions/862.html
safe
void colon() { assertThat(PathAndQuery.parse("/:")).isNotNull(); assertThat(PathAndQuery.parse("/:/")).isNotNull(); assertThat(PathAndQuery.parse("/a/:")).isNotNull(); assertThat(PathAndQuery.parse("/a/:/")).isNotNull(); }
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { HttpSession session = request.getSession(false); if (session == null) { AccessControlContext acc = AccessController.getContext(); Subject subject = Subject.getS...
1
Java
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
safe
public static void testSetCompact() throws Exception { TMemoryInputTransport buf = new TMemoryInputTransport(kCompactSetEncoding); TProtocol iprot = new TCompactProtocol(buf); testTruncated(new MySetStruct(), iprot); }
1
Java
CWE-770
Allocation of Resources Without Limits or Throttling
The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.
https://cwe.mitre.org/data/definitions/770.html
safe
public void testHeaderNameStartsWithControlChar1c() { testHeaderNameStartsWithControlChar(0x1c); }
1
Java
CWE-444
Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by ...
https://cwe.mitre.org/data/definitions/444.html
safe
public void testCurveMismatch() throws Exception { // EC key on P_256 ECParameterSpec ecParameterSpec = ECKey.Curve.P_256.toECParameterSpec(); KeyPairGenerator generator = KeyPairGenerator.getInstance("EC"); generator.initialize(ecParameterSpec); KeyPair keyPair = generator.generateKeyPair(); ECKey ec...
1
Java
CWE-347
Improper Verification of Cryptographic Signature
The software does not verify, or incorrectly verifies, the cryptographic signature for data.
https://cwe.mitre.org/data/definitions/347.html
safe
public Cipher decrypt() { try { Cipher cipher = Secret.getCipher(KEY_ALGORITHM); cipher.init(Cipher.DECRYPT_MODE, getKey()); return cipher; } catch (GeneralSecurityException e) { throw new AssertionError(e); } }
1
Java
CWE-326
Inadequate Encryption Strength
The software stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.
https://cwe.mitre.org/data/definitions/326.html
safe
static DataSource lookupDataSource(Hints hints) throws FactoryException { Object hint = hints.get(Hints.EPSG_DATA_SOURCE); if (hint instanceof DataSource) { return (DataSource) hint; } else if (hint instanceof String) { String name = (String) hint; Initial...
0
Java
CWE-20
Improper Input Validation
The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.
https://cwe.mitre.org/data/definitions/20.html
vulnerable
private static Stream<Arguments> provideFilesAndExpectedExceptionType() { return Stream.of( Arguments.of("abnormal/corrupt-header.rar", CorruptHeaderException.class), Arguments.of("abnormal/mainHeaderNull.rar", BadRarArchiveException.class), Arguments.of("abnormal/loop.ra...
1
Java
CWE-835
Loop with Unreachable Exit Condition ('Infinite Loop')
The program contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.
https://cwe.mitre.org/data/definitions/835.html
safe
protected Map<String, Serializable> getPrincipal(Jwt jwt) { Map<String, Serializable> principal = new HashMap<>(); principal.put("jwt", (Serializable) jwt.getBody()); return principal; }
0
Java
CWE-347
Improper Verification of Cryptographic Signature
The software does not verify, or incorrectly verifies, the cryptographic signature for data.
https://cwe.mitre.org/data/definitions/347.html
vulnerable
public static String getRealIp(HttpServletRequest request) { //bae env if (ZrLogUtil.isBae() && request.getHeader("clientip") != null) { return request.getHeader("clientip"); } String ip = request.getHeader("X-forwarded-for"); if (ip == null || ip.length() == 0 ||...
0
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
vulnerable
public ECIESwithAES() { super(new AESEngine()); }
0
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
Randoms() { random = new Random(); Date date = new Date(); random.setSeed(date.getTime()); }
0
Java
CWE-327
Use of a Broken or Risky Cryptographic Algorithm
The use of a broken or risky cryptographic algorithm is an unnecessary risk that may result in the exposure of sensitive information.
https://cwe.mitre.org/data/definitions/327.html
vulnerable
protected void before() throws Throwable { byte[] random = new byte[32]; sr.nextBytes(random); value = Util.toHexString(random); Secret.SECRET = value; }
1
Java
NVD-CWE-noinfo
null
null
null
safe
public void addViolation(String propertyName, Integer index, String message) { addViolation(propertyName, index, message, Collections.emptyMap()); }
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
public FilterRegistrationBean<XssFilter> croseSiteFilter(){ FilterRegistrationBean<XssFilter> registrationBean = new FilterRegistrationBean<>(); registrationBean.setFilter(new XssFilter()); registrationBean.addUrlPatterns("/*"); return registrationBean; }
1
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
safe
public void headerMultipleContentLengthValidationShouldPropagate() { headerMultipleContentLengthValidationShouldPropagate(false); }
1
Java
CWE-444
Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
The product acts as an intermediary HTTP agent (such as a proxy or firewall) in the data flow between two entities such as a client and server, but it does not interpret malformed HTTP requests or responses in ways that are consistent with how the messages will be processed by ...
https://cwe.mitre.org/data/definitions/444.html
safe
private void writeFile( Path path, FileItem uploadedItem ) throws IOException { if ( !ioService.exists( path ) ) { ioService.createFile( path ); } ioService.write( path, IOUtils.toByteArray( uploadedItem.getInputStream() ) ); uploadedItem.get...
1
Java
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.
https://cwe.mitre.org/data/definitions/264.html
safe
public UserCause(@CheckForNull User user, @CheckForNull String message) { this( user != null ? user.getId() : null, message != null ? " : " + message : "" ); }
1
Java
CWE-200
Exposure of Sensitive Information to an Unauthorized Actor
The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.
https://cwe.mitre.org/data/definitions/200.html
safe
public void test_notLike_endsWith() { Entity from = from(Entity.class); where(from.getCode()).notLike().endsWith("test"); Query<Entity> select = select(from); assertEquals("select entity_0 from Entity entity_0 where entity_0.code not like '%test'", select.getQuery()); }
0
Java
NVD-CWE-noinfo
null
null
null
vulnerable
public IESParameterSpec( byte[] derivation, byte[] encoding, int macKeySize, int cipherKeySize) { this(derivation, encoding, macKeySize, cipherKeySize, null, false); }
0
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
public void testValidGroupIds() { testInvalidGroupId("John-Doe",false); testInvalidGroupId("Jane/Doe",false); testInvalidGroupId("John.Doe",false); testInvalidGroupId("Jane#Doe", false); testInvalidGroupId("John@Döe.com", false); testInvalidGroupId("JohnDoé", false); ...
1
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
safe
public void testReadBytesAndWriteBytesWithFileChannel() throws IOException { File file = File.createTempFile("file-channel", ".tmp"); RandomAccessFile randomAccessFile = null; try { randomAccessFile = new RandomAccessFile(file, "rw"); FileChannel channel = randomAcces...
0
Java
CWE-378
Creation of Temporary File With Insecure Permissions
Opening temporary files without appropriate measures or controls can leave the file, its contents and any function that it impacts vulnerable to attack.
https://cwe.mitre.org/data/definitions/378.html
vulnerable
protected void store(byte[] payload) throws IOException { ConfidentialStore.get().store(this,payload); }
1
Java
NVD-CWE-noinfo
null
null
null
safe
protected int typeMinimumSize(byte type) { switch (type & 0x0f) { case TType.BOOL: case TType.BYTE: case TType.I16: // because of variable length encoding case TType.I32: // because of variable length encoding case TType.I64: // because of variable length encoding return 1; ...
1
Java
CWE-770
Allocation of Resources Without Limits or Throttling
The software allocates a reusable resource or group of resources on behalf of an actor without imposing any restrictions on the size or number of resources that can be allocated, in violation of the intended security policy for that actor.
https://cwe.mitre.org/data/definitions/770.html
safe
public void create_withNullThreadPool() throws Exception { final JettyServerFactory jettyServerFactory = mock(JettyServerFactory.class); final StaticFilesConfiguration staticFilesConfiguration = mock(StaticFilesConfiguration.class); final Routes routes = mock(Routes.class); when(jet...
1
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
safe
private void checkInvalidCallback(boolean streaming) throws URISyntaxException, IOException, ParseException { JolokiaHttpHandler handler = new JolokiaHttpHandler(getConfig(ConfigKey.SERIALIZE_EXCEPTION, Boolean.toString(streaming))); handler.start(false); HttpExchange exchange = prepareExch...
1
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
safe
public static String htmlEscape(String text) { StringBuilder buf = new StringBuilder(text.length()+64); for( int i=0; i<text.length(); i++ ) { char ch = text.charAt(i); if(ch=='<') buf.append("&lt;"); else if(ch=='&') bu...
1
Java
CWE-79
Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
The software 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.
https://cwe.mitre.org/data/definitions/79.html
safe
public JpaOrder with(Direction order) { return new JpaOrder(order, getProperty(), getNullHandling(), isIgnoreCase(), this.unsafe); }
1
Java
CWE-89
Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/89.html
safe
public void doHeapDump(StaplerRequest req, StaplerResponse rsp) throws IOException, InterruptedException { owner.checkPermission(Jenkins.ADMINISTER); rsp.setContentType("application/octet-stream"); FilePath dump = obtain(); try { dump.copyTo(rsp.g...
0
Java
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.
https://cwe.mitre.org/data/definitions/264.html
vulnerable
final void setObject(CharSequence name, Iterable<?> values) { final AsciiString normalizedName = HttpHeaderNames.of(name); requireNonNull(values, "values"); final int h = normalizedName.hashCode(); final int i = index(h); remove0(h, i, normalizedName); for (Object v...
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
private static AsciiString normalizeName(CharSequence name) { checkArgument(requireNonNull(name, "name").length() > 0, "name is empty."); return HttpHeaderNames.of(name); }
0
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
vulnerable
public static IRubyObject from_document(ThreadContext context, IRubyObject klazz, IRubyObject document) { XmlDocument doc = ((XmlDocument) ((XmlNode) document).document(context)); RubyArray errors = (RubyArray) doc.getInstanceVariable("@errors"); if (!errors.isEmpty()) { throw (...
0
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
vulnerable
void plus() { final PathAndQuery res = PathAndQuery.parse("/+?a+b=c+d"); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/+"); assertThat(res.query()).isEqualTo("a+b=c+d"); final PathAndQuery res2 = PathAndQuery.parse("/%2b?a%2bb=c%2bd"); assertThat(re...
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
public Controller execute(FolderComponent folderComponent, UserRequest ureq, WindowControl wControl, Translator trans) { setTranslator(trans); currentContainer = folderComponent.getCurrentContainer(); if (currentContainer.canWrite() != VFSConstants.YES) { throw new AssertException("Cannot write to current fol...
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (!haskey) { // The key ...
0
Java
CWE-787
Out-of-bounds Write
The software writes data past the end, or before the beginning, of the intended buffer.
https://cwe.mitre.org/data/definitions/787.html
vulnerable
private byte[] verifyMagic(byte[] payload) { int payloadLen = payload.length-MAGIC.length; if (payloadLen<0) return null; // obviously broken for (int i=0; i<MAGIC.length; i++) { if (payload[payloadLen+i]!=MAGIC[i]) return null; // broken } ...
1
Java
NVD-CWE-noinfo
null
null
null
safe
void doubleQuote() { final PathAndQuery res = PathAndQuery.parse("/\"?\""); assertThat(res).isNotNull(); assertThat(res.path()).isEqualTo("/%22"); assertThat(res.query()).isEqualTo("%22"); }
0
Java
CWE-22
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
The software 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 software does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of t...
https://cwe.mitre.org/data/definitions/22.html
vulnerable
public void destroy() { if (_configuration == null) { return; } _classLoaderHelperUtilities.clear(); _classLoaderHelperUtilities = null; _configuration.clearEncodingMap(); _configuration.clearSharedVariables(); _configuration.clearTemplateCache(); _configuration = null; _restrictedHelperUtili...
1
Java
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.
https://cwe.mitre.org/data/definitions/264.html
safe
private PropPatchParseResult parseContent( byte[] arr ) throws IOException, SAXException { if( arr.length > 0 ) { log.debug( "processing content" ); ByteArrayInputStream bin = new ByteArrayInputStream( arr ); XMLReader reader = XMLReaderFactory.createXMLReader(); ...
1
Java
CWE-611
Improper Restriction of XML External Entity Reference
The software processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.
https://cwe.mitre.org/data/definitions/611.html
safe
private static AsciiString validate(AsciiString name) { if (name.isEmpty()) { throw new IllegalArgumentException("malformed header name: <EMPTY>"); } final int lastIndex; try { lastIndex = name.forEachByte(value -> { if ((value & PROHIBITED_NA...
1
Java
CWE-74
Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
The software constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.
https://cwe.mitre.org/data/definitions/74.html
safe
protected Response newBrowserAuthentication(AuthenticationSessionModel authSession, boolean isPassive, boolean redirectToAuthentication, SamlProtocol samlProtocol) { // Saml ECP flow creates only TRANSIENT user sessions authSession.setClientNote(AuthenticationManager.USER_SESSION_PERSISTENT_STATE, U...
1
Java
CWE-287
Improper Authentication
When an actor claims to have a given identity, the software does not prove or insufficiently proves that the claim is correct.
https://cwe.mitre.org/data/definitions/287.html
safe
protected void sendResponse(HttpSession session, Subject subject, PrintWriter out) { String token = (String) session.getAttribute(LOGIN_TOKEN); if ( token == null) { byte[] seed = (subject.toString() + new Long(System.currentTimeMillis()).toString()).getBytes(); SecureRando...
1
Java
CWE-352
Cross-Site Request Forgery (CSRF)
The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
https://cwe.mitre.org/data/definitions/352.html
safe
public void existingDocumentFromUINoName() throws Exception { // current document = xwiki:Main.WebHome DocumentReference documentReference = new DocumentReference("xwiki", Arrays.asList("Main"), "WebHome"); XWikiDocument document = mock(XWikiDocument.class); when(document.getDocu...
0
Java
CWE-862
Missing Authorization
The software does not perform an authorization check when an actor attempts to access a resource or perform an action.
https://cwe.mitre.org/data/definitions/862.html
vulnerable
public ECIESwithCipher(BlockCipher cipher) { super(new IESEngine(new ECDHBasicAgreement(), new KDF2BytesGenerator(new SHA1Digest()), new HMac(new SHA1Digest()), new PaddedBufferedBlockCipher(cipher))); ...
0
Java
CWE-310
Cryptographic Issues
Weaknesses in this category are related to the design and implementation of data confidentiality and integrity. Frequently these deal with the use of encoding techniques, encryption libraries, and hashing algorithms. The weaknesses in this category could lead to a degradation of the quality data if they are not address...
https://cwe.mitre.org/data/definitions/310.html
vulnerable
public int encryptWithAd(byte[] ad, byte[] plaintext, int plaintextOffset, byte[] ciphertext, int ciphertextOffset, int length) throws ShortBufferException { int space; if (ciphertextOffset > ciphertext.length) space = 0; else space = ciphertext.length - ciphertextOffset; if (keySpec == null) { ...
0
Java
CWE-125
Out-of-bounds Read
The software reads data past the end, or before the beginning, of the intended buffer.
https://cwe.mitre.org/data/definitions/125.html
vulnerable